4
2
Fork 0

fix: removing dead init code

pull/35/head
Sudharshan S. 2019-03-15 21:33:18 +08:00
parent f2032c9287
commit 9d032856cc
Signed by: sudharshan
GPG Key ID: C861C97AAF3D9559
3 changed files with 4 additions and 16 deletions

View File

@ -9,10 +9,6 @@ import "../../settings.dart";
class ContactApiProvider {
CacheHttp cache = CacheHttp();
Future<void> init() async {
await this.cache.init();
}
Future<List<User>> fetchContacts() async {
try {
final responseBody =

View File

@ -12,10 +12,6 @@ import "../../settings.dart";
class ConversationApiProvider {
CacheHttp cache = CacheHttp();
Future<void> init() async {
await this.cache.init();
}
Future<Conversation> createConversation(String title) async {
final response = await http.post("$baseUrlCore/user/conversation",
headers: {"Content-Type": "application/json"},

View File

@ -9,11 +9,6 @@ import "../../settings.dart";
class UserApiProvider {
CacheHttp cache;
Future<void> init() async {
this.cache = new CacheHttp();
await this.cache.init();
}
Future<User> createUser(User user) async {
// Prob need to add the headers
final response = await http.post("$baseUrlCore/user",
@ -24,9 +19,10 @@ class UserApiProvider {
Future<User> fetchUserByPhone(String phoneNumber) async {
try {
final responseBody = await this.cache.fetch("$baseUrlCore/user?phone_number=$phoneNumber");
final responseBody =
await this.cache.fetch("$baseUrlCore/user?phone_number=$phoneNumber");
return User.fromJson(jsonDecode(responseBody));
} catch(e) {
} catch (e) {
throw e;
}
}
@ -35,7 +31,7 @@ class UserApiProvider {
try {
final responseBody = await this.cache.fetch("$baseUrlCore/user/id/$id");
return User.fromJson(jsonDecode(responseBody));
} catch(e) {
} catch (e) {
throw e;
}
}