(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| {"lastUpload":"2020-06-23T01:33:43.591Z","extensionVersion":"v3.4.3"} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| void main() { | |
| print('gist for dart'); | |
| } |
| class HairColorNotifier extends ValueNotifier<int> { | |
| HairColorNotifier(int value1) : super(value1); | |
| } | |
| class HairColorInheritedWidget extends InheritedNotifier<HairColorNotifier> { | |
| HairColorInheritedWidget( | |
| {Key? key, required Widget child, required HairColorNotifier notifier}) | |
| : super(key: key, child: child, notifier: notifier); |
| mixin Dog { | |
| void run() { | |
| print('Dog run'); | |
| } | |
| void walk() { | |
| print('Dog walk'); | |
| } | |
| } |
| #!/bin/bash | |
| # 0. init git repository | |
| git init | |
| # 1. install node | |
| brew install node | |
| # 2. add conventional commit folders to .gitignore | |
| echo " |
| import 'dart:io'; | |
| import 'package:path/path.dart' as path; | |
| class FileUtil { | |
| static File getUniqueFile(String folderName, final String? fileName) { | |
| int num = 1; | |
| String destFileName = | |
| fileName ?? '${DateTime.now().millisecondsSinceEpoch}'; |
| // function void | |
| typedef FunctionVoid = void Function(); | |
| // function0 | |
| typedef Function0<T> = T Function(); | |
| // function1 | |
| typedef Function1<T, A> = T Function(A a); | |
| // uncurry function2 | |
| typedef UncurryFunction2<T, A, B> = T Function(A a, B b); |
| import 'dart:async'; | |
| import 'dart:math'; | |
| import 'package:collection/collection.dart'; | |
| extension on int { | |
| int get mb => this * 1024 * 1024; | |
| } | |
| void main() { | |
| DownloadPool pool = DownloadPool(maxTaskCount: 5, maxDownloadSpeed: 2.mb); |