bookmark message color change

This commit is contained in:
Kalonkarthik 2025-02-28 12:31:34 +05:30
parent cd1bb0fc8c
commit de820662f7
4 changed files with 127 additions and 142 deletions

View File

@ -6,6 +6,7 @@ import 'package:pocketbase/pocketbase.dart';
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/my_router.dart';
import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
import 'package:uae_stat/presentation/Screens/profilepage.dart';
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
@ -13,7 +14,7 @@ import 'package:uae_stat/presentation/components/my_toggle.dart';
import 'package:uae_stat/presentation/components/space.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../../../config/my_theme.dart';
import 'package:uae_stat/config/my_theme.dart';
class CreateNewPw extends ConsumerStatefulWidget {
final String userId;
@ -38,6 +39,11 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
String? _newPassword;
String? _confirmPassword;
final fcscBanner = Image.asset(
BannerAssetPath.fcsc,
height: 40,
);
String? _validateOldPassword(String? value) {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context)!.old_password_is_required;
@ -624,16 +630,17 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
),
SizedBox(height: screenHeight / 5),
Center(
child: Container(
height: screenHeight / 16,
width: screenWidth / 2.5,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/splash_screen/logo.png"),
fit: BoxFit.fill,
),
),
),
// child: Container(
// height: screenHeight / 16,
// width: screenWidth / 2.5,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage("assets/splash_screen/logo.png"),
// fit: BoxFit.fill,
// ),
// ),
// ),
child: fcscBanner,
),
],
),
@ -718,16 +725,17 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
),
SizedBox(height: screenHeight / 2.2),
Center(
child: Container(
height: 40,
width: screenWidth / 2.5,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/splash_screen/logo.png"),
fit: BoxFit.fill,
),
),
),
// child: Container(
// height: 40,
// width: screenWidth / 2.5,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage("assets/splash_screen/logo.png"),
// fit: BoxFit.fill,
// ),
// ),
// ),
child: fcscBanner,
),
],
),

View File

@ -171,10 +171,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
SnackBar(
content: Text(
AppLocalizations.of(context)!.added_to_Bookmark,
style: TextStyle(
color: Color(0xFF2F692C), fontWeight: FontWeight.w600),
),
backgroundColor: Color(0xFFD6E9C6),
duration: Duration(seconds: 2),
),
);
@ -185,10 +182,10 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
SnackBar(
content: Text(
AppLocalizations.of(context)!.failed_To_Remove,
style: TextStyle(
color: Color(0xFF544C4C), fontWeight: FontWeight.w600),
// style: TextStyle(
// color: Color(0xFF544C4C), fontWeight: FontWeight.w600),
),
backgroundColor: Color(0xFFEB5F24),
// backgroundColor: Color(0xFFEB5F24),
duration: Duration(seconds: 2),
),
);
@ -217,10 +214,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
SnackBar(
content: Text(
AppLocalizations.of(context)!.removed_from_Bookmark,
style: TextStyle(
color: Color(0xFF2F692C), fontWeight: FontWeight.w600),
),
backgroundColor: Color(0xFFD6E9C6),
duration: Duration(seconds: 2),
),
);
@ -231,10 +225,10 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
SnackBar(
content: Text(
'Failed to Remove',
style: TextStyle(
color: Color(0xFF544C4C), fontWeight: FontWeight.w600),
// style: TextStyle(
// color: Color(0xFF544C4C), fontWeight: FontWeight.w600),
),
backgroundColor: Color(0xFFEB5F24),
// backgroundColor: Color(0xFFEB5F24),
duration: Duration(seconds: 2),
),
);
@ -282,49 +276,55 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
),
actions: [
SizedBox(height: 20),
SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10.0), // Adjust the radius as needed
),
side: BorderSide(
color: Color(0xFFAA8E83), // Set the outline color
width: 1, // Set the border width
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10.0), // Adjust the radius as needed
),
side: BorderSide(
color: Color(0xFFAA8E83), // Set the outline color
width: 1, // Set the border width
),
),
child: Text(
context.translate('No', 'لا'),
style: TextStyle(
color: Color(0xFFAA8E83),
fontSize: 16,
),
),
),
),
child: Text(
context.translate('No', 'لا'),
style: TextStyle(
color: Color(0xFFAA8E83),
fontSize: 16,
SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () {
Navigator.pop(context);
removeBookmark(); // Close dialog
},
style: TextButton.styleFrom(
backgroundColor: Color(0xFFAA8E83), // Set background color
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), // Set text color
),
),
child: Text(
context.translate('Yes', 'نعم'),
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
),
),
),
SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () {
Navigator.pop(context);
removeBookmark(); // Close dialog
},
style: TextButton.styleFrom(
backgroundColor: Color(0xFFAA8E83), // Set background color
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), // Set text color
),
),
child: Text(
context.translate('Yes', 'نعم'),
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
),
],
)
],
),
);
@ -369,48 +369,51 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
),
actions: [
SizedBox(height: 20),
SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10.0), // Adjust the radius as needed
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10.0), // Adjust the radius as needed
),
side: BorderSide(
color: Color(0xFFAA8E83), // Set the outline color
width: 1, // Set the border width
),
),
side: BorderSide(
color: Color(0xFFAA8E83), // Set the outline color
width: 1, // Set the border width
),
),
child: Text(
context.translate('No', 'لا'),
style: TextStyle(
color: Color(0xFFAA8E83),
fontSize: 16,
child: Text(
context.translate('No', 'لا'),
style: TextStyle(
color: Color(0xFFAA8E83),
fontSize: 16,
),
),
),
),
),
SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () {
Navigator.pop(context);
addBookmark(); // Close dialog
},
style: TextButton.styleFrom(
backgroundColor: Color(0xFFAA8E83), // Set background color
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), // Set text color
SizedBox(
width: 100, // Set the desired width
child: TextButton(
onPressed: () {
Navigator.pop(context);
addBookmark(); // Close dialog
},
style: TextButton.styleFrom(
backgroundColor: Color(0xFFAA8E83), // Set background color
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), // Set text color
),
),
child: Text(
context.translate('Yes', 'نعم'),
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
),
child: Text(
context.translate('Yes', 'نعم'),
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
),],
),
],
),

View File

@ -1018,7 +1018,7 @@ class ConfirmationDialog extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Are you sure you want to save this page?",
AppLocalizations.of(context)!.sure_save_page,
style: const TextStyle(
fontSize: 14,
color: Color(0xFF898C81),
@ -1030,7 +1030,7 @@ class ConfirmationDialog extends StatelessWidget {
SizedBox(height: 8),
Text.rich(
TextSpan(
text: "Once saved, you will not be able to change your ",
text: AppLocalizations.of(context)!.not_able_to_change,
style: TextStyle(
fontSize: 14,
color: Color(0xFF898C81),
@ -1039,15 +1039,15 @@ class ConfirmationDialog extends StatelessWidget {
),
children: [
TextSpan(
text: "Name",
text: AppLocalizations.of(context)!.name,
style:
TextStyle(fontWeight: FontWeight.w700), // Bold for "name"
),
TextSpan(
text: " or ",
text: context.translate(' or ','أو'),
),
TextSpan(
text: "Date of birth",
text: AppLocalizations.of(context)!.dob,
style: TextStyle(
fontWeight: FontWeight.w700), // Bold for "date of birth"
),

View File

@ -151,18 +151,6 @@ class _BookMarkState extends ConsumerState<BookMark> {
await _pb.collection('bookmark').delete(bookmarkId!, headers: {
'Authorization': adminToken,
});
// Show success SnackBar
// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(
// content: Text(
// 'Removed from Bookmark.',
// style: TextStyle(
// color: Color(0xFF2F692C), fontWeight: FontWeight.w600),
// ),
// backgroundColor: Color(0xFFD6E9C6),
// duration: Duration(seconds: 2),
// ),
// );
final locale = ref.read(localeProvider);
fetchBookmarks(locale?.languageCode ?? 'en');
// ToastUtil.showSuccessToast("Removed from Bookmark.");
@ -170,11 +158,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Removed From Bookmark',
style: TextStyle(color: Color(0xFF2F692C),
fontWeight: FontWeight.w500),
AppLocalizations.of(context)!.removed_from_Bookmark,
),
backgroundColor: Color(0xFFD6E9C6),
duration: Duration(seconds: 2),
),
);
@ -613,18 +598,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
GestureDetector(
onTap: () {
debugPrint("Icon clicked in: ${data['title']}");
removeBookmark(data['id']);
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text(
// context.translate('Removed From Bookmark','تمت الإزالة من العلامات المرجعية'),
// // style: TextStyle(color: Color(0xFF2F692C),
// // fontWeight: FontWeight.w500),
// ),
// // backgroundColor: Color(0xFFD6E9C6),
// duration: Duration(seconds: 2),
// ),
// );
showRemoveBookmarkDialog(data['id']);
},
child: SvgPicture.asset(
BookmarkAssetPath.delete,