Skip to content
Open
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
12 changes: 9 additions & 3 deletions lib/app/data/providers/google_cloud_api_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class GoogleCloudProvider {
await _firebaseAuthInstance.signOut();
await getInstance();
}
final authHeaders = await _googleSignIn.currentUser!.authHeaders;
final currentUser = _googleSignIn.currentUser;
if (currentUser == null) return null;
final authHeaders = await currentUser.authHeaders;
final httpClient = GoogleHttpClient(authHeaders);
var dataList = await CalendarApi(httpClient).calendarList.list();

Expand All @@ -101,8 +103,12 @@ class GoogleCloudProvider {
}

static Future<List<Event>?> getEvents(String calenderId) async {
await getInstance();
final authHeaders = await _googleSignIn.currentUser!.authHeaders;
if (_googleSignIn.currentUser == null) {
await getInstance();
}
final currentUser = _googleSignIn.currentUser;
if (currentUser == null) return null;
final authHeaders = await currentUser.authHeaders;
final httpClient = GoogleHttpClient(authHeaders);
var dataList = await CalendarApi(httpClient).events.list(calenderId);
if (dataList.items != null) {
Expand Down
3 changes: 3 additions & 0 deletions lib/app/data/providers/isar_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ class IsarDb {
.and()
.alarmTimeEqualTo(time)
.findAll();
if (alarms.isEmpty) {
throw StateError('No enabled alarm found for time: $time');
}
return alarms.first;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,23 @@ class RingtoneSelectionPage extends GetView<AddOrUpdateAlarmController> {
}

Widget _buildSystemRingtonesTab() {
if (GetPlatform.isIOS) {
return Center(
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Text(
'System ringtones are currently only supported on Android.\n\nPlease upload a custom ringtone to use this feature.',
textAlign: TextAlign.center,
style: TextStyle(
color: themeController.primaryTextColor.value.withOpacity(0.7),
fontSize: 16,
height: 1.5,
),
),
),
);
}

return SystemRingtonePicker(
isFullScreen: true,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import '../../../data/providers/firestore_provider.dart';
import '../../home/controllers/home_controller.dart';

class NotificationsController extends GetxController {
//TODO: Implement NotificationsController

late List notifications = [].obs;
HomeController homeController = Get.find<HomeController>();
late List allProfiles = [].obs;
Expand Down