Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
static const Widget _home = MyHomePage();
@override
Widget build(BuildContext context) => MaterialApp(
home: _home,
);
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() async {
final core = Core();
runApp(MaterialApp(
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@MariaMelnik
MariaMelnik / main.dart
Last active May 28, 2020 11:02
flutter: ReorderableListView with StreamBuilder example
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
MyBloc bloc = MyBloc();
runApp(MyApp(bloc: bloc,));
}
class MyApp extends StatelessWidget {
@MariaMelnik
MariaMelnik / main.dart
Created May 25, 2020 11:47
flutter: ReorderableListView issue demo (rebuilds children every time even if Key-Type of children wasn't changed)
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@MariaMelnik
MariaMelnik / main.dart
Created December 30, 2019 08:32
Example streamBuilder + hot reload
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@MariaMelnik
MariaMelnik / main.dart
Created December 12, 2019 11:07
dart: generics
import 'dart:async';
void main() {
final listOfTasks = [Task<int, int>(1, calc), Task<int, int>(3, calc)];
final task = listOfTasks.first;
method(task: task);
//тут я не могу узнать дженерик тип таски
}
typedef FutureOr<O> TaskFunction<I, O>(I arg);
@MariaMelnik
MariaMelnik / main.dart
Created October 18, 2019 16:45
dart: immutable classes question
import 'package:flutter_web/material.dart';
void main() {
num n = 5.5 % 1;
print(n.toString());
}
@immutable
class Unmodifiable {