Skip to content

Commit

Permalink
Merge pull request zino-hofmann#761 from Abhishek01039/master
Browse files Browse the repository at this point in the history
removed variable and used BlocProvider
  • Loading branch information
micimize authored Nov 6, 2020
2 parents a3e4401 + f90155b commit c26945a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/flutter_bloc/lib/bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class _BlocPageState extends State<BlocPage> {
@override
void initState() {
super.initState();
final bloc = BlocProvider.of<MyGithubReposBloc>(context);
bloc.add(LoadMyRepos(numOfReposToLoad: 50));
BlocProvider.of<MyGithubReposBloc>(context)
.add(LoadMyRepos(numOfReposToLoad: 50));
}

@override
Expand All @@ -38,8 +38,7 @@ class _BlocPageState extends State<BlocPage> {
keyboardType: TextInputType.number,
textAlign: TextAlign.center,
onChanged: (String n) {
final reposBloc = BlocProvider.of<MyGithubReposBloc>(context);
reposBloc
BlocProvider.of<MyGithubReposBloc>(context)
.add(LoadMyRepos(numOfReposToLoad: int.parse(n) ?? 50));
},
),
Expand Down

0 comments on commit c26945a

Please sign in to comment.