This file contains hidden or 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'; | |
import 'dart:math' as math; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
This file contains hidden or 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 'dart:async'; | |
import 'package:flutter/material.dart'; | |
final ValueNotifier<bool> useFix = ValueNotifier<bool>(false); | |
const int payloadLength = 70000; | |
void main() => runApp(const App()); | |
class App extends StatelessWidget { | |
const App({Key? key}) : super(key: key); |
This file contains hidden or 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 'dart:async'; | |
import 'dart:math'; | |
Future<int> sumWithDelay(int a, int b) { | |
var completer = Completer<int>(); | |
var random = Random(); | |
int randomNumber = random.nextInt(10); | |
Timer(Duration(seconds: 1), () { | |
if (randomNumber > 5) { |
This file contains hidden or 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 'dart:async'; | |
void main() { | |
Future<void>.delayed(const Duration(seconds: 1), () => print(2)); | |
Future<void>.delayed(Duration.zero, () => print(5)); | |
Future<void>(() => print(4)).then<void>((_) => print(3)); | |
Future<void>.sync(() => print(0)); | |
Future<void>.microtask(() => print(9)).then((_) => print(8)); | |
scheduleMicrotask(() => print(7)); | |
print(10); |