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'; | |
class GraphData { | |
final Color color; | |
final List<int> values; | |
GraphData({ | |
required this.color, | |
required this.values, | |
}); |
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() async { | |
runApp(MyApp()); | |
await Future.delayed(Duration(seconds: 5)); | |
runApp(MyApp2()); | |
} | |
class MyApp2 extends StatelessWidget { |
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
const horizontalPadding = 16.0; | |
const controllerBorderRadius = BorderRadius.all(Radius.circular(2.0)); | |
const controllerHeight = 4.0; | |
const controllerWidth = 32.0; | |
const systemAppBarHeight = 48.0; | |
const keyboardHeight = 282; |
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/scheduler.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatefulWidget { | |
@override | |
_MyAppState createState() => _MyAppState(); |
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
typedef ValueBuilder<T> = Widget Function(BuildContext context, T value); | |
typedef ErrorBuilder = Widget Function(BuildContext context, Object error); | |
class OsamBuilder<T> extends StatefulWidget { | |
final ValueStream<T> stream; | |
final ValueBuilder<T> builder; | |
final ErrorBuilder errorBuilder; | |
const OsamBuilder({Key key, @required this.stream, @required this.builder, this.errorBuilder}) : super(key: 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
typedef ValueBuilder<T> = Widget Function(BuildContext context, T value); | |
typedef ErrorBuilder = Widget Function(BuildContext context, Object error); | |
class OsamBuilder<T> extends StatefulWidget { | |
final ValueStream<T> stream; | |
final ValueBuilder<T> builder; | |
final ErrorBuilder errorBuilder; | |
const OsamBuilder({Key key, @required this.stream, @required this.builder, this.errorBuilder}) : super(key: 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
class Cancelable<O> implements Future { | |
final Completer<O> _completer; | |
final VoidCallback onCancel; | |
Cancelable(this._completer, this.onCancel); | |
void cancel() { | |
onCancel(); | |
if (!_completer.isCompleted) _completer.completeError(CanceledError()); | |
} |
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() { | |
// failure | |
final t1 = State1(); | |
t1._stateBroadcaster.add(true); | |
//works fine | |
final t2 = State2(); | |
t2._stateBroadcaster.add(true); | |
} |
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
/// Data layer | |
// api | |
enum Mode { | |
mock, | |
stage | |
} | |
abstract class FireBaseApi { |
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'; | |
import 'package:built_collection/built_collection.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
const iterations = 100000; | |
void main() { | |
test("test", () async { | |
final numbers = List.generate(iterations, (index) => index); |
NewerOlder