Download Flutter SDK, extract the "Flutter" folder and put somewhere on your machine https://flutter.dev/docs/get-started/install
Add path for 'location/flutter/bin'
| // A fun little game written in SwiftUI | |
| // Copyright (c) John Sundell 2020, MIT license. | |
| // This is a hacky implementation written just for fun. | |
| // It's only verified to work on iPhones in portrait mode. | |
| import SwiftUI | |
| final class GameController: ObservableObject { | |
| @Published var plane = GameObject.plane() | |
| @Published private(set) var clouds = [GameObject]() |
| import SwiftUI | |
| import PlaygroundSupport | |
| struct Screen: View { | |
| var body: some View { | |
| ScrollView { | |
| VStack { | |
| Text("5:45").font(.system(size: 64, weight: .thin)) | |
| Text("Monday, May 11").font(.system(size: 24)) | |
| }.padding(.vertical, 32) |
| import SwiftUI | |
| extension Calendar { | |
| func generateDates( | |
| inside interval: DateInterval, | |
| matching components: DateComponents | |
| ) -> [Date] { | |
| var dates: [Date] = [] | |
| dates.append(interval.start) |
| import 'dart:async'; | |
| import 'package:flutter/cupertino.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| import 'package:video_player/video_player.dart'; | |
| import 'package:orientation/orientation.dart'; | |
| import 'package:chewie/chewie.dart'; |
| import 'package:flutter/material.dart'; | |
| import 'package:bloc/bloc.dart'; | |
| import 'package:flutter_bloc/flutter_bloc.dart'; | |
| class SimpleBlocDelegate extends BlocDelegate { | |
| @override | |
| void onEvent(Bloc bloc, Object event) { | |
| super.onEvent(bloc, event); | |
| print(event); | |
| } |
| // | |
| // DateField.swift | |
| // | |
| // Created by Szymon Lorenz on 22/2/20. | |
| // Copyright © 2020 Szymon Lorenz. All rights reserved. | |
| // | |
| import SwiftUI | |
| struct DateTextField: UIViewRepresentable { |
| SliverPersistentHeader( | |
| delegate: SliverAppBarDelegate((context, _, __, progress) => HistoryPersistentHeaderTile(), | |
| collapsedHeight: Dimensions.fixedHeaderHeight, | |
| expandedHeight: Dimensions.fixedHeaderHeight), | |
| pinned: true), |
| class Solution { | |
| func reverse(_ x: Int) -> Int { | |
| let str: String = String(x) | |
| let arr = str.reversed().filter{( $0 != ".")} | |
| var result: Int | |
| var resStr: String = "" | |
| if x == -0 { | |
| return 0 | |
| } |
Download Flutter SDK, extract the "Flutter" folder and put somewhere on your machine https://flutter.dev/docs/get-started/install
Add path for 'location/flutter/bin'
| // | |
| // BottomSheetView.swift | |
| // | |
| // Created by Majid Jabrayilov | |
| // Copyright © 2019 Majid Jabrayilov. All rights reserved. | |
| // | |
| import SwiftUI | |
| fileprivate enum Constants { | |
| static let radius: CGFloat = 16 |