Skip to content

Commit

Permalink
Feature: Replacing settings icon in the timer section to menu icon (#351
Browse files Browse the repository at this point in the history
)
  • Loading branch information
duckcommit authored Jan 17, 2024
1 parent 106cc95 commit 7273add
Showing 1 changed file with 122 additions and 16 deletions.
138 changes: 122 additions & 16 deletions lib/app/modules/timer/views/timer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:ultimate_alarm_clock/app/data/providers/isar_provider.dart';
import 'package:ultimate_alarm_clock/app/data/providers/secure_storage_provider.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/routes/app_pages.dart';
import 'package:ultimate_alarm_clock/app/utils/constants.dart';
import 'package:ultimate_alarm_clock/app/utils/utils.dart';

Expand All @@ -24,22 +25,7 @@ class TimerView extends GetView<TimerController> {
toolbarHeight: height / 7.9,
elevation: 0.0,
centerTitle: true,
actions: [
IconButton(
onPressed: () {
Utils.hapticFeedback();
controller.saveTimerStateToStorage();
Get.toNamed('/settings');
},
icon: const Icon(
Icons.settings,
size: 27,
),
color: themeController.isLightMode.value
? kLightPrimaryTextColor.withOpacity(0.75)
: kprimaryTextColor.withOpacity(0.75),
),
],

),
),
body: Obx(
Expand Down Expand Up @@ -190,6 +176,126 @@ class TimerView extends GetView<TimerController> {
),
),
),
endDrawer: Obx(
() => Drawer(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)),
),
backgroundColor: themeController.isLightMode.value
? kLightSecondaryBackgroundColor
: ksecondaryBackgroundColor,
child: Column(
children: [
DrawerHeader(
decoration: const BoxDecoration(color: kLightSecondaryColor),
child: Center(
child: Row(
children: [
const Flexible(
flex: 1,
child: CircleAvatar(
radius: 30,
backgroundImage: AssetImage(
'assets/images/ic_launcher-playstore.png',
),
),
),
const SizedBox(
width: 10,
),
Flexible(
flex: 3,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: width * 0.5,
child: Text(
'Ultimate Alarm Clock'.tr,
softWrap: true,
style: Theme.of(context)
.textTheme
.displayMedium!
.copyWith(
color: themeController.isLightMode.value
? kprimaryTextColor
: ksecondaryTextColor,
fontWeight: FontWeight.bold),
),
),
SizedBox(
width: width * 0.5,
child: Text(
'v0.5.0'.tr,
softWrap: true,
style: Theme.of(context)
.textTheme
.titleLarge!
.copyWith(
color: themeController.isLightMode.value
? kprimaryTextColor
: ksecondaryTextColor,
fontWeight: FontWeight.bold),
),
),
],
),
),
],
),
),
),
ListTile(
onTap: () {
Utils.hapticFeedback();
Get.back();
Get.toNamed('/settings');
},
contentPadding: const EdgeInsets.only(left: 20, right: 44),
title: Text(
'Settings'.tr,
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: themeController.isLightMode.value
? kLightPrimaryTextColor.withOpacity(0.8)
: kprimaryTextColor.withOpacity(0.8),
),
),
leading: Icon(
Icons.settings,
size: 26,
color: themeController.isLightMode.value
? kLightPrimaryTextColor.withOpacity(0.8)
: kprimaryTextColor.withOpacity(0.8),
),
),
// LanguageMenu(),
ListTile(
onTap: () {
Utils.hapticFeedback();
Get.back();
Get.toNamed(Routes.ABOUT);
},
contentPadding: const EdgeInsets.only(left: 20, right: 44),
title: Text(
'About'.tr,
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: themeController.isLightMode.value
? kLightPrimaryTextColor.withOpacity(0.8)
: kprimaryTextColor.withOpacity(0.8)),
),
leading: Icon(
Icons.info_outline,
size: 26,
color: themeController.isLightMode.value
? kLightPrimaryTextColor.withOpacity(0.8)
: kprimaryTextColor.withOpacity(0.8),
),
),
],
),
),
),
);
}
}

0 comments on commit 7273add

Please sign in to comment.