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
// ignore_for_file: public_member_api_docs | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.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
// ==UserScript== | |
// @name mark_vendor_viewed | |
// @description Mark all vendor files as viewed in PRs | |
// @author David Miguel | |
// @version 1.0 | |
// @namespace https://github.com/davidmigloz | |
// @match *://github.com/*/*/pull/*/files | |
// ==/UserScript== | |
(() => { | |
const markVendorBtn = document.createElement('button') |
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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return const MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
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() async { | |
// Stream from Iterable | |
final numList = [1, 2, 3]; | |
final numStream = Stream.fromIterable(numList); | |
await for (final num in numStream) { | |
print(num); | |
} | |
// Transforming Stream |
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 { | |
final stopwatch = Stopwatch()..start(); | |
final res = await runWithMinDuration(Duration(seconds: 5), tasks: [ | |
myTask1, | |
myTask2, | |
myTask3, | |
]); | |
print("Result: $res Execution time: ${stopwatch.elapsed.inSeconds}sec"); | |
} |
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 { | |
final stopwatch = Stopwatch()..start(); | |
final res = await runWithMinDuration([ | |
myTask1, | |
myTask2, | |
myTask3, | |
], minDuration: Duration(seconds: 5)); | |
print("Result: $res Execution time: ${stopwatch.elapsed.inSeconds}sec"); | |
} |
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 bodyTypes = [1, 2, 3]; | |
final children = [ | |
"Header", | |
for (final type in bodyTypes) 'Body$type', | |
"Footer" | |
]; | |
} |
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:math'; | |
void main() { | |
final children = [ | |
"Header", | |
if (hasBody1()) "Body1" else "Body2", | |
"Footer", | |
]; | |
} |
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 bodyElements = ["Body1", "Body2"]; | |
final children = ["Header", ...bodyElements, "Footer"]; | |
} |
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:collection/collection.dart'; | |
void main() { | |
// Mutable map | |
final mutableMap = { | |
1: "One", | |
2: "Two", | |
3: "Three", | |
}; | |
mutableMap[1] = "1"; |