Skip to content

Commit

Permalink
imported constants to use for theme control
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkisDev committed Sep 26, 2023
1 parent 2df7084 commit 39ce5c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
15 changes: 8 additions & 7 deletions lib/app/modules/settings/views/enable_haptic_feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ import 'package:get/get.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/settings_controller.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_controller.dart';
import 'package:ultimate_alarm_clock/app/utils/utils.dart';
import 'package:ultimate_alarm_clock/app/utils/constants.dart';

class EnableHapticFeedback extends StatefulWidget {
const EnableHapticFeedback({
super.key,
required this.controller,
required this.height,
required this.width, required this.themeController,
required this.width,
required this.themeController,
});

final SettingsController controller;
final ThemeController themeController;
final ThemeController themeController;

final double height;
final double width;
Expand All @@ -28,14 +30,13 @@ class _EnableHapticFeedbackState extends State<EnableHapticFeedback> {
return Container(
width: widget.width * 0.91,
height: widget.height * 0.1,
decoration: Utils.getCustomTileBoxDecoration(isLightMode: widget.themeController.isLightMode.value),
decoration: Utils.getCustomTileBoxDecoration(
isLightMode: widget.themeController.isLightMode.value),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'Enable Haptic Feedback',
style: Theme.of(context).textTheme.bodyLarge
),
Text('Enable Haptic Feedback',
style: Theme.of(context).textTheme.bodyLarge),
Obx(
() => Switch.adaptive(
value: widget.controller.isHapticFeedbackEnabled.value,
Expand Down
10 changes: 6 additions & 4 deletions lib/app/modules/settings/views/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:ultimate_alarm_clock/app/modules/settings/views/enable_sorted_al
import 'package:ultimate_alarm_clock/app/modules/settings/views/theme_value_tile.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/views/weather_api.dart';
import 'package:ultimate_alarm_clock/app/utils/utils.dart';
import 'package:ultimate_alarm_clock/app/utils/constants.dart';
import '../controllers/settings_controller.dart';
import 'google_sign_in.dart';

Expand All @@ -28,9 +29,10 @@ class SettingsView extends GetView<SettingsController> {
centerTitle: true,
elevation: 0.0,
leading: IconButton(
icon: Icon(Icons.adaptive.arrow_back, color: themeController.isLightMode.value
? kLightPrimaryTextColor
: kprimaryTextColor),
icon: Icon(Icons.adaptive.arrow_back,
color: themeController.isLightMode.value
? kLightPrimaryTextColor
: kprimaryTextColor),
onPressed: () {
Utils.hapticFeedback();
Navigator.of(context).pop();
Expand Down Expand Up @@ -77,7 +79,7 @@ class SettingsView extends GetView<SettingsController> {
),
const SizedBox(
height: 20,
),
),
ThemeValueTile(
controller: controller,
height: height,
Expand Down

0 comments on commit 39ce5c3

Please sign in to comment.