Skip to content

Commit

Permalink
Added generic type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrybak committed May 1, 2020
1 parent 60656e1 commit a0dcce1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Future<int> myFuture(int first, int second) async {
class MyButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Futuristic(
return Futuristic<int>(
futureBuilder: () => myFuture(1, 2),
initialBuilder: (context, start) => RaisedButton(child: Text('Go'), onPressed: start),
busyBuilder: (context) => CircularProgressIndicator(),
Expand Down Expand Up @@ -111,7 +111,7 @@ Future<int> myFuture(int first, int second) async {
class MyScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Futuristic(
return Futuristic<int>(
autoStart: true,
futureBuilder: () => myFuture(1, 2),
busyBuilder: (context) => CircularProgressIndicator(),
Expand Down
8 changes: 4 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Home extends StatelessWidget {
class GoodButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Futuristic(
return Futuristic<int>(
futureBuilder: () => goodFuture(1, 2),
initialBuilder: (_, start) => RaisedButton(child: Text('Good button example'), onPressed: start),
busyBuilder: (_) => CircularProgressIndicator(),
Expand All @@ -74,7 +74,7 @@ class GoodButton extends StatelessWidget {
class BadButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Futuristic(
return Futuristic<int>(
futureBuilder: () => badFuture(1, 2),
initialBuilder: (_, start) => RaisedButton(child: Text('Bad button example'), onPressed: start),
busyBuilder: (_) => CircularProgressIndicator(),
Expand All @@ -90,7 +90,7 @@ class GoodScreen extends StatelessWidget {
return Scaffold(
appBar: AppBar(title: Text('Good screen')),
body: Center(
child: Futuristic(
child: Futuristic<int>(
autoStart: true,
futureBuilder: () => goodFuture(1, 2),
busyBuilder: (_) => CircularProgressIndicator(),
Expand All @@ -108,7 +108,7 @@ class BadScreen extends StatelessWidget {
return Scaffold(
appBar: AppBar(title: Text('Bad screen')),
body: Center(
child: Futuristic(
child: Futuristic<int>(
autoStart: true,
futureBuilder: () => badFuture(1, 2),
busyBuilder: (_) => CircularProgressIndicator(),
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a0dcce1

Please sign in to comment.