Skip to content

Instantly share code, notes, and snippets.

@Zfinix
Last active February 19, 2020 13:07
Show Gist options
  • Select an option

  • Save Zfinix/3c7658395bd404625884dca979ad4e2b to your computer and use it in GitHub Desktop.

Select an option

Save Zfinix/3c7658395bd404625884dca979ad4e2b to your computer and use it in GitHub Desktop.
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
var controller = Provider.of<HomeController>(context);
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Current Value: ${controller.counter}'),
SizedBox(height:50),
RaisedButton(
onPressed:() => controller.increment,
child: Text('Increment')
)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment