Skip to content

Instantly share code, notes, and snippets.

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]);
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();
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
debugRepaintRainbowEnabled = true;
// BadPerformanceExample()
// GoodPerformanceExample()
runApp(MaterialApp(home: GoodPerformanceExample()));
}
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
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);
}
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: TestAnimation()));
}
class TestAnimation extends StatefulWidget {
const TestAnimation();
State<TestAnimation> createState() => _TestAnimationState();
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));
void main() {
final store = Store([
Category(
name: 'Электроника',
price: 0.0,
categories: [
Category(
name: 'Телефоны',
price: 0.0,
categories: [
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,