BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:customer/models/currency_model.dart';
|
||||
import 'package:customer/models/user_model.dart';
|
||||
import 'package:customer/utils/notification_service.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../constant/collection_name.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
@@ -18,13 +18,27 @@ class GlobalSettingController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getCurrentCurrency() async {
|
||||
FireStoreUtils.fireStore.collection(CollectionName.currencies).where("isActive", isEqualTo: true).snapshots().listen((event) {
|
||||
if (event.docs.isNotEmpty) {
|
||||
Constant.currencyModel = CurrencyModel.fromJson(event.docs.first.data());
|
||||
} else {
|
||||
Constant.currencyModel = CurrencyModel(id: "", code: "USD", decimal: 2, isactive: true, name: "US Dollar", symbol: "\$", symbolatright: false);
|
||||
}
|
||||
});
|
||||
FireStoreUtils.fireStore
|
||||
.collection(CollectionName.currencies)
|
||||
.where("isActive", isEqualTo: true)
|
||||
.snapshots()
|
||||
.listen((event) {
|
||||
if (event.docs.isNotEmpty) {
|
||||
Constant.currencyModel = CurrencyModel.fromJson(
|
||||
event.docs.first.data(),
|
||||
);
|
||||
} else {
|
||||
Constant.currencyModel = CurrencyModel(
|
||||
id: "",
|
||||
code: "USD",
|
||||
decimal: 2,
|
||||
isactive: true,
|
||||
name: "US Dollar",
|
||||
symbol: "\$",
|
||||
symbolatright: false,
|
||||
);
|
||||
}
|
||||
});
|
||||
await FireStoreUtils.getSettings();
|
||||
}
|
||||
|
||||
@@ -35,7 +49,9 @@ class GlobalSettingController extends GetxController {
|
||||
String token = await NotificationService.getToken();
|
||||
log(":::::::TOKEN:::::: $token");
|
||||
if (FirebaseAuth.instance.currentUser != null) {
|
||||
await FireStoreUtils.getUserProfile(FireStoreUtils.getCurrentUid()).then((value) {
|
||||
await FireStoreUtils.getUserProfile(
|
||||
FireStoreUtils.getCurrentUid(),
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
UserModel driverUserModel = value;
|
||||
driverUserModel.fcmToken = token;
|
||||
|
||||
Reference in New Issue
Block a user