Created
October 5, 2021 11:09
-
-
Save AbhishekDoshi26/46d185b328e9db091b28582cda5d0c0a to your computer and use it in GitHub Desktop.
main.dart of state_notifier_example
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 'package:flutter_state_notifier/flutter_state_notifier.dart'; | |
import 'package:state_notifier_example/counter_service.dart'; | |
import 'package:state_notifier_example/home.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return StateNotifierProvider( | |
create: (BuildContext context) => CounterService(0), | |
child: MaterialApp( | |
title: 'Material App', | |
home: Home(), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment