This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
extension NumExtension on num { | |
bool greaterThan(num other) => this > other; | |
} | |
class MyClass { | |
final bool a; | |
final bool b; | |
final bool c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Map<int, MapEntry<String, String>> m = {}; | |
m[5] = MapEntry("five", "5"); | |
print(m); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Pavel\AndroidStudioProjects\test_functional_widget>flutter doctor | |
Doctor summary (to see all details, run flutter doctor -v): | |
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.418], locale ru-RU) | |
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) | |
[√] Android Studio (version 3.5) | |
[√] Connected device (1 available) | |
• No issues found! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Pavel\AndroidStudioProjects\test_functional_widget>flutter run | |
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling | |
software rendering with "--enable-software-rendering". | |
generating build script... 27,9s | |
starting build daemon... 0,9s | |
Launching lib\main.dart on Android SDK built for x86 in debug mode... | |
Initializing gradle... 1,5s | |
Resolving dependencies... 5,6s | |
starting build daemon... 0,3s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Pavel\AndroidStudioProjects\test_functional_widget>flutter build apk | |
You are building a fat APK that includes binaries for android-arm, android-arm64. | |
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK | |
size. | |
To generate an app bundle, run: | |
flutter build appbundle --target-platform android-arm,android-arm64 | |
Learn more on: https://developer.android.com/guide/app-bundle | |
To split the APKs per ABI, run: | |
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi | |
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() async { | |
final square3Future = square(3); | |
final square4Future = square(4); | |
final square3 = await square3Future; | |
final square4 = await square4Future; | |
int sum = square3 + square4; | |
print('3^2 + 4^2 = $sum'); | |
} | |
Future<int> square(int val) async { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() async { | |
int sum = await square(3) + await square(4); | |
print('3^2 + 4^2 = $sum'); | |
} | |
Future<int> square(int val) async { | |
print('${DateTime.now()} started calculating $val^2'); | |
await Future.delayed(Duration(seconds: 1)); | |
int result = val * val; | |
print('${DateTime.now()} finished calculating $val^2'); |