TF-438 Apply new design for push notification
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/utils/theme_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/home/presentation/home_controller.dart';
|
||||
|
||||
@@ -10,12 +9,7 @@ class HomeView extends GetWidget<HomeController> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||
systemNavigationBarColor: Colors.white,
|
||||
systemNavigationBarIconBrightness: Brightness.dark,
|
||||
statusBarColor: Colors.white,
|
||||
statusBarIconBrightness: Brightness.dark,
|
||||
));
|
||||
ThemeUtils.setSystemDarkUIStyle();
|
||||
|
||||
return Container(
|
||||
color: AppColor.primaryLightColor,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:model/model.dart';
|
||||
@@ -26,9 +25,7 @@ class MailboxView extends GetWidget<MailboxController> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
));
|
||||
ThemeUtils.setStatusBarTransparentColor();
|
||||
|
||||
return SafeArea(bottom: false, left: false, right: false,
|
||||
top: _responsiveUtils.isMobile(context),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/utils/theme_utils.dart';
|
||||
import 'package:core/presentation/views/responsive/responsive_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:focus_detector/focus_detector.dart';
|
||||
@@ -27,7 +28,13 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
||||
);
|
||||
|
||||
return FocusDetector(
|
||||
onFocusGained: controller.refreshActionWhenBackToApp,
|
||||
onFocusGained: () {
|
||||
ThemeUtils.setSystemDarkUIStyle();
|
||||
if (controller.isDrawerOpen) {
|
||||
ThemeUtils.setStatusBarTransparentColor();
|
||||
}
|
||||
controller.refreshActionWhenBackToApp();
|
||||
},
|
||||
child: Scaffold(
|
||||
drawerEnableOpenDragGesture: responsiveUtils.hasLeftMenuDrawerActive(context),
|
||||
body: Stack(children: [
|
||||
|
||||
+4
-1
@@ -44,7 +44,10 @@ class LocalNotificationConfig {
|
||||
importance: Importance.max,
|
||||
priority: Priority.high,
|
||||
setAsGroupSummary: setAsGroup,
|
||||
styleInformation: styleInformation
|
||||
styleInformation: styleInformation,
|
||||
channelShowBadge: true,
|
||||
showWhen: true,
|
||||
largeIcon: const DrawableResourceAndroidBitmap('@mipmap/ic_large_notification')
|
||||
),
|
||||
iOS: const DarwinNotificationDetails(
|
||||
presentSound: true,
|
||||
|
||||
+18
-10
@@ -99,19 +99,18 @@ class LocalNotificationManager {
|
||||
String? payload
|
||||
}) async {
|
||||
final inboxStyleInformation = InboxStyleInformation(
|
||||
[title, message ?? ''],
|
||||
contentTitle: (emailAddress?.asString() ?? '').addBlockTag('b'),
|
||||
summaryText: (emailAddress?.asString() ?? '').addBlockTag('b'),
|
||||
htmlFormatTitle: true,
|
||||
htmlFormatContent: true,
|
||||
[message?.addBlockTag('p', attribute: 'style="color:#6D7885;"') ?? ''],
|
||||
htmlFormatLines: true,
|
||||
contentTitle: title,
|
||||
htmlFormatContentTitle: true,
|
||||
summaryText: (emailAddress?.asString() ?? '').addBlockTag('b'),
|
||||
htmlFormatSummaryText: true,
|
||||
);
|
||||
|
||||
await _localNotificationsPlugin.show(
|
||||
id.hashCode,
|
||||
title.addBlockTag('b'),
|
||||
message ?? '',
|
||||
null,
|
||||
null,
|
||||
LocalNotificationConfig.instance.generateNotificationDetails(styleInformation: inboxStyleInformation),
|
||||
payload: payload
|
||||
);
|
||||
@@ -123,11 +122,20 @@ class LocalNotificationManager {
|
||||
?.getActiveNotifications();
|
||||
|
||||
if (activeNotifications != null && activeNotifications.isNotEmpty) {
|
||||
final inboxStyleInformation = InboxStyleInformation(
|
||||
[''],
|
||||
summaryText: '${activeNotifications.length - 1} new emails'.addBlockTag('b'),
|
||||
htmlFormatSummaryText: true,
|
||||
);
|
||||
|
||||
await _localNotificationsPlugin.show(
|
||||
1995,
|
||||
'',
|
||||
'',
|
||||
LocalNotificationConfig.instance.generateNotificationDetails(setAsGroup: true)
|
||||
null,
|
||||
null,
|
||||
LocalNotificationConfig.instance.generateNotificationDetails(
|
||||
setAsGroup: true,
|
||||
styleInformation: inboxStyleInformation
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user