bookmark and cards changes done

This commit is contained in:
venbaittech 2025-02-25 18:08:20 +05:30
parent cd141bfcb4
commit cfe5b5bf20
7 changed files with 1002 additions and 525 deletions

View File

@ -15,12 +15,12 @@ if (localPropertiesFile.exists()) {
def flutterVersionCode = localProperties.getProperty("flutter.versionCode") def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) { if (flutterVersionCode == null) {
flutterVersionCode = "26" flutterVersionCode = "27"
} }
def flutterVersionName = localProperties.getProperty("flutter.versionName") def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) { if (flutterVersionName == null) {
flutterVersionName = "1.0.25" flutterVersionName = "1.0.26"
} }
def keystorePropertiesFile = rootProject.file("key.properties") def keystorePropertiesFile = rootProject.file("key.properties")

View File

@ -1,4 +1,9 @@
{ {
"all_bookmarks":"كل العلامات المرجعية",
"economy_title":" الاقتصاد",
"social_title":"اجتماعي",
"environment_title":"البيئة",
"bookmarks": "الإشارات المرجعية",
"feedback_title": "تعليق", "feedback_title": "تعليق",
"feedback_failed_msg": "لم يتم إرسال تعليقاتك. يرجى المحاولة مرة أخرى.", "feedback_failed_msg": "لم يتم إرسال تعليقاتك. يرجى المحاولة مرة أخرى.",
"thankYou": "شكراً", "thankYou": "شكراً",

View File

@ -1,7 +1,11 @@
{ {
"all_bookmarks":"All Bookmarks",
"feedback_title": "Feedback", "economy_title":"Economy",
"social_title":"Social",
"environment_title":"Environment",
"bookmarks": "Bookmarks",
"feedback_title": "Feedback",
"feedback_failed_msg": "Your feedback could not be \n submitted. Please try again", "feedback_failed_msg": "Your feedback could not be \n submitted. Please try again",
"thankYou": "Thank you", "thankYou": "Thank you",
"feedback_message": "For your valuable feedback, we truly appreciate your input!", "feedback_message": "For your valuable feedback, we truly appreciate your input!",

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ class ChartWidget extends StatelessWidget {
} }
String formatNumberConversion( String formatNumberConversion(
double value, String chartConversion, String numberFormat) { double value, String chartConversion, String numberFormat,) {
// Convert the input value to base unit (actual value) // Convert the input value to base unit (actual value)
double baseValue = value; double baseValue = value;
@ -175,16 +175,15 @@ class ChartWidget extends StatelessWidget {
message: title, // Full text on hover message: title, // Full text on hover
child: ConstrainedBox( child: ConstrainedBox(
// Constrain width to allow wrapping // Constrain width to allow wrapping
constraints: BoxConstraints(maxWidth: 130), constraints: BoxConstraints(maxWidth: 200),
child: Text( child: Text(
title, title,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
), ),
softWrap: true, // softWrap: true,
maxLines: 2, // maxLines: 2,
overflow: overflow: TextOverflow.ellipsis, // Ensures text doesn't overflow
TextOverflow.ellipsis, // Ensures text doesn't overflow
), ),
), ),
), ),
@ -365,31 +364,39 @@ class ChartWidget extends StatelessWidget {
}, },
), ),
), ),
SizedBox(height: 105), SizedBox(height: 45),
Expanded( Expanded(
// child: SingleChildScrollView( // child: SingleChildScrollView(
// scrollDirection: Axis.horizontal, // scrollDirection: Axis.horizontal,
// //
child: SingleChildScrollView( // child: SingleChildScrollView(
scrollDirection: Axis.vertical, // scrollDirection: Axis.vertical,
child: Container( child: Center(
width: double.infinity, child: Container(
constraints: width: double.infinity,
BoxConstraints(minHeight: 3), // Allow dynamic height constraints:
child: Padding( BoxConstraints(minHeight: 3), // Allow dynamic height
padding: const EdgeInsets.only( child: Padding(
left: 0.0, right: 0.0, bottom: 8.0, top: 1.0), padding: const EdgeInsets.only(
child: Wrap( left: 2.0, right: 2.0, bottom: 8.0, top: 1.0),
spacing: 2, child: Column( // Change Row to Column
runSpacing: 5, crossAxisAlignment: CrossAxisAlignment.start,
children: children: generateIndicators(chartData, chartData['group_by']),
generateIndicators(chartData, chartData['group_by']), ),
// child: Wrap(
// spacing: 2,
// runSpacing: 5,
// children:
// generateIndicators(chartData, chartData['group_by']),
// ),
), ),
), ),
), ),
), ),
), // ),
], ],
); );
case 'fl_stacked_bar': case 'fl_stacked_bar':
@ -568,10 +575,11 @@ class ChartWidget extends StatelessWidget {
), ),
textStyle: TextStyle(color: Colors.white), textStyle: TextStyle(color: Colors.white),
child: Text( child: Text(
group.length > 10 group,
? '${group.substring(0, 10)}...' // group.length > 10
: group, // ? '${group.substring(0, 10)}...'
overflow: TextOverflow.ellipsis, // : group,
// overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 11), style: TextStyle(fontSize: 11),
), ),
) )
@ -2227,7 +2235,11 @@ class ChartWidget extends StatelessWidget {
_lastFormattedValue = formattedValue; _lastFormattedValue = formattedValue;
// print('formattedValueLine - $formattedValue'); // print('formattedValueLine - $formattedValue');
return Text(formattedValue, style: TextStyle(fontSize: 10)); return Text(formattedValue, textAlign: TextAlign.center,
style: TextStyle(
fontSize: 10,
));
} }
return const SizedBox.shrink(); return const SizedBox.shrink();
@ -2374,8 +2386,7 @@ class ChartWidget extends StatelessWidget {
width: 20, width: 20,
// width: barWidth, // width: barWidth,
borderRadius: BorderRadius.zero, borderRadius: BorderRadius.zero,
color: color: Colors.black // This will act as a container for stacked items
Colors.black // This will act as a container for stacked items
), ),
], ],
); );
@ -2636,4 +2647,4 @@ class ChartData {
final String? x; final String? x;
final double y; final double y;
final DateTime? xDateTime; final DateTime? xDateTime;
} }

View File

@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:pocketbase/pocketbase.dart'; import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
@ -11,6 +12,7 @@ import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/uae_numbe
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class BookMark extends ConsumerStatefulWidget { class BookMark extends ConsumerStatefulWidget {
const BookMark({super.key}); const BookMark({super.key});
@ -27,18 +29,20 @@ class _BookMarkState extends ConsumerState<BookMark> {
int selectedTabIndex = 0; int selectedTabIndex = 0;
// Tab categories // Tab categories
final List<String> tabs = [ // final List<String> tabs = [
'All Bookmarks', // 'All Bookmarks',
'Economy', // 'Economy',
'Social', // 'Social',
'Environment', // 'Environment',
]; // ];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
final locale = ref.read(localeProvider); final locale = ref.read(localeProvider);
fetchBookmarks(locale?.languageCode ?? 'en'); fetchBookmarks(locale?.languageCode ?? 'en');
} }
String colorToHex(Color color) { String colorToHex(Color color) {
@ -263,6 +267,18 @@ class _BookMarkState extends ConsumerState<BookMark> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<String> tabs = [
AppLocalizations.of(context)!.all_bookmarks,
AppLocalizations.of(context)!.economy_title,
AppLocalizations.of(context)!.social_title,
AppLocalizations.of(context)!.environment_title,
];
ref.listen<Locale?>(localeProvider, (previous, next) {
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
fetchBookmarks(localeCode);
});
List<Map<String, dynamic>> bookmarks = dataList.where((item) => item['isBookmark'] == true).toList(); List<Map<String, dynamic>> bookmarks = dataList.where((item) => item['isBookmark'] == true).toList();
List<Map<String, dynamic>> filteredBookmarks = dataList List<Map<String, dynamic>> filteredBookmarks = dataList
.where((bookmark) => .where((bookmark) =>
@ -271,7 +287,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
print('filtered $filteredBookmarks'); print('filtered $filteredBookmarks');
return BaseScaffold( return BaseScaffold(
title: Text('Bookmarks'), title: Text(AppLocalizations.of(context)!.bookmarks,),
body: Column( body: Column(
children: [ children: [
TabBarHeader( TabBarHeader(
@ -498,4 +514,4 @@ class TabBarHeader extends StatelessWidget {
), ),
); );
} }
} }

View File

@ -1,7 +1,7 @@
name: uae_stat name: uae_stat
description: "View statistics about the UAE from the Federal Center for Statistics and Competitiveness." description: "View statistics about the UAE from the Federal Center for Statistics and Competitiveness."
publish_to: "none" publish_to: "none"
version: 1.0.25+26 version: 1.0.26+27
environment: environment:
sdk: ">=3.2.3 <4.0.0" sdk: ">=3.2.3 <4.0.0"