Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from felangel/bug/fix-dispose
Browse files Browse the repository at this point in the history
Fix Dispose Bug
  • Loading branch information
lhmzhou committed Jun 13, 2019
2 parents 102dcdb + fdc52f0 commit 5e86ba2
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 23 deletions.
1 change: 0 additions & 1 deletion github_repository/lib/src/github_repository.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:github_repository/github_repository.dart';
import 'package:catcher/catcher_plugin.dart';

class GithubRepository {
final GithubCache cache;
Expand Down
8 changes: 8 additions & 0 deletions ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
9 changes: 8 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:flutter_hub/project_search/project_search.dart';
import 'package:flutter_hub/profile_search/profile_search.dart';
import 'package:flutter_hub/news_search/news_search.dart';
import 'package:flutter_hub/github_search_bloc/bloc.dart';
import 'package:catcher/catcher_plugin.dart';

void main() {
final GithubRepository _githubRepository = GithubRepository(
Expand Down Expand Up @@ -61,6 +60,14 @@ class _AppState extends State<App> {
_newsSearchBloc = RedditSearchBloc(redditRepository: redditRepository);
}

@override
void dispose() {
_projectSearchBloc.dispose();
_profileSearchBloc.dispose();
_newsSearchBloc.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return MaterialApp(
Expand Down
7 changes: 0 additions & 7 deletions lib/news_search/news_search_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:reddit_repository/reddit_repository.dart';
import 'package:flutter_hub/reddit_search_bloc/bloc.dart';
import 'package:catcher/catcher_plugin.dart';

class NewsSearch extends StatefulWidget {
@override
Expand All @@ -25,12 +24,6 @@ class _NewsSearchState extends State<NewsSearch>
_searchBloc.dispatch(FetchArticles());
}

@override
void dispose() {
_searchBloc.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
super.build(context);
Expand Down
6 changes: 0 additions & 6 deletions lib/profile_search/profile_search_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ class _ProfileSearchState extends State<ProfileSearch>
_searchBloc.dispatch(FetchInitialProfiles());
}

@override
void dispose() {
_searchBloc.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
super.build(context);
Expand Down
6 changes: 0 additions & 6 deletions lib/project_search/project_search_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ class _ProjectSearchState extends State<ProjectSearch>
_searchBloc.dispatch(FetchInitialProjects());
}

@override
void dispose() {
_searchBloc.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
super.build(context);
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies:
path: github_repository
reddit_repository:
path: reddit_repository
catcher: ^0.0.8

flutter:
uses-material-design: true
Expand Down
1 change: 0 additions & 1 deletion reddit_repository/lib/src/reddit_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:convert';

import 'package:http/http.dart' as http;
import 'package:reddit_repository/reddit_repository.dart';
import 'package:catcher/catcher_plugin.dart';

class RedditClient {
final String baseUrl;
Expand Down

0 comments on commit 5e86ba2

Please sign in to comment.