-
-
Save boeledi/e8ec399c35f47c8d9e6694c43a0b51b8 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
class MyTree extends StatefulWidget { | |
@override | |
_MyTreeState createState() => _MyTreeState(); | |
} | |
class _MyTreeState extends State<MyTree>{ | |
MyBloc bloc; | |
@override | |
void initState(){ | |
super.initState(); | |
bloc = MyBloc(); | |
} | |
@override | |
void dispose(){ | |
bloc?.dispose(); | |
super.dispose(); | |
} | |
@override | |
Widget build(BuildContext context){ | |
return BlocProvider<MyBloc>( | |
blocBuilder: () => bloc, | |
blocDispose: (){}, | |
child: Column( | |
children: <Widget>[ | |
MyChildWidget(), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment