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
/// ----------------------------------------------------------------------------- | |
/// AppSpacing | |
/// | |
/// Classe utilitária para padronização de espaçamentos na aplicação, promovendo | |
/// consistência visual e facilitando a manutenção do layout. | |
/// | |
/// Autor: Ulisses Hen - Mago do Flutter 🧙♂️ | |
/// ----------------------------------------------------------------------------- | |
class AppSpacing { |
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/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'dart:async'; | |
void main() { | |
// Initialize our error logger before running the app. | |
ErrorLogger.initialize(); | |
runApp(MyApp()); | |
} |
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:async'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class CallbackManager { |
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
void main() async { | |
print('A'); | |
printsync(); | |
print('G'); | |
} | |
void printsync() async { | |
print('B'); |
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
void main() async { | |
print('A'); | |
await Future(() { | |
print('B'); | |
Future(() => print('C')); | |
Future.microtask(() => print('D')); | |
Future(() => print('E')); | |
print('F'); | |
}); |
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
void main() { | |
Object obj = "Hello"; | |
print((obj as String).length); | |
obj = 10; | |
print((obj as int).isEven); |
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'; | |
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: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 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: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 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
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; |
NewerOlder