Merge pull request 'notifications colors fix' (#187) from notification_colors into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/187
This commit is contained in:
@@ -102,21 +102,19 @@ class AppColors {
|
|||||||
|
|
||||||
static Color get primary10Light =>
|
static Color get primary10Light =>
|
||||||
_isDarkMode
|
_isDarkMode
|
||||||
? const Color.fromRGBO(104, 151, 151, 0.2)
|
? const Color.fromRGBO(41, 111, 221, 0.05)
|
||||||
: const Color(0xFFF7FAFF);
|
: const Color(0xFFF7FAFF);
|
||||||
|
|
||||||
static Color get primary20 =>
|
static Color get primary20 =>
|
||||||
_isDarkMode
|
_isDarkMode
|
||||||
? const Color.fromRGBO(111, 134, 165, 0.2)
|
? const Color.fromRGBO(115, 134, 165, 0.3)
|
||||||
: const Color.fromRGBO(11, 134, 165, 0.2);
|
: const Color.fromRGBO(229, 239, 255, 1);
|
||||||
|
|
||||||
static Color get primary30 =>
|
static Color get primary30 =>
|
||||||
_isDarkMode ? const Color(0xFF06162E) : const Color(0xFFD9E8FF);
|
_isDarkMode ? const Color(0xFF06162E) : const Color(0xFFD9E8FF);
|
||||||
|
|
||||||
static Color get orange10 =>
|
static Color get orange10 =>
|
||||||
_isDarkMode
|
_isDarkMode ? const Color(0xFF2D2923) : const Color(0xFFFFF7EB);
|
||||||
? const Color.fromRGBO(131, 120, 105, 0.2)
|
|
||||||
: const Color(0xFFFFF2DE);
|
|
||||||
|
|
||||||
static Color get orange0 =>
|
static Color get orange0 =>
|
||||||
_isDarkMode
|
_isDarkMode
|
||||||
@@ -156,6 +154,9 @@ class AppColors {
|
|||||||
static Color get purpleLight =>
|
static Color get purpleLight =>
|
||||||
_isDarkMode ? const Color(0xFFEAE6EF) : const Color(0xFFEAE6EF);
|
_isDarkMode ? const Color(0xFFEAE6EF) : const Color(0xFFEAE6EF);
|
||||||
|
|
||||||
|
static Color get orange20 =>
|
||||||
|
_isDarkMode ? const Color(0xFF6B5E4B) : const Color(0xFFF6D7AB);
|
||||||
|
|
||||||
static Color get red0 =>
|
static Color get red0 =>
|
||||||
_isDarkMode
|
_isDarkMode
|
||||||
? const Color(0xFF312F2F)
|
? const Color(0xFF312F2F)
|
||||||
@@ -181,5 +182,4 @@ class AppColors {
|
|||||||
static const Color yellow4 = Color(0xFFC07A25);
|
static const Color yellow4 = Color(0xFFC07A25);
|
||||||
static const Color secondaryborder = Color(0xFFCDCDCD);
|
static const Color secondaryborder = Color(0xFFCDCDCD);
|
||||||
static const Color secondaryborder2 = Color(0xFFDADADA);
|
static const Color secondaryborder2 = Color(0xFFDADADA);
|
||||||
static const Color orange20 = Color(0xFFF6D7AB);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
|||||||
const Expanded(
|
const Expanded(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
color: AppColors.secondary50,
|
color: AppColors.cyanTeal,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -150,9 +150,10 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => PageSelectionDialog(
|
builder:
|
||||||
totalPages: totalPages,
|
(context) => PageSelectionDialog(
|
||||||
),
|
totalPages: totalPages,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedPage != null) {
|
if (selectedPage != null) {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
|||||||
children: [
|
children: [
|
||||||
NotificationAllTab(scrollController: _scrollAll),
|
NotificationAllTab(scrollController: _scrollAll),
|
||||||
NotificationUnreadTab(scrollController: _scrollUnread),
|
NotificationUnreadTab(scrollController: _scrollUnread),
|
||||||
NotificationImportantTab(scrollController: _scrollImportant),
|
NotificationImportantTab(scrollController: _scrollImportant),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -112,7 +112,7 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
|||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 16),
|
padding: EdgeInsets.symmetric(vertical: 16),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(color: AppColors.secondary50),
|
child: CircularProgressIndicator(color: AppColors.cyanTeal),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
|||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 16),
|
padding: EdgeInsets.symmetric(vertical: 16),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(color: AppColors.secondary50),
|
child: CircularProgressIndicator(color: AppColors.cyanTeal),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
|||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 16),
|
padding: EdgeInsets.symmetric(vertical: 16),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(color: AppColors.secondary50),
|
child: CircularProgressIndicator(color: AppColors.cyanTeal),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -119,9 +119,7 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
|||||||
if (isLoading)
|
if (isLoading)
|
||||||
const Expanded(
|
const Expanded(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(color: AppColors.cyanTeal),
|
||||||
color: AppColors.secondary50,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@@ -152,9 +150,9 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => PageSelectionDialog(
|
builder:
|
||||||
totalPages: totalPages,
|
(context) =>
|
||||||
),
|
PageSelectionDialog(totalPages: totalPages),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedPage != null) {
|
if (selectedPage != null) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||||
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||||
|
|
||||||
|
import '../../../core/theme/colors.dart';
|
||||||
import 'notification_card.dart';
|
import 'notification_card.dart';
|
||||||
|
|
||||||
class NotificationAllTab extends StatelessWidget {
|
class NotificationAllTab extends StatelessWidget {
|
||||||
@@ -16,7 +17,9 @@ class NotificationAllTab extends StatelessWidget {
|
|||||||
|
|
||||||
if (viewModel.isLoadingAll &&
|
if (viewModel.isLoadingAll &&
|
||||||
(viewModel.allNotificationResponse?.data?.isEmpty ?? true)) {
|
(viewModel.allNotificationResponse?.data?.isEmpty ?? true)) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(
|
||||||
|
child: CircularProgressIndicator(color: AppColors.cyanTeal),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final notifications = viewModel.allNotificationResponse?.data ?? [];
|
final notifications = viewModel.allNotificationResponse?.data ?? [];
|
||||||
@@ -38,4 +41,3 @@ class NotificationAllTab extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,10 @@ class NotificationCard extends StatelessWidget {
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
viewModel.markAsRead(notificationId: notification.id!);
|
if (!notification.seen!) {
|
||||||
|
viewModel.markAsRead(notificationId: notification.id!);
|
||||||
|
}
|
||||||
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class NotificationMoreDialog extends StatelessWidget {
|
|||||||
return Dialog(
|
return Dialog(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
insetPadding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
insetPadding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)),
|
||||||
child: Container(
|
child: Container(
|
||||||
width:
|
width:
|
||||||
Size(SizeConfig.screenWidth, SizeConfig.screenHeight).displaySize ==
|
Size(SizeConfig.screenWidth, SizeConfig.screenHeight).displaySize ==
|
||||||
@@ -38,6 +38,11 @@ class NotificationMoreDialog extends StatelessWidget {
|
|||||||
DisplaySize.large
|
DisplaySize.large
|
||||||
? 720
|
? 720
|
||||||
: double.infinity,
|
: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
color: AppColors.primary10Light,
|
||||||
|
border: Border.all(color: AppColors.primary20),
|
||||||
|
),
|
||||||
// margin: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
// margin: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()),
|
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:tm_app/core/theme/colors.dart';
|
||||||
import 'package:tm_app/core/utils/size_config.dart';
|
import 'package:tm_app/core/utils/size_config.dart';
|
||||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||||
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||||
|
|
||||||
import 'notification_card.dart';
|
import 'notification_card.dart';
|
||||||
|
|
||||||
class NotificationUnreadTab extends StatelessWidget {
|
class NotificationUnreadTab extends StatelessWidget {
|
||||||
@@ -14,7 +16,9 @@ class NotificationUnreadTab extends StatelessWidget {
|
|||||||
final viewModel = context.watch<NotificationViewModel>();
|
final viewModel = context.watch<NotificationViewModel>();
|
||||||
if (viewModel.isLoadingUnread &&
|
if (viewModel.isLoadingUnread &&
|
||||||
(viewModel.unreadNotificationResponse?.data?.isEmpty ?? true)) {
|
(viewModel.unreadNotificationResponse?.data?.isEmpty ?? true)) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(
|
||||||
|
child: CircularProgressIndicator(color: AppColors.cyanTeal),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final notifications = viewModel.unreadNotificationResponse?.data ?? [];
|
final notifications = viewModel.unreadNotificationResponse?.data ?? [];
|
||||||
|
|||||||
Reference in New Issue
Block a user