Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Code #604

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
99 changes: 50 additions & 49 deletions lib/app/data/models/alarm_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,54 +62,55 @@ class AlarmModel {
@ignore
Map? offsetDetails;

AlarmModel(
{required this.alarmTime,
required this.alarmID,
this.sharedUserIds = const [],
required this.ownerId,
required this.ownerName,
required this.lastEditedUserId,
required this.mutexLock,
this.isEnabled = true,
required this.days,
required this.intervalToAlarm,
required this.isActivityEnabled,
required this.minutesSinceMidnight,
required this.isLocationEnabled,
required this.isSharedAlarmEnabled,
required this.isWeatherEnabled,
required this.location,
required this.weatherTypes,
required this.isMathsEnabled,
required this.mathsDifficulty,
required this.numMathsQuestions,
required this.isShakeEnabled,
required this.shakeTimes,
required this.isQrEnabled,
required this.qrValue,
required this.isPedometerEnabled,
required this.numberOfSteps,
required this.activityInterval,
this.offsetDetails = const {},
required this.mainAlarmTime,
required this.label,
required this.isOneTime,
required this.snoozeDuration,
required this.gradient,
required this.ringtoneName,
required this.note,
required this.deleteAfterGoesOff,
required this.showMotivationalQuote,
required this.volMax,
required this.volMin,
required this.activityMonitor,
required this.ringOn,
required this.alarmDate,
required this.profile,
required this.isGuardian,
required this.guardianTimer,
required this.guardian,
required this.isCall});
AlarmModel({
required this.alarmTime,
required this.alarmID,
this.sharedUserIds = const [],
required this.ownerId,
required this.ownerName,
required this.lastEditedUserId,
required this.mutexLock,
this.isEnabled = true,
required this.days,
required this.intervalToAlarm,
required this.isActivityEnabled,
required this.minutesSinceMidnight,
required this.isLocationEnabled,
required this.isSharedAlarmEnabled,
required this.isWeatherEnabled,
required this.location,
required this.weatherTypes,
required this.isMathsEnabled,
required this.mathsDifficulty,
required this.numMathsQuestions,
required this.isShakeEnabled,
required this.shakeTimes,
required this.isQrEnabled,
required this.qrValue,
required this.isPedometerEnabled,
required this.numberOfSteps,
required this.activityInterval,
this.offsetDetails = const {},
required this.mainAlarmTime,
required this.label,
required this.isOneTime,
required this.snoozeDuration,
required this.gradient,
required this.ringtoneName,
required this.note,
required this.deleteAfterGoesOff,
required this.showMotivationalQuote,
required this.volMax,
required this.volMin,
required this.activityMonitor,
required this.ringOn,
required this.alarmDate,
required this.profile,
required this.isGuardian,
required this.guardianTimer,
required this.guardian,
required this.isCall,
});

AlarmModel.fromDocumentSnapshot({
required firestore.DocumentSnapshot documentSnapshot,
Expand Down Expand Up @@ -395,7 +396,7 @@ class AlarmModel {
'guardianTimer': alarmRecord.guardianTimer,
'guardian': alarmRecord.guardian,
'isCall': alarmRecord.isCall,
'ringOn': alarmRecord.ringOn
'ringOn': alarmRecord.ringOn,
};

if (alarmRecord.isSharedAlarmEnabled) {
Expand Down
93 changes: 47 additions & 46 deletions lib/app/data/models/profile_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,51 +57,52 @@ class ProfileModel {
@ignore
Map? offsetDetails;

ProfileModel(
{required this.profileName,
this.sharedUserIds = const [],
required this.ownerId,
required this.ownerName,
required this.lastEditedUserId,
required this.mutexLock,
this.isEnabled = true,
required this.days,
required this.intervalToAlarm,
required this.isActivityEnabled,
required this.minutesSinceMidnight,
required this.isLocationEnabled,
required this.isSharedAlarmEnabled,
required this.isWeatherEnabled,
required this.location,
required this.weatherTypes,
required this.isMathsEnabled,
required this.mathsDifficulty,
required this.numMathsQuestions,
required this.isShakeEnabled,
required this.shakeTimes,
required this.isQrEnabled,
required this.qrValue,
required this.isPedometerEnabled,
required this.numberOfSteps,
required this.activityInterval,
this.offsetDetails = const {},
required this.label,
required this.isOneTime,
required this.snoozeDuration,
required this.gradient,
required this.ringtoneName,
required this.note,
required this.deleteAfterGoesOff,
required this.showMotivationalQuote,
required this.volMax,
required this.volMin,
required this.activityMonitor,
required this.alarmDate,
required this.ringOn,
required this.isGuardian,
required this.guardianTimer,
required this.guardian,
required this.isCall});
ProfileModel({
required this.profileName,
this.sharedUserIds = const [],
required this.ownerId,
required this.ownerName,
required this.lastEditedUserId,
required this.mutexLock,
this.isEnabled = true,
required this.days,
required this.intervalToAlarm,
required this.isActivityEnabled,
required this.minutesSinceMidnight,
required this.isLocationEnabled,
required this.isSharedAlarmEnabled,
required this.isWeatherEnabled,
required this.location,
required this.weatherTypes,
required this.isMathsEnabled,
required this.mathsDifficulty,
required this.numMathsQuestions,
required this.isShakeEnabled,
required this.shakeTimes,
required this.isQrEnabled,
required this.qrValue,
required this.isPedometerEnabled,
required this.numberOfSteps,
required this.activityInterval,
this.offsetDetails = const {},
required this.label,
required this.isOneTime,
required this.snoozeDuration,
required this.gradient,
required this.ringtoneName,
required this.note,
required this.deleteAfterGoesOff,
required this.showMotivationalQuote,
required this.volMax,
required this.volMin,
required this.activityMonitor,
required this.alarmDate,
required this.ringOn,
required this.isGuardian,
required this.guardianTimer,
required this.guardian,
required this.isCall,
});

ProfileModel.fromDocumentSnapshot({
required firestore.DocumentSnapshot documentSnapshot,
Expand Down Expand Up @@ -274,7 +275,7 @@ class ProfileModel {
'guardianTimer': profileRecord.guardianTimer,
'guardian': profileRecord.guardian,
'isCall': profileRecord.isCall,
'ringOn': profileRecord.ringOn
'ringOn': profileRecord.ringOn,
};

if (profileRecord.isSharedAlarmEnabled) {
Expand Down
17 changes: 9 additions & 8 deletions lib/app/data/models/timer_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ class TimerModel {
late String ringtoneName;
late int isPaused;

TimerModel(
{required this.timerValue,
required this.startedOn,
required this.ringtoneName,
required this.timerName,
this.isPaused = 0,
this.timeElapsed = 0});
TimerModel({
required this.timerValue,
required this.startedOn,
required this.ringtoneName,
required this.timerName,
this.isPaused = 0,
this.timeElapsed = 0,
});

Map<String, dynamic> toMap() {
return {
Expand All @@ -36,7 +37,7 @@ class TimerModel {
timerId = map['id'];
startedOn = map['startedOn'];
timerValue = map['timerValue'];
timeElapsed= map['timeElapsed'];
timeElapsed = map['timeElapsed'];
ringtoneName = map['ringtoneName'];
timerName = map['timerName'];
isPaused = map['isPaused'];
Expand Down
2 changes: 1 addition & 1 deletion lib/app/data/models/user_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UserModel {
'lastName': lastName,
'email': email,
'id': id,
'receivedItems': receivedItems
'receivedItems': receivedItems,
};
}

Expand Down
11 changes: 5 additions & 6 deletions lib/app/data/providers/firestore_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class FirestoreDb {
Map sharedItem = {
'type': 'profile',
'profileName': currentProfileName,
'owner': currentUserEmail
'owner': currentUserEmail,
};
await _firebaseFirestore
.collection('users')
Expand All @@ -326,10 +326,9 @@ class FirestoreDb {
.then((v) {
Get.snackbar('Notification', 'Item Shared!');
});
;
for (final email in emails) {
await _firebaseFirestore.collection('users').doc(email).update({
'receivedItems': FieldValue.arrayUnion([sharedItem])
'receivedItems': FieldValue.arrayUnion([sharedItem]),
});
}
}
Expand All @@ -341,7 +340,7 @@ class FirestoreDb {
'type': 'alarm',
'AlarmName': alarm.alarmID,
'owner': currentUserEmail,
'alarmTime': alarm.alarmTime
'alarmTime': alarm.alarmTime,
};
await _firebaseFirestore
.collection('users')
Expand All @@ -354,7 +353,7 @@ class FirestoreDb {
});
for (final email in emails) {
await _firebaseFirestore.collection('users').doc(email).update({
'receivedItems': FieldValue.arrayUnion([sharedItem])
'receivedItems': FieldValue.arrayUnion([sharedItem]),
});
}
}
Expand Down Expand Up @@ -529,7 +528,7 @@ class FirestoreDb {
.collection('users')
.doc(_firebaseAuthInstance.currentUser!.email)
.update({
'receivedItems': FieldValue.arrayRemove([item])
'receivedItems': FieldValue.arrayRemove([item]),
});
}
}
8 changes: 2 additions & 6 deletions lib/app/data/providers/get_storage_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ class GetStorageProvider {

Future<String> readCurrentLanguage() async {
print(_getStorage.read('currentLanguageKey'));
String? language = await _getStorage.read(('currentLanguageKey'));
if (language == null) {
language = Get.locale.toString();
writeCurrentLanguage(language);
}
String? language = _getStorage.read(('currentLanguageKey'));
return language;
}

Expand Down Expand Up @@ -49,7 +45,7 @@ class GetStorageProvider {
}

Future<String> readProfile() async {
String profile = await _getStorage.read('profile') ?? 'Default';
String profile = _getStorage.read('profile') ?? 'Default';
return profile;
}
}
8 changes: 4 additions & 4 deletions lib/app/data/providers/google_cloud_api_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GoogleCloudProvider {
Get.put(SettingsController());
SettingsController settingsController = Get.find<SettingsController>();

if (await _firebaseAuthInstance.currentUser == null) {
if (_firebaseAuthInstance.currentUser == null) {
var googleSignInAccount = await _googleSignIn.signIn();
final GoogleSignInAuthentication? googleAuth =
await googleSignInAccount?.authentication;
Expand Down Expand Up @@ -76,8 +76,8 @@ class GoogleCloudProvider {
}
}

static isUserLoggedin() {
return _firebaseAuthInstance.currentUser != null;
static isUserLoggedin() {
return _firebaseAuthInstance.currentUser != null;
}

static Future<List<CalendarListEntry>?> getCalenders() async {
Expand Down Expand Up @@ -120,6 +120,6 @@ class GoogleCloudProvider {
homeController.isUserSignedIn.value = false;
homeController.userModel.value = null;
homeController.Calendars.value = [];
homeController.calendarFetchStatus.value = "Loading";
homeController.calendarFetchStatus.value = 'Loading';
}
}
Loading