Skip to content

Instantly share code, notes, and snippets.

@mahmudahsan
Created September 11, 2020 12:13
Show Gist options
  • Save mahmudahsan/7308dc6e8b5843f84b8513b6bad0e1af to your computer and use it in GitHub Desktop.
Save mahmudahsan/7308dc6e8b5843f84b8513b6bad0e1af to your computer and use it in GitHub Desktop.
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