Created
September 11, 2020 12:13
-
-
Save mahmudahsan/7308dc6e8b5843f84b8513b6bad0e1af to your computer and use it in GitHub Desktop.
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:states_bloc/home.dart'; | |
import 'package:states_bloc/about.dart'; | |
import 'package:states_bloc/settings.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:states_bloc/bloc/settings/settings_bloc.dart'; | |
void main() { | |
final BlocProvider<SettingsBloc> blocProvider = BlocProvider<SettingsBloc>( | |
builder: (_) => SettingsBloc(), | |
child: MyApp(), | |
); | |
runApp(blocProvider); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
initialRoute: '/', | |
routes: { | |
'/': (context) => Home(), | |
'/about': (context) => About(), | |
'/settings': (context) => Settings(), | |
}, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment