This file contains 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'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
This file contains 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'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() async { | |
final core = Core(); | |
runApp(MaterialApp( |
This file contains 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'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key key}) : super(key: key); |
This file contains 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 { | |
static const Widget _home = MyHomePage(); | |
@override | |
Widget build(BuildContext context) => MaterialApp( | |
home: _home, | |
); |
This file contains 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'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key key}) : super(key: key); |
This file contains 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'; | |
import 'package:flutter/material.dart'; | |
abstract class MyStreamBuilderBase<T, S> extends StatefulWidget { | |
/// Creates a [MyStreamBuilderBase] connected to the specified [stream]. | |
const MyStreamBuilderBase({ Key key, this.stream }) : super(key: key); | |
/// The asynchronous computation to which this builder is currently connected, | |
/// possibly null. When changed, the current summary is updated using |
This file contains 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/widgets.dart'; | |
import 'new_sb_base.dart'; | |
class MyStreamBuilder<T> extends MyStreamBuilderBase<T, AsyncSnapshot<T>> { | |
/// Creates a new [MyStreamBuilder] that builds itself based on the latest | |
/// snapshot of interaction with the specified [stream] and whose build | |
/// strategy is given by [builder]. | |
/// | |
/// The [initialData] is used to create the initial snapshot. | |
/// |
This file contains 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:meta/meta.dart'; | |
void runner() { | |
try { | |
repository(); | |
} on RepositoryException catch (error, stackTrace) { | |
// Usually here you not only can log it but show some meaningfull information | |
// based on [RepositoryException.type]. So you don't even need to know how works // repository inside. | |
print('error: $error\nStackTrace:$stackTrace'); | |
} |
This file contains 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 fib = fibStream(); | |
print(fib.take(10)); | |
} | |
Iterable<int> fibStream() sync* { | |
final firstIt = fromList([0]).followedBy(fibStream()); | |
final secondIt = fromList([0,1]).followedBy(fibStream());; | |
yield* zipWith(sumInt, firstIt, secondIt); | |
} |
This file contains 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 inter = 23.96; | |
final minVal = 23.6; | |
final list1 = List.generate(5, (i) => minVal + i * inter); | |
print(list1); | |
int i = 0; | |
double val = minVal; | |