Compare commits
4
Commits
0.1.2
..
14372df628
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14372df628 | ||
|
|
c32373173b | ||
|
|
64a070fb4e | ||
|
|
bb1118d071 |
No files matched your search
@@ -3,13 +3,14 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
>
|
||||
|
||||
<!-- Allow notifications to work. -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
|
||||
<uses-permission android:name="android.permission.USE_EXACT_ALARM"/>
|
||||
|
||||
<!--
|
||||
<!-- Allow alarms to work. -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
@@ -25,7 +26,6 @@
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
|
||||
-->
|
||||
|
||||
<application
|
||||
android:label="sunset_alarm"
|
||||
@@ -59,6 +59,7 @@
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
|
||||
<!-- Allow notifications to work. -->
|
||||
<receiver
|
||||
android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver"
|
||||
android:enabled="true" />
|
||||
@@ -74,16 +75,14 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!--
|
||||
<!-- Allow alarms to work. -->
|
||||
<service
|
||||
android:name="com.gdelataillade.alarm.AlarmService"
|
||||
android:foregroundServiceType="mediaPlayback"
|
||||
android:exported="false" />
|
||||
|
||||
<receiver
|
||||
android:name="com.gdelataillade.alarm.AlarmBroadcastReceiver"
|
||||
android:exported="false" />
|
||||
|
||||
<receiver
|
||||
android:name="com.gdelataillade.alarm.BootBroadcastReceiver"
|
||||
android:enabled="false"
|
||||
@@ -92,7 +91,6 @@
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
@@ -111,7 +109,7 @@
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
-->
|
||||
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
AuthorName: 'Chad Michael "Hyperling" Greenwood'
|
||||
AuthorEmail: 'me@hyperling.com'
|
||||
AuthorWebSite: 'https://hyperling.com/about/'
|
||||
Donate: 'https://hyperling.com/donate/'
|
||||
Liberapay: 'HyperVegan'
|
||||
Bitcoin: 'bc1qsfe8dkvry3d34kztz449gkq67wq8fu2nkgfkh0'
|
||||
Litecoin: 'ltc1qavmpu5d6ljntxsd6jj548m4yys83zwscl0dzkx'
|
||||
IssueTracker: 'https://hyperling.com/contact/'
|
||||
Categories:
|
||||
- fdroid
|
||||
- hyperling
|
||||
- utilities
|
||||
Name: Sunset Timer
|
||||
Summary: 'Play a notification at your chosen time before sunset.'
|
||||
SourceCode: 'https://git.hyperling.com/me/flutter-sunset-alarm/'
|
||||
WebSite: 'https://hyperling.com/apps/#sunset'
|
||||
+4
-4
@@ -8,14 +8,14 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:timezone/data/latest_all.dart' as tz;
|
||||
import 'package:timezone/timezone.dart' as tz;
|
||||
import 'package:http/http.dart' as http;
|
||||
//import 'package:alarm/alarm.dart';
|
||||
import 'package:alarm/alarm.dart';
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
tz.initializeTimeZones();
|
||||
//await Alarm.init();
|
||||
await Alarm.init();
|
||||
runApp(const SunsetAlarmApp());
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
'Alarm set for ${alarmTime.hour.toString().padLeft(2, '0')}:${alarmTime.minute.toString().padLeft(2, '0')} (app must stay open)',
|
||||
);
|
||||
} else if (Platform.isAndroid) {
|
||||
/*** Notifcation Method - Works ***/
|
||||
/*** Notifcation Method - Works *** /
|
||||
// Android: use zonedSchedule (works in background)
|
||||
final tzAlarm = tz.TZDateTime.from(alarmTime, tz.local);
|
||||
const androidDetails = AndroidNotificationDetails(
|
||||
@@ -258,7 +258,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
debugPrint('DEBUG: ${_notifications.toString()}');
|
||||
// End Notification Method ***/
|
||||
|
||||
/*** Alarm Method - WIP *** /
|
||||
/*** Alarm Method - WIP ***/
|
||||
// Schedule:
|
||||
final settings = AlarmSettings(
|
||||
id: 42,
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
name: sunset_alarm
|
||||
description: "Set an alarm to go off a specified time before sunset."
|
||||
publish_to: 'none'
|
||||
version: 0.1.2
|
||||
version: 0.2.0
|
||||
|
||||
environment:
|
||||
sdk: ^3.7.2
|
||||
|
||||
Reference in new issue
Block a user