FIX-PIE-BAR CHART CHANGES
This commit is contained in:
parent
65a7f87363
commit
e6a2d60f09
@ -247,7 +247,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
|||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return Container(
|
return Container(
|
||||||
color: Color(0x98FFFCE5),
|
color: isDarkTheme ? Colors.black : Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@ -63,8 +63,7 @@ class _ResetPasswordScreenState extends State<Changepassword> {
|
|||||||
|
|
||||||
// Proceed with OTP request
|
// Proceed with OTP request
|
||||||
final otpResponse = await http.post(
|
final otpResponse = await http.post(
|
||||||
Uri.parse(
|
Uri.parse('$apiUrl/api/collections/otp_requests/records'),
|
||||||
'$apiUrl/api/collections/otp_requests/records'),
|
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': 'Bearer $authToken',
|
'Authorization': 'Bearer $authToken',
|
||||||
@ -260,13 +259,15 @@ class _ResetPasswordScreenState extends State<Changepassword> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
if (_isLoading)
|
if (_isLoading)
|
||||||
const SizedBox(
|
Container(
|
||||||
|
child: const SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
else ...[
|
else ...[
|
||||||
const Text(
|
const Text(
|
||||||
|
|||||||
@ -280,7 +280,9 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
|||||||
),
|
),
|
||||||
if (isLoading)
|
if (isLoading)
|
||||||
Container(
|
Container(
|
||||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
color: isDarkTheme
|
||||||
|
? Colors.black
|
||||||
|
: Colors.white, // Semi-transparent background
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
import 'package:uae_stat/config/api_config.dart';
|
import 'package:uae_stat/config/api_config.dart';
|
||||||
import 'package:uae_stat/config/connectivity_provider.dart';
|
import 'package:uae_stat/config/connectivity_provider.dart';
|
||||||
import 'package:uae_stat/config/my_router.dart';
|
import 'package:uae_stat/config/my_router.dart';
|
||||||
|
import 'package:uae_stat/config/theme/theme_provider.dart';
|
||||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||||
import 'package:uae_stat/infrastructure/data/p_auth_repo.dart';
|
import 'package:uae_stat/infrastructure/data/p_auth_repo.dart';
|
||||||
import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart';
|
import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart';
|
||||||
@ -191,13 +192,14 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
// throw Exception("User not found");
|
// throw Exception("User not found");
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text('User not found',
|
content: Text(
|
||||||
|
'User not found',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
)
|
)),
|
||||||
),),
|
),
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -222,14 +224,13 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content:
|
content: Text(
|
||||||
Text(AppLocalizations.of(context)!.password_update_successfully,
|
AppLocalizations.of(context)!.password_update_successfully,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
)
|
)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
),
|
),
|
||||||
@ -243,13 +244,13 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text('Failed to update password: $e',
|
content: Text(
|
||||||
|
'Failed to update password: $e',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
)
|
)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
),
|
),
|
||||||
@ -277,6 +278,12 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// final themeMode = ref.read(themeProvider);
|
||||||
|
// final themeMode = ThemeMode.dark;
|
||||||
|
final isDarkTheme = ref.read(themeProvider) == ThemeMode.dark ||
|
||||||
|
(ref.read(themeProvider) == ThemeMode.system &&
|
||||||
|
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
body: Stack(children: [
|
body: Stack(children: [
|
||||||
@ -289,7 +296,9 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
),
|
),
|
||||||
if (isLoading)
|
if (isLoading)
|
||||||
Container(
|
Container(
|
||||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
color: isDarkTheme
|
||||||
|
? Colors.black
|
||||||
|
: Colors.white, // Semi-transparent background
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -386,7 +395,6 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
),
|
),
|
||||||
fontWeight: FontWeight.w300,
|
fontWeight: FontWeight.w300,
|
||||||
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
@ -407,8 +415,7 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
)
|
)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: context.translate('from Previously Used Password',
|
text: context.translate('from Previously Used Password',
|
||||||
@ -629,11 +636,7 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
)
|
)),
|
||||||
),
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 2),
|
SizedBox(width: 2),
|
||||||
Icon(
|
Icon(
|
||||||
@ -687,8 +690,7 @@ class _ForgotPasswordState extends ConsumerState<ForgotPassword> {
|
|||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
)
|
)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
|
|||||||
@ -1976,7 +1976,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
ref.watch(localeProvider)?.languageCode ?? 'en';
|
ref.watch(localeProvider)?.languageCode ?? 'en';
|
||||||
|
|
||||||
print('locale22- $locale');
|
print('locale22- $locale');
|
||||||
final isDark = ref.watch(themeProvider) == ThemeMode.dark ||
|
final isDark = ref.watch(themeProvider) ==
|
||||||
|
ThemeMode.dark ||
|
||||||
(ref.watch(themeProvider) == ThemeMode.system &&
|
(ref.watch(themeProvider) == ThemeMode.system &&
|
||||||
MediaQuery.of(context).platformBrightness ==
|
MediaQuery.of(context).platformBrightness ==
|
||||||
Brightness.dark);
|
Brightness.dark);
|
||||||
@ -2048,8 +2049,10 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
'en';
|
'en';
|
||||||
|
|
||||||
print('locale22- $locale');
|
print('locale22- $locale');
|
||||||
final isDark = ref.watch(themeProvider) == ThemeMode.dark ||
|
final isDark =
|
||||||
(ref.watch(themeProvider) == ThemeMode.system &&
|
ref.watch(themeProvider) == ThemeMode.dark ||
|
||||||
|
(ref.watch(themeProvider) ==
|
||||||
|
ThemeMode.system &&
|
||||||
MediaQuery.of(context)
|
MediaQuery.of(context)
|
||||||
.platformBrightness ==
|
.platformBrightness ==
|
||||||
Brightness.dark);
|
Brightness.dark);
|
||||||
@ -2501,7 +2504,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
//
|
//
|
||||||
final bodyColor = Color(
|
final bodyColor = Color(
|
||||||
int.parse(
|
int.parse(
|
||||||
(chartScreenData['header_color'] ?? '#898C81').replaceFirst('#', '0xff'),
|
(chartScreenData['header_color'] ?? '#898C81')
|
||||||
|
.replaceFirst('#', '0xff'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final chartHeader = chartScreenData['main_topic'] ?? '';
|
final chartHeader = chartScreenData['main_topic'] ?? '';
|
||||||
@ -2760,8 +2764,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
// '#', '0xff')))
|
// '#', '0xff')))
|
||||||
// : Colors.white,
|
// : Colors.white,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -2804,10 +2806,16 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
) // Show loading spinner
|
) // Show loading spinner
|
||||||
: Image(
|
: Image(
|
||||||
image: AssetImage(
|
image: AssetImage(
|
||||||
isDarkTheme ? UaeNumbersAssetPath.shareDark : UaeNumbersAssetPath.shareLight,
|
isDarkTheme
|
||||||
|
? UaeNumbersAssetPath
|
||||||
|
.shareDark
|
||||||
|
: UaeNumbersAssetPath
|
||||||
|
.shareLight,
|
||||||
),
|
),
|
||||||
width: 24, // Set your desired width
|
width:
|
||||||
height: 24, // Set your desired height
|
24, // Set your desired width
|
||||||
|
height:
|
||||||
|
24, // Set your desired height
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -2869,7 +2877,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
// context, filterData, chartsData);
|
// context, filterData, chartsData);
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
@ -3122,6 +3129,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
(chartScreenData['header_color'] ?? '#898C81')
|
(chartScreenData['header_color'] ?? '#898C81')
|
||||||
.replaceFirst(
|
.replaceFirst(
|
||||||
'#', '0xff'))), // Semi-transparent background
|
'#', '0xff'))), // Semi-transparent background
|
||||||
|
child: Container(
|
||||||
|
color: isDarkTheme ? Colors.black : Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -3139,6 +3148,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
])),
|
])),
|
||||||
);
|
);
|
||||||
@ -3170,7 +3180,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
// ),
|
// ),
|
||||||
// ],
|
// ],
|
||||||
),
|
),
|
||||||
child: Center( // ✅ Center the IconButton
|
child: Center(
|
||||||
|
// ✅ Center the IconButton
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
padding: EdgeInsets.zero, // ✅ Remove default padding
|
padding: EdgeInsets.zero, // ✅ Remove default padding
|
||||||
constraints: BoxConstraints(), // ✅ Remove default constraints
|
constraints: BoxConstraints(), // ✅ Remove default constraints
|
||||||
@ -3215,7 +3226,17 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
),
|
),
|
||||||
// color: isActive ? Colors.black : Colors.white,
|
// color: isActive ? Colors.black : Colors.white,
|
||||||
color: chartScreenData['main_topic'] == 'SOCIAL' ? isActive ? Colors.white : isDarkTheme ? Colors.white : Colors.black : isActive ? Colors.black : isDarkTheme ? Colors.white : Colors.black,
|
color: chartScreenData['main_topic'] == 'SOCIAL'
|
||||||
|
? isActive
|
||||||
|
? Colors.white
|
||||||
|
: isDarkTheme
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black
|
||||||
|
: isActive
|
||||||
|
? Colors.black
|
||||||
|
: isDarkTheme
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black,
|
||||||
// color: Colors.white,
|
// color: Colors.white,
|
||||||
fontWeight: isActive ? FontWeight.w500 : FontWeight.w400,
|
fontWeight: isActive ? FontWeight.w500 : FontWeight.w400,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
@ -3314,8 +3335,8 @@ class CardWidget extends StatelessWidget {
|
|||||||
left: 16.0, right: 16.0, bottom: 2.0, top: 1.0),
|
left: 16.0, right: 16.0, bottom: 2.0, top: 1.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: backgroundColor, // Move color inside BoxDecoration
|
color: backgroundColor, // Move color inside BoxDecoration
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius:
|
||||||
5), // Ensure border radius is applied
|
BorderRadius.circular(5), // Ensure border radius is applied
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@ import 'package:http/http.dart' as http;
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import '../../Screens/auth_verification/registration.dart';
|
import '../../Screens/auth_verification/registration.dart';
|
||||||
import 'package:pocketbase/pocketbase.dart';
|
import 'package:pocketbase/pocketbase.dart';
|
||||||
import 'package:uae_stat/config/api_config.dart';
|
import 'package:uae_stat/config/api_config.dart';
|
||||||
|
|
||||||
import '../../components/indicators/locale_provider.dart';
|
import '../../components/indicators/locale_provider.dart';
|
||||||
import '../../components/my_toggle.dart';
|
import '../../components/my_toggle.dart';
|
||||||
@ -214,7 +214,6 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
final body = json.decode(response.body);
|
final body = json.decode(response.body);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
return body['status'] ?? 'Reset link sent successfully.';
|
return body['status'] ?? 'Reset link sent successfully.';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
final errorResponse = json.decode(response.body);
|
final errorResponse = json.decode(response.body);
|
||||||
throw Exception(
|
throw Exception(
|
||||||
@ -302,7 +301,8 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void openAppLinkSettings() {
|
void openAppLinkSettings() {
|
||||||
const packageName = 'ae.gov.fcsc.frontend'; // Replace with your app's package
|
const packageName =
|
||||||
|
'ae.gov.fcsc.frontend'; // Replace with your app's package
|
||||||
final intent = AndroidIntent(
|
final intent = AndroidIntent(
|
||||||
action: 'android.settings.APP_OPEN_BY_DEFAULT_SETTINGS',
|
action: 'android.settings.APP_OPEN_BY_DEFAULT_SETTINGS',
|
||||||
data: 'package:$packageName',
|
data: 'package:$packageName',
|
||||||
@ -320,17 +320,21 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeTheme(BuildContext context,WidgetRef ref, String userId) async {
|
Future<void> initializeTheme(
|
||||||
|
BuildContext context, WidgetRef ref, String userId) async {
|
||||||
final themeService = ThemeBaseService();
|
final themeService = ThemeBaseService();
|
||||||
final theme = await themeService.getUserTheme(userId); // e.g., "dark"
|
final theme = await themeService.getUserTheme(userId); // e.g., "dark"
|
||||||
final platformBrightness = MediaQuery.of(context).platformBrightness;
|
final platformBrightness = MediaQuery.of(context).platformBrightness;
|
||||||
ref.read(themeProvider.notifier).updateTheme(AppThemeExtension.fromString(theme),platformBrightness);
|
ref
|
||||||
|
.read(themeProvider.notifier)
|
||||||
|
.updateTheme(AppThemeExtension.fromString(theme), platformBrightness);
|
||||||
final themeMode = ref.watch(themeProvider);
|
final themeMode = ref.watch(themeProvider);
|
||||||
print('themeMode Login');
|
print('themeMode Login');
|
||||||
print('themeMode $themeMode');
|
print('themeMode $themeMode');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> oAuthGoogleAndAppleLogin(BuildContext context, WidgetRef ref,platform) async {
|
Future<void> oAuthGoogleAndAppleLogin(
|
||||||
|
BuildContext context, WidgetRef ref, platform) async {
|
||||||
print(platform);
|
print(platform);
|
||||||
try {
|
try {
|
||||||
final authData =
|
final authData =
|
||||||
@ -567,7 +571,6 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
ref.listen<AsyncValue<bool>>(connectivityProvider, (previous, hasInternet) {
|
ref.listen<AsyncValue<bool>>(connectivityProvider, (previous, hasInternet) {
|
||||||
@ -792,7 +795,6 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@ -917,7 +919,7 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
|
|
||||||
await saveUserId(userId, loginCount);
|
await saveUserId(userId, loginCount);
|
||||||
await getDeviceToken(context, userId);
|
await getDeviceToken(context, userId);
|
||||||
await initializeTheme(context,ref,userId);
|
await initializeTheme(context, ref, userId);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final bool isProfileComplete = await profileStatus(userId, ref);
|
final bool isProfileComplete = await profileStatus(userId, ref);
|
||||||
@ -1026,7 +1028,9 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
6.horizontalSpace,
|
6.horizontalSpace,
|
||||||
Icon(
|
Icon(
|
||||||
Icons.chevron_right_outlined,
|
Icons.chevron_right_outlined,
|
||||||
color: isDarkTheme ? Colors.white : Colors.white, // Set your desired color here
|
color: isDarkTheme
|
||||||
|
? Colors.white
|
||||||
|
: Colors.white, // Set your desired color here
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -1235,7 +1239,7 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
oAuthGoogleAndAppleLogin(context,ref,'google');
|
oAuthGoogleAndAppleLogin(context, ref, 'google');
|
||||||
},
|
},
|
||||||
style: OutlinedButton.styleFrom(
|
style: OutlinedButton.styleFrom(
|
||||||
side: const BorderSide(color: Color(0xFF000000)),
|
side: const BorderSide(color: Color(0xFF000000)),
|
||||||
@ -1255,7 +1259,8 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
MiscIconAssetPath.signInWithGoogle, // replace with your Google icon asset
|
MiscIconAssetPath
|
||||||
|
.signInWithGoogle, // replace with your Google icon asset
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
@ -1275,7 +1280,7 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
oAuthGoogleAndAppleLogin(context,ref,'apple');
|
oAuthGoogleAndAppleLogin(context, ref, 'apple');
|
||||||
},
|
},
|
||||||
style: OutlinedButton.styleFrom(
|
style: OutlinedButton.styleFrom(
|
||||||
side: const BorderSide(color: Color(0xFF000000)),
|
side: const BorderSide(color: Color(0xFF000000)),
|
||||||
@ -1295,7 +1300,8 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
MiscIconAssetPath.signInWithApple, // replace with your Google icon asset
|
MiscIconAssetPath
|
||||||
|
.signInWithApple, // replace with your Google icon asset
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
@ -1333,7 +1339,8 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
MiscIconAssetPath.signInWithUAEPass, // replace with your Google icon asset
|
MiscIconAssetPath
|
||||||
|
.signInWithUAEPass, // replace with your Google icon asset
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
@ -1497,7 +1504,6 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// abstract class _LocalAuthRepo {
|
// abstract class _LocalAuthRepo {
|
||||||
// static const _key = 'session';
|
// static const _key = 'session';
|
||||||
// static const _storage = FlutterSecureStorage();
|
// static const _storage = FlutterSecureStorage();
|
||||||
|
|||||||
@ -201,7 +201,7 @@ class _MyHomePageState extends ConsumerState<MyHomePage> {
|
|||||||
context.go('/login'); // Redirect to login after logout
|
context.go('/login'); // Redirect to login after logout
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showExitConfirmation(BuildContext context,isDarkTheme) {
|
void _showExitConfirmation(BuildContext context, isDarkTheme) {
|
||||||
double myheight = MediaQuery.of(context).size.height;
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -215,10 +215,15 @@ class _MyHomePageState extends ConsumerState<MyHomePage> {
|
|||||||
title: Text(
|
title: Text(
|
||||||
context.translate('Log Out Confirmation', 'تأكيد تسجيل الخروج'),
|
context.translate('Log Out Confirmation', 'تأكيد تسجيل الخروج'),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: isDarkTheme ? Colors.white : Colors.black, fontFamily: context.translate(
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: isDarkTheme ? Colors.white : Colors.black,
|
||||||
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
content: Padding(
|
content: Padding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
@ -285,10 +290,14 @@ class _MyHomePageState extends ConsumerState<MyHomePage> {
|
|||||||
.scaleDown, // Prevents wrapping while adjusting text size
|
.scaleDown, // Prevents wrapping while adjusting text size
|
||||||
child: Text(
|
child: Text(
|
||||||
context.translate('Log Out', 'تسجيل الخروج'),
|
context.translate('Log Out', 'تسجيل الخروج'),
|
||||||
style: TextStyle(color: Colors.white, fontSize: 16, fontFamily: context.translate(
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -355,14 +364,18 @@ class _MyHomePageState extends ConsumerState<MyHomePage> {
|
|||||||
canPop: false, // Allow back navigation only if not login screen
|
canPop: false, // Allow back navigation only if not login screen
|
||||||
onPopInvokedWithResult: (didPop, result) {
|
onPopInvokedWithResult: (didPop, result) {
|
||||||
if (didPop) return;
|
if (didPop) return;
|
||||||
_showExitConfirmation(context,isDarkTheme); // Show exit confirmation dialog
|
_showExitConfirmation(
|
||||||
|
context, isDarkTheme); // Show exit confirmation dialog
|
||||||
},
|
},
|
||||||
child: BaseScaffold(
|
child: BaseScaffold(
|
||||||
title: Center(
|
title: Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: myheight / 5,
|
height: myheight / 5,
|
||||||
width: mywidth / 3,
|
width: mywidth / 3,
|
||||||
child: Image(image: AssetImage(isDarkTheme ? LogoAssetPath.uaeStatDark : LogoAssetPath.uaeStatLight)))),
|
child: Image(
|
||||||
|
image: AssetImage(isDarkTheme
|
||||||
|
? LogoAssetPath.uaeStatDark
|
||||||
|
: LogoAssetPath.uaeStatLight)))),
|
||||||
body: EconomyStatsWidget(),
|
body: EconomyStatsWidget(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -1107,7 +1120,6 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
|
|||||||
|
|
||||||
fetchData(locale?.languageCode ?? 'en', themeMode);
|
fetchData(locale?.languageCode ?? 'en', themeMode);
|
||||||
|
|
||||||
|
|
||||||
// _fetchUserData();
|
// _fetchUserData();
|
||||||
_loadLoginCount();
|
_loadLoginCount();
|
||||||
}
|
}
|
||||||
@ -1166,11 +1178,12 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Future<void> fetchData(locale,themeMode) async {
|
Future<void> fetchData(locale, themeMode) async {
|
||||||
// const baseUrl = 'https://pb.venbait.in/api/getHomePageData';
|
// const baseUrl = 'https://pb.venbait.in/api/getHomePageData';
|
||||||
const baseUrl = '$apiUrl/api/getHomePageData';
|
const baseUrl = '$apiUrl/api/getHomePageData';
|
||||||
try {
|
try {
|
||||||
final response = await http.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
|
final response = await http
|
||||||
|
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
setState(() {
|
setState(() {
|
||||||
data = json.decode(response.body);
|
data = json.decode(response.body);
|
||||||
@ -1229,7 +1242,7 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
|
|||||||
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||||
|
|
||||||
final themeString = isDark ? 'dark' : 'light';
|
final themeString = isDark ? 'dark' : 'light';
|
||||||
fetchData(localeCode,themeString);
|
fetchData(localeCode, themeString);
|
||||||
});
|
});
|
||||||
|
|
||||||
final isConnected = ref.watch(connectivityProvider);
|
final isConnected = ref.watch(connectivityProvider);
|
||||||
@ -1257,7 +1270,7 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
|
|||||||
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||||
|
|
||||||
final themeString = isDark ? 'dark' : 'light';
|
final themeString = isDark ? 'dark' : 'light';
|
||||||
fetchData(localeCode,themeString);
|
fetchData(localeCode, themeString);
|
||||||
});
|
});
|
||||||
|
|
||||||
final isDarkTheme = ref.watch(themeProvider) == ThemeMode.dark ||
|
final isDarkTheme = ref.watch(themeProvider) == ThemeMode.dark ||
|
||||||
@ -1269,7 +1282,9 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
|
|||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return Container(
|
return Container(
|
||||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
color: isDarkTheme
|
||||||
|
? Colors.black
|
||||||
|
: Colors.white, // Semi-transparent background
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -1406,7 +1421,6 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
|
|||||||
borderColor,
|
borderColor,
|
||||||
mainTopic['color_pattern'],
|
mainTopic['color_pattern'],
|
||||||
mainTopic['main_topic']),
|
mainTopic['main_topic']),
|
||||||
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -1510,8 +1524,7 @@ List<Widget> _buildRows(List<Map<String, dynamic>> tileData, Color borderColor,
|
|||||||
mainTopic: mainTopic,
|
mainTopic: mainTopic,
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
),
|
),
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1538,7 +1551,9 @@ class RoundedCornerContainer extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: backgroundColor,
|
color: backgroundColor,
|
||||||
borderRadius: BorderRadius.only(topRight: Radius.circular(20),topLeft: Radius.circular(20)), // Rounded corners
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: Radius.circular(20),
|
||||||
|
topLeft: Radius.circular(20)), // Rounded corners
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1595,8 +1610,7 @@ class InfoCard extends StatelessWidget {
|
|||||||
final encodedTitle = Uri.encodeComponent(title);
|
final encodedTitle = Uri.encodeComponent(title);
|
||||||
final encodedKey = Uri.encodeQueryComponent('home');
|
final encodedKey = Uri.encodeQueryComponent('home');
|
||||||
|
|
||||||
return Consumer(
|
return Consumer(builder: (context, ref, _) {
|
||||||
builder: (context, ref, _) {
|
|
||||||
final themeMode = ref.watch(themeProvider);
|
final themeMode = ref.watch(themeProvider);
|
||||||
final isDarkTheme = themeMode == ThemeMode.dark ||
|
final isDarkTheme = themeMode == ThemeMode.dark ||
|
||||||
(themeMode == ThemeMode.system &&
|
(themeMode == ThemeMode.system &&
|
||||||
@ -1614,7 +1628,8 @@ class InfoCard extends StatelessWidget {
|
|||||||
|
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 0),
|
margin: const EdgeInsets.symmetric(horizontal: 0),
|
||||||
// padding: const EdgeInsets.all(10),
|
// padding: const EdgeInsets.all(10),
|
||||||
padding: const EdgeInsets.only(bottom: 0.5, top: 1, left: 10, right: 10),
|
padding:
|
||||||
|
const EdgeInsets.only(bottom: 0.5, top: 1, left: 10, right: 10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDarkTheme ? Color(0xFF111111) : null,
|
color: isDarkTheme ? Color(0xFF111111) : null,
|
||||||
border: Border.all(color: bordercolor),
|
border: Border.all(color: bordercolor),
|
||||||
@ -1722,9 +1737,6 @@ class InfoCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -412,7 +412,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
|||||||
),
|
),
|
||||||
body: isLoading
|
body: isLoading
|
||||||
? Container(
|
? Container(
|
||||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
color: isDarkTheme
|
||||||
|
? Colors.black
|
||||||
|
: Colors.white, // Semi-transparent background
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -436,13 +438,13 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
|||||||
const EdgeInsets.only(left: 10.0, right: 10.0, top: 3.0),
|
const EdgeInsets.only(left: 10.0, right: 10.0, top: 3.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
height: 40,
|
height: 40,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
color: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
border: Border.all(width: 2, color: Color(0xFFA0A0A0)),
|
border:
|
||||||
|
Border.all(width: 2, color: Color(0xFFA0A0A0)),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(left: 5.0),
|
padding: EdgeInsets.only(left: 5.0),
|
||||||
@ -450,8 +452,11 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: AppLocalizations.of(context)!.search,
|
hintText: AppLocalizations.of(context)!.search,
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
color: isDarkTheme ? Color(0xFF898C81) : Color(0xFF898C81),
|
color: isDarkTheme
|
||||||
fontFamily: context.translate('Roboto', 'NotoKufi'),
|
? Color(0xFF898C81)
|
||||||
|
: Color(0xFF898C81),
|
||||||
|
fontFamily:
|
||||||
|
context.translate('Roboto', 'NotoKufi'),
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
// height: 1.8,
|
// height: 1.8,
|
||||||
),
|
),
|
||||||
@ -465,7 +470,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
|||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
MiscIconAssetPath.Search,
|
MiscIconAssetPath.Search,
|
||||||
semanticsLabel: 'Search',
|
semanticsLabel: 'Search',
|
||||||
colorFilter: ColorFilter.mode(Color(0xFFAA8E83), BlendMode.srcIn),
|
colorFilter: ColorFilter.mode(
|
||||||
|
Color(0xFFAA8E83), BlendMode.srcIn),
|
||||||
height: 18,
|
height: 18,
|
||||||
width: 18,
|
width: 18,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -239,8 +239,8 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
|||||||
body: isLoading
|
body: isLoading
|
||||||
? Container(
|
? Container(
|
||||||
color: isDarkTheme
|
color: isDarkTheme
|
||||||
? Color(0xFF111111)
|
? Colors.black
|
||||||
: Color(0x98FFFCE5), // Semi-transparent background
|
: Colors.white, // Semi-transparent background
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -309,9 +309,8 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color: isDarkTheme
|
color:
|
||||||
? Colors.white
|
isDarkTheme ? Colors.white : Color(0xFF8E8E8E),
|
||||||
: Color(0xFF8E8E8E),
|
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
|
|||||||
@ -270,7 +270,7 @@ class ProfileRoute extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: bodyContent,
|
child: Container(color: Colors.lightGreenAccent, child: bodyContent),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user