86 lines
2.8 KiB
Dart
86 lines
2.8 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:regroup/Common/api_urls.dart';
|
|
import 'package:regroup/Common/base_manager.dart';
|
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
|
import 'package:regroup/Global.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
|
|
|
class Onboard {
|
|
Onboard();
|
|
|
|
Future<ResponseData<dynamic>> Postregisteration(updata) async {
|
|
print("updata is $updata");
|
|
final response = await NetworkApiServices()
|
|
.postApi(updata, ApiUrls.registeration, optionalpar: true);
|
|
print("response is ${response.data}");
|
|
print("response message is ${response.message}");
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> Postverifyregisteration(updata) async {
|
|
print("updata is $updata");
|
|
final response = await NetworkApiServices()
|
|
.postApi(updata, ApiUrls.verifyregisteration, optionalpar: true);
|
|
print("response is ${response.data}");
|
|
print("response message is ${response.message}");
|
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
Map<String, dynamic> res = response.data;
|
|
print("res is $res");
|
|
await prefs.setString('token', res['data']['token']);
|
|
await prefs.setString('email', res['data']['email']);
|
|
await prefs.setInt('isprofileupdate', res['data']['is_profile_updated']);
|
|
|
|
token = res['data']['token'];
|
|
emailid = res['data']['email'];
|
|
isprofileupdated = res['data']['is_profile_updated'];
|
|
|
|
print("token is $token");
|
|
print("email is $emailid");
|
|
print("profile update value is $isprofileupdated");
|
|
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData> PosttellusIndividual(updata) async {
|
|
print("updata is $updata");
|
|
final response =
|
|
await NetworkApiServices().postApi(updata, ApiUrls.tellusIndividual);
|
|
print("response is ${response.data}");
|
|
print("response message is ${response.message}");
|
|
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> PostIndividualActivity(updata) async {
|
|
print("updata is $updata");
|
|
final response = await NetworkApiServices()
|
|
.postApi(updata, ApiUrls.postindividualactivity,);
|
|
print("response is ${response.data}");
|
|
print("response message is ${response.message}");
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> postGroups(updata) async {
|
|
print("updata is $updata");
|
|
final response = await NetworkApiServices()
|
|
.postApi(updata, ApiUrls.postgroups,);
|
|
print("response is ${response.data}");
|
|
print("response message is ${response.message}");
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> postCommunities(updata) async {
|
|
print("updata is $updata");
|
|
final response = await NetworkApiServices()
|
|
.postApi(updata, ApiUrls.postcommunities,);
|
|
print("response is ${response.data}");
|
|
print("response message is ${response.message}");
|
|
return response;
|
|
}
|
|
|
|
|
|
}
|