Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. class AppThreePlusThree extends StatelessWidget {
  2. @override
  3. Widget build(BuildContext context) {
  4. var game = new Game();
  5. var counter = 265;
  6. return new GameRedux(
  7. counter: counter,
  8. child: new MaterialApp(
  9. title: '3 + 3',
  10. theme: new ThemeData(
  11. primarySwatch: Colors.blue,
  12. ),
  13. home: new Scaffold(
  14. ...
  15. ...
  16. new Text('$counter'),
  17. ...
  18.  
  19. class AppThreePlusThree extends StatefulWidget {
  20. _AppThreePlusThreeState createState() => _AppThreePlusThreeState ();
  21. }
  22.  
  23. class _AppThreePlusThreeState extends State<AppThreePlusThree> {
  24. var counter = 265;
  25. @override
  26. Widget build(BuildContext context) {
  27. var game = new Game();
  28. setState(() => counter = 265);//I seriously doesnt have any idea how you are going to change or update your counter variable. something like this should work
  29. return new GameRedux(
  30. counter: counter,
  31. child: new MaterialApp(
  32. title: '3 + 3',
  33. theme: new ThemeData(
  34. primarySwatch: Colors.blue,
  35. ),
  36. home: new Scaffold(
  37. ...
  38. ...
  39. new Text('$counter'),
  40. ...
Add Comment
Please, Sign In to add comment