Created
February 7, 2019 15:30
-
-
Save dsrenesanse/e02d6f0d56ed5127784f56b7f2d25c31 to your computer and use it in GitHub Desktop.
View
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'; | |
import 'mutator.dart'; | |
import 'state.dart'; | |
void main() { | |
runApp(VMSApp()); | |
} | |
class VMSApp extends StatelessWidget { | |
build(context) { | |
return MaterialApp( | |
theme: ThemeData.dark(), | |
home: Scaffold( | |
body: Center( | |
child: StreamBuilder( | |
stream: state.valueElementState.valueStream, | |
builder: (context, stream){ | |
return Text(stream.data ?? state.valueElementState.value.toString()); | |
}) | |
), | |
floatingActionButton: FloatingActionButton( | |
onPressed: (){ | |
mutator.mutateState(Actions.Increment); | |
}, | |
child: Icon(Icons.add), | |
) | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment