-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #615 from ganidande905/added_preset_timers
Added preset timers for easy accessibility
Showing
5 changed files
with
845 additions
and
596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_controller.dart'; | ||
import 'package:ultimate_alarm_clock/app/modules/timer/controllers/timer_controller.dart'; | ||
import 'package:ultimate_alarm_clock/app/utils/constants.dart'; | ||
|
||
Widget hoverPresetButton(BuildContext context, String label, Duration duration) { | ||
final TimerController timerController = Get.find<TimerController>(); | ||
final ThemeController themeController = Get.find<ThemeController>(); | ||
|
||
final double width = MediaQuery.of(context).size.width; | ||
final double height = MediaQuery.of(context).size.height; | ||
|
||
return ElevatedButton( | ||
onPressed: () { | ||
timerController.remainingTime.value = duration; | ||
timerController.createTimer(); | ||
Get.back(); | ||
}, | ||
style: ElevatedButton.styleFrom( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: width * 0.02, | ||
vertical: height * 0.01, | ||
), | ||
|
||
backgroundColor: themeController.primaryColor.value, | ||
shadowColor: Colors.transparent, | ||
fixedSize: Size( | ||
width * 0.02, | ||
height * 0.01, | ||
), | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(height * 0.02), | ||
), | ||
), | ||
child: Text( | ||
label, | ||
style: TextStyle( | ||
fontSize: height * 0.02, | ||
color: kprimaryBackgroundColor, | ||
|
||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_controller.dart'; | ||
import 'package:ultimate_alarm_clock/app/modules/timer/controllers/timer_controller.dart'; | ||
import 'package:ultimate_alarm_clock/app/utils/constants.dart'; | ||
|
||
Widget presetButton(BuildContext context, String label, Duration duration) { | ||
final TimerController timerController = Get.find<TimerController>(); | ||
final ThemeController themeController = Get.find<ThemeController>(); | ||
|
||
final double width = MediaQuery.of(context).size.width; | ||
final double height = MediaQuery.of(context).size.height; | ||
|
||
return ElevatedButton( | ||
onPressed: () { | ||
timerController.remainingTime.value = duration; | ||
timerController.createTimer(); | ||
Get.back(); | ||
}, | ||
style: ElevatedButton.styleFrom( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: width * 0.02, | ||
vertical: height * 0.01, | ||
), | ||
backgroundColor: Colors.transparent, | ||
shadowColor: Colors.transparent, | ||
fixedSize: Size( | ||
width * 0.02, | ||
height * 0.01, | ||
), | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(height * 0.02), | ||
), | ||
), | ||
child: Text( | ||
label, | ||
style: TextStyle( | ||
fontSize: height * 0.02, | ||
color: kprimaryDisabledTextColor, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters