66 lines
2.6 KiB
Dart
66 lines
2.6 KiB
Dart
import 'package:core/presentation/extensions/color_extension.dart';
|
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
|
import 'package:core/presentation/utils/theme_utils.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:tmail_ui_user/features/base/widget/default_switch_icon_widget.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings_utils.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/notification/notification_controller.dart';
|
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
|
|
|
class NotificationView extends GetWidget<NotificationController> {
|
|
const NotificationView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
color: SettingsUtils.getBackgroundColor(context, Get.find<ResponsiveUtils>()),
|
|
padding: SettingsUtils.getMarginViewForSettingDetails(context, Get.find<ResponsiveUtils>()),
|
|
child: Obx(() {
|
|
if (controller.notificationSettingEnabled.value == null) {
|
|
return const SizedBox.shrink();
|
|
}
|
|
|
|
return Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const SizedBox(height: 10),
|
|
Text(
|
|
AppLocalizations.of(context).showNotifications,
|
|
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
|
|
fontSize: 17,
|
|
height: 22 / 17,
|
|
fontWeight: FontWeight.w500,
|
|
color: Colors.black)),
|
|
const SizedBox(height: 12),
|
|
Text(
|
|
AppLocalizations.of(context).allowsTwakeMailToNotifyYouWhenANewMessageArrivesOnYourPhone,
|
|
style: ThemeUtils.defaultTextStyleInterFont.copyWith(
|
|
fontSize: 15,
|
|
height: 20 / 15,
|
|
color: AppColor.colorSettingExplanation),
|
|
),
|
|
],
|
|
)
|
|
),
|
|
const SizedBox(width: 12),
|
|
InkWell(
|
|
onTap: controller.toggleNotificationSetting,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(4),
|
|
child: DefaultSwitchIconWidget(
|
|
imagePaths: controller.imagePaths,
|
|
isEnabled: controller.notificationSettingEnabled.value == true,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}),
|
|
);
|
|
}
|
|
} |