1.0.1 #3
+13
-16
@@ -20,6 +20,8 @@ import 'package:flutter/services.dart' show rootBundle;
|
|||||||
/// TBD:
|
/// TBD:
|
||||||
/// - Add other languages (Spanish, Croatian)
|
/// - Add other languages (Spanish, Croatian)
|
||||||
/// v1.1.0
|
/// v1.1.0
|
||||||
|
/// - Move the switchtile back to its own row so that it handles titles better.
|
||||||
|
/// v1.2.0
|
||||||
/// - Change sunset grabber to checkbox and retrieve it each alarm or open.
|
/// - Change sunset grabber to checkbox and retrieve it each alarm or open.
|
||||||
/// v2.0.0
|
/// v2.0.0
|
||||||
/// - Add sunrise section and change app name to Sunshine Alarm?
|
/// - Add sunrise section and change app name to Sunshine Alarm?
|
||||||
@@ -270,8 +272,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
);
|
);
|
||||||
} else if (Platform.isAndroid) {
|
} else if (Platform.isAndroid) {
|
||||||
// Get the Notifications permission:
|
// Get the Notifications permission:
|
||||||
final android =
|
final android = _notifications
|
||||||
_notifications
|
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
AndroidFlutterLocalNotificationsPlugin
|
AndroidFlutterLocalNotificationsPlugin
|
||||||
>();
|
>();
|
||||||
@@ -492,8 +493,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
'${picked.hour.toString().padLeft(2, '0')}:'
|
'${picked.hour.toString().padLeft(2, '0')}:'
|
||||||
'${picked.minute.toString().padLeft(2, '0')}';
|
'${picked.minute.toString().padLeft(2, '0')}';
|
||||||
setState(
|
setState(
|
||||||
() =>
|
() => _sunsetErrorText = _validateTime(
|
||||||
_sunsetErrorText = _validateTime(
|
|
||||||
_sunsetController.text,
|
_sunsetController.text,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -523,8 +523,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
IconButton.filledTonal(
|
IconButton.filledTonal(
|
||||||
icon:
|
icon: _loading
|
||||||
_loading
|
|
||||||
? const SizedBox(
|
? const SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
@@ -553,7 +552,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
children: [
|
children: [
|
||||||
if (!_alarmEnabled)
|
if (!_alarmEnabled)
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: _validTime ? 6 : 4,
|
flex: 1, // _validTime ? 3 : 2,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _minutesController,
|
controller: _minutesController,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
@@ -587,15 +586,15 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
|
|
||||||
// --- Toggle ---
|
// --- Toggle ---
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: _validTime ? 7 : 5,
|
flex: 1, //_validTime ? 2 : 5,
|
||||||
child: SwitchListTile(
|
child: SwitchListTile(
|
||||||
title: Center(
|
title: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
_validTime
|
_validTime
|
||||||
? _alarmEnabled
|
? _alarmEnabled
|
||||||
? "Sunset Alarm Enabled"
|
? "Sunset Alarm Enabled"
|
||||||
: "Enable"
|
: "" //"Enable"
|
||||||
: "Disabled",
|
: "", // "Disabled",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Center(
|
subtitle: Center(
|
||||||
@@ -603,8 +602,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
_validTime
|
_validTime
|
||||||
? _alarmEnabled
|
? _alarmEnabled
|
||||||
? "${_minutesBefore} Minute${_plural} Before @ $_alarmDisplayTime"
|
? "${_minutesBefore} Minute${_plural} Before @ $_alarmDisplayTime"
|
||||||
: "Sunset Alarm"
|
: "" //"Sunset Alarm"
|
||||||
: "Enter Time",
|
: "", //"Enter Valid Time",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
value: _validTime ? _alarmEnabled : false,
|
value: _validTime ? _alarmEnabled : false,
|
||||||
@@ -640,8 +639,7 @@ final _plugin = FlutterLocalNotificationsPlugin();
|
|||||||
|
|
||||||
Future<void> requestPermissions() async {
|
Future<void> requestPermissions() async {
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
final android =
|
final android = _plugin
|
||||||
_plugin
|
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
AndroidFlutterLocalNotificationsPlugin
|
AndroidFlutterLocalNotificationsPlugin
|
||||||
>();
|
>();
|
||||||
@@ -654,8 +652,7 @@ Future<void> requestPermissions() async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final android =
|
final android = _plugin
|
||||||
_plugin
|
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
AndroidFlutterLocalNotificationsPlugin
|
AndroidFlutterLocalNotificationsPlugin
|
||||||
>();
|
>();
|
||||||
Reference in new issue
Block a user