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
| final Expando<String> stringExpando = Expando<String>(); | |
| void main() { | |
| final user = User(id: 1); | |
| final user2 = User(id: 2); | |
| stringExpando[user] = 'test 1'; | |
| stringExpando[user2] = 'test 2'; | |
| print(stringExpando[user]); |
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'; | |
| // Every created zone (new zone creates new child in parent zone) - Will not propagate it's errors to it's parent. | |
| // So every zone is isolated from parents | |
| void main() => zoneCreation(() async { | |
| printSome(); | |
| zoneCreation(() { | |
| printSome(); |
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 'package:flutter/rendering.dart'; | |
| void main() { | |
| debugRepaintRainbowEnabled = true; | |
| // BadPerformanceExample() | |
| // GoodPerformanceExample() | |
| runApp(MaterialApp(home: GoodPerformanceExample())); | |
| } |
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 MaterialApp( |
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 itemController = ItemController(); | |
| final sword = Sword(id: 1, name: "Katana"); | |
| final trash = Trash(id: 2, name: "jar of shit"); | |
| itemController.getDesc(sword); | |
| itemController.getDesc(trash); | |
| itemController.use(sword); | |
| } |
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(MaterialApp(home: TestAnimation())); | |
| } | |
| class TestAnimation extends StatefulWidget { | |
| const TestAnimation(); | |
| State<TestAnimation> createState() => _TestAnimationState(); |
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"; | |
| // links | |
| // https://stackoverflow.com/questions/68009392/dart-custom-copywith-method-with-nullable-properties | |
| void main() { | |
| // test with first class | |
| final myClass = MyClass(id: 1); | |
| print(myClass.id); | |
| final copiedMyClass = myClass.copyWith(id: Optional(null)); |
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 store = Store([ | |
| Category( | |
| name: 'Электроника', | |
| price: 0.0, | |
| categories: [ | |
| Category( | |
| name: 'Телефоны', | |
| price: 0.0, | |
| categories: [ |
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( | |
| MaterialApp( | |
| home: Scaffold( | |
| body: Center( | |
| child: StoryAvatar( | |
| imageUrl: "https://avatar.iran.liara.run/public/boy?username=Ash", | |
| storyCount: 6, |