-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f23c5aa
commit 96921fa
Showing
15 changed files
with
102 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
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
File renamed without changes.
28 changes: 15 additions & 13 deletions
28
rickandMorty-GameofThrones-bloc/lib/data/web_services/gotwebServices.dart
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import 'package:breakingbad/constants/constants.dart'; | ||
import 'package:breakingbad/shared/constants.dart'; | ||
import 'package:dio/dio.dart'; | ||
|
||
class GOTCharactersWebServices{ | ||
Dio dio=Dio(); | ||
GOTCharactersWebServices(){ | ||
BaseOptions options =BaseOptions( | ||
class GOTCharactersWebServices { | ||
Dio dio = Dio(); | ||
|
||
GOTCharactersWebServices() { | ||
BaseOptions options = BaseOptions( | ||
baseUrl: GOTbaseurl, | ||
receiveDataWhenStatusError: true, | ||
connectTimeout: 20*1000, | ||
receiveTimeout: 20*1000, | ||
connectTimeout: 20 * 1000, | ||
receiveTimeout: 20 * 1000, | ||
); | ||
dio=Dio(options); | ||
dio = Dio(options); | ||
} | ||
Future<List<dynamic>> getAllGOTCharacters()async{ | ||
try{ | ||
Response response= await dio.get(allGOTcharacters); | ||
|
||
Future<List<dynamic>> getAllGOTCharacters() async { | ||
try { | ||
Response response = await dio.get(allGOTcharacters); | ||
print(response.data.toString()); | ||
return response.data; | ||
}catch(e){ | ||
} catch (e) { | ||
print(e.toString()); | ||
return []; | ||
} | ||
} | ||
} | ||
} |
44 changes: 23 additions & 21 deletions
44
rickandMorty-GameofThrones-bloc/lib/data/web_services/ram_charactersWebServices.dart
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import 'package:breakingbad/constants/constants.dart'; | ||
import 'package:breakingbad/shared/constants.dart'; | ||
import 'package:dio/dio.dart'; | ||
|
||
class RAMCharactersWebServices{ | ||
Dio dio=Dio(); | ||
RAMCharactersWebServices(){ | ||
BaseOptions options =BaseOptions( | ||
baseUrl: RAMbaseurl, | ||
receiveDataWhenStatusError: true, | ||
connectTimeout: 20*1000, | ||
receiveTimeout: 20*1000, | ||
); | ||
dio=Dio(options); | ||
} | ||
Future<List<dynamic>> getAllRAMCharacters()async{ | ||
try{ | ||
Response response= await dio.get(allRAMcharacters); | ||
print(response.data.toString()); | ||
return response.data["results"]; | ||
}catch(e){ | ||
print(e.toString()); | ||
return []; | ||
class RAMCharactersWebServices { | ||
Dio dio = Dio(); | ||
|
||
RAMCharactersWebServices() { | ||
BaseOptions options = BaseOptions( | ||
baseUrl: RAMbaseurl, | ||
receiveDataWhenStatusError: true, | ||
connectTimeout: 20 * 1000, | ||
receiveTimeout: 20 * 1000, | ||
); | ||
dio = Dio(options); | ||
} | ||
|
||
Future<List<dynamic>> getAllRAMCharacters() async { | ||
try { | ||
Response response = await dio.get(allRAMcharacters); | ||
print(response.data.toString()); | ||
return response.data["results"]; | ||
} catch (e) { | ||
print(e.toString()); | ||
return []; | ||
} | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
rickandMorty-GameofThrones-bloc/lib/presentation/screens/got_character_details.dart
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
4 changes: 2 additions & 2 deletions
4
rickandMorty-GameofThrones-bloc/lib/presentation/screens/gotcharacters_screen.dart
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
2 changes: 1 addition & 1 deletion
2
rickandMorty-GameofThrones-bloc/lib/presentation/screens/ram_character_details_screen.dart
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
4 changes: 2 additions & 2 deletions
4
rickandMorty-GameofThrones-bloc/lib/presentation/screens/ramcharacters_screen.dart
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
29 changes: 29 additions & 0 deletions
29
rickandMorty-GameofThrones-bloc/lib/shared/bloc_observer.dart
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// ignore_for_file: avoid_print, depend_on_referenced_packages | ||
|
||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class MyBlocObserver extends BlocObserver { | ||
@override | ||
void onCreate(BlocBase bloc) { | ||
super.onCreate(bloc); | ||
print('onCreate -- ${bloc.runtimeType}'); | ||
} | ||
|
||
@override | ||
void onChange(BlocBase bloc, Change change) { | ||
super.onChange(bloc, change); | ||
print('onChange -- ${bloc.runtimeType}, $change'); | ||
} | ||
|
||
@override | ||
void onError(BlocBase bloc, Object error, StackTrace stackTrace) { | ||
print('onError -- ${bloc.runtimeType}, $error'); | ||
super.onError(bloc, error, stackTrace); | ||
} | ||
|
||
@override | ||
void onClose(BlocBase bloc) { | ||
super.onClose(bloc); | ||
print('onClose -- ${bloc.runtimeType}'); | ||
} | ||
} |
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
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