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'; | |
import 'dart:async'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class CallbackManager { |
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 { | |
print('A'); | |
printsync(); | |
print('G'); | |
} | |
void printsync() async { | |
print('B'); |
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 { | |
print('A'); | |
await Future(() { | |
print('B'); | |
Future(() => print('C')); | |
Future.microtask(() => print('D')); | |
Future(() => print('E')); | |
print('F'); | |
}); |
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() { | |
Object obj = "Hello"; | |
print((obj as String).length); | |
obj = 10; | |
print((obj as int).isEven); |
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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
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 'dart:collection'; | |
void main() { | |
final baldes = [Balde(3), Balde(5)]; | |
const int litrosDesejado = 4; | |
final resultado = medirAgua(baldes, litrosDesejado); | |
if (resultado != null) { | |
for (var passo in resultado.caminho) { |
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 'dart:collection'; | |
void main() { | |
final baldes = [Balde(3), Balde(5)]; | |
const int litrosDesejado = 4; | |
final resultado = medirAgua(baldes, litrosDesejado); | |
if (resultado != null) { | |
for (var passo in resultado) { |
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() { | |
final balde3L = Balde(3); | |
final balde5L = Balde(5); | |
const int litrosDesejado = 4; | |
while (balde3L.litrosPreenchidos + balde5L.litrosPreenchidos != litrosDesejado) { | |
if(balde3L.capacidade >= litrosDesejado){ | |
balde3L.encher(); | |
continue; |
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
enum DocumentStatus { | |
pending, | |
approved, | |
rejected | |
} | |
class Document { | |
String title; | |
String content; | |
DocumentStatus status; |
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
enum DocumentStatus{ | |
pending, | |
approved, | |
rejected | |
} | |
class Document { | |
String title; | |
String content; | |
DocumentStatus status; |
NewerOlder