chart screen changes
This commit is contained in:
parent
f78d2f2df3
commit
b5d0b38ac7
@ -20,12 +20,12 @@ if (project.hasProperty('google-services.json')) {
|
|||||||
|
|
||||||
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
|
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
|
||||||
if (flutterVersionCode == null) {
|
if (flutterVersionCode == null) {
|
||||||
flutterVersionCode = "31"
|
flutterVersionCode = "32"
|
||||||
}
|
}
|
||||||
|
|
||||||
def flutterVersionName = localProperties.getProperty("flutter.versionName")
|
def flutterVersionName = localProperties.getProperty("flutter.versionName")
|
||||||
if (flutterVersionName == null) {
|
if (flutterVersionName == null) {
|
||||||
flutterVersionName = "1.0.30"
|
flutterVersionName = "1.0.31"
|
||||||
}
|
}
|
||||||
|
|
||||||
def keystorePropertiesFile = rootProject.file("key.properties")
|
def keystorePropertiesFile = rootProject.file("key.properties")
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:app_links/app_links.dart';
|
// import 'package:app_links/app_links.dart';
|
||||||
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/UAE_Numbers/Social/marriages.dart';
|
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/UAE_Numbers/Social/marriages.dart';
|
||||||
import 'package:uae_stat/presentation/routes/auth_routes/login_route.dart';
|
import 'package:uae_stat/presentation/routes/auth_routes/login_route.dart';
|
||||||
import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart';
|
import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart';
|
||||||
@ -30,12 +30,12 @@ class _DeepLinkListenerState extends State<DeepLinkListener> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Also listen for app links (Firebase Hosting links)
|
// Also listen for app links (Firebase Hosting links)
|
||||||
final appLinks = AppLinks();
|
// final appLinks = AppLinks();
|
||||||
appLinks.uriLinkStream.listen((Uri? uri) {
|
// appLinks.uriLinkStream.listen((Uri? uri) {
|
||||||
if (uri != null) {
|
// if (uri != null) {
|
||||||
handleDeepLink(uri);
|
// handleDeepLink(uri);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDeepLink(Uri uri) {
|
void handleDeepLink(Uri uri) {
|
||||||
@ -45,11 +45,14 @@ class _DeepLinkListenerState extends State<DeepLinkListener> {
|
|||||||
final String firstSegment = uri.pathSegments.first;
|
final String firstSegment = uri.pathSegments.first;
|
||||||
|
|
||||||
if (firstSegment == 'marriages') {
|
if (firstSegment == 'marriages') {
|
||||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => Marriages()));
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (context) => Marriages()));
|
||||||
} else if (firstSegment == 'login') {
|
} else if (firstSegment == 'login') {
|
||||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => LoginRoute()));
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (context) => LoginRoute()));
|
||||||
} else if (firstSegment == 'home') {
|
} else if (firstSegment == 'home') {
|
||||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => MyHomePage()));
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (context) => MyHomePage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,8 +104,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
locale = ref.read(localeProvider) ?? const Locale('en');
|
locale = ref.read(localeProvider) ?? const Locale('en');
|
||||||
print('locale-$locale');
|
print('locale-$locale');
|
||||||
|
|
||||||
|
fetchChartData(widget.dataSets, locale?.languageCode ?? 'en', widget.kpi,
|
||||||
fetchChartData(widget.dataSets, locale?.languageCode ?? 'en', widget.kpi, widget.filter_data)
|
widget.filter_data)
|
||||||
.then((_) {
|
.then((_) {
|
||||||
if (_tabsData.isNotEmpty) {
|
if (_tabsData.isNotEmpty) {
|
||||||
// Call onTabSelected for the first tab
|
// Call onTabSelected for the first tab
|
||||||
@ -319,7 +319,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
backgroundColor: Color(0xFFAA8E83), // Set background color
|
backgroundColor: Color(0xFFAA8E83), // Set background color
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0), // Set text color
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0), // Set text color
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -330,7 +331,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -377,7 +377,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [ SizedBox(
|
children: [
|
||||||
|
SizedBox(
|
||||||
width: 100, // Set the desired width
|
width: 100, // Set the desired width
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => Navigator.pop(context),
|
onPressed: () => Navigator.pop(context),
|
||||||
@ -411,7 +412,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
backgroundColor: Color(0xFFAA8E83), // Set background color
|
backgroundColor: Color(0xFFAA8E83), // Set background color
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0), // Set text color
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0), // Set text color
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -419,7 +421,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
style: TextStyle(color: Colors.white, fontSize: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),],
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -1275,8 +1278,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> fetchChartData(String dataSets, locale, kpi, filter_data) async {
|
Future<void> fetchChartData(String dataSets, locale, kpi, filter_data) async {
|
||||||
|
var data =
|
||||||
var data = await apiService.fetchChartData(dataSets, locale ,kpi,filter_data);
|
await apiService.fetchChartData(dataSets, locale, kpi, filter_data);
|
||||||
|
|
||||||
tabFilteredKpi = kpi;
|
tabFilteredKpi = kpi;
|
||||||
print('FETCH KPI- $kpi');
|
print('FETCH KPI- $kpi');
|
||||||
@ -1284,13 +1287,12 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
print('locale1 - $locale');
|
print('locale1 - $locale');
|
||||||
// print('locale11 - $loacleData');
|
// print('locale11 - $loacleData');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Store filter_data if it has a value
|
// Store filter_data if it has a value
|
||||||
if (filter_data != null && filter_data is List && filter_data.isNotEmpty) {
|
if (filter_data != null && filter_data is List && filter_data.isNotEmpty) {
|
||||||
selectedFiltersApi = filter_data.map<Map<String, dynamic>>((entry) {
|
selectedFiltersApi = filter_data.map<Map<String, dynamic>>((entry) {
|
||||||
if (entry is Map<dynamic, dynamic>) {
|
if (entry is Map<dynamic, dynamic>) {
|
||||||
return entry.map<String, dynamic>((key, value) => MapEntry(key.toString(), value));
|
return entry.map<String, dynamic>(
|
||||||
|
(key, value) => MapEntry(key.toString(), value));
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}).toList();
|
}).toList();
|
||||||
@ -1298,8 +1300,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
print('FETVCFILTEr: $selectedFiltersApi');
|
print('FETVCFILTEr: $selectedFiltersApi');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (data.containsKey('filterData')) {
|
if (data.containsKey('filterData')) {
|
||||||
var filterData = data['filterData'];
|
var filterData = data['filterData'];
|
||||||
filterDataSet = filterData.entries
|
filterDataSet = filterData.entries
|
||||||
@ -1340,7 +1340,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
|
|
||||||
void applyFilters(BuildContext context, List filters, List data,
|
void applyFilters(BuildContext context, List filters, List data,
|
||||||
List dataCard, List selectedFilters) {
|
List dataCard, List selectedFilters) {
|
||||||
|
|
||||||
print('applyFilters called');
|
print('applyFilters called');
|
||||||
print('Selected ApplyFilters: $selectedFilters');
|
print('Selected ApplyFilters: $selectedFilters');
|
||||||
|
|
||||||
@ -1361,17 +1360,16 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
.map((filter) {
|
.map((filter) {
|
||||||
return {
|
return {
|
||||||
'filter_key': filter['filter_key'],
|
'filter_key': filter['filter_key'],
|
||||||
'filter_data':filter['filter_data'].map((item)=> item.toString()).toList()
|
'filter_data':
|
||||||
|
filter['filter_data'].map((item) => item.toString()).toList()
|
||||||
};
|
};
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
print('Formatted Filters1: $formattedFilters');
|
print('Formatted Filters1: $formattedFilters');
|
||||||
|
|
||||||
// Convert to JSON format
|
// Convert to JSON format
|
||||||
String selectedFormatFilters = jsonEncode({
|
String selectedFormatFilters =
|
||||||
'kpi': tabWiseKpi,
|
jsonEncode({'kpi': tabWiseKpi, 'filter_data': formattedFilters});
|
||||||
'filter_data': formattedFilters
|
|
||||||
});
|
|
||||||
|
|
||||||
print('Formatted Filters2: $selectedFormatFilters');
|
print('Formatted Filters2: $selectedFormatFilters');
|
||||||
final locale = ref.watch(localeProvider)?.languageCode ?? 'en';
|
final locale = ref.watch(localeProvider)?.languageCode ?? 'en';
|
||||||
@ -1389,7 +1387,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
|
|
||||||
selectedFiltersStorage = List.from(selectedFilters);
|
selectedFiltersStorage = List.from(selectedFilters);
|
||||||
print('selectedFiltersStoraged- $selectedFiltersStorage');
|
print('selectedFiltersStoraged- $selectedFiltersStorage');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyFilters1(BuildContext context, List filters, List data,
|
void applyFilters1(BuildContext context, List filters, List data,
|
||||||
@ -1530,7 +1527,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showRightSideModal(BuildContext context, List filters, List data) {
|
void showRightSideModal(BuildContext context, List filters, List data) {
|
||||||
|
|
||||||
print('selectedFiltersStoraged1- $selectedFiltersStorage');
|
print('selectedFiltersStoraged1- $selectedFiltersStorage');
|
||||||
|
|
||||||
// Initialize selected filters structure from the stored value, if exists
|
// Initialize selected filters structure from the stored value, if exists
|
||||||
@ -1568,7 +1564,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
UaeNumbersAssetPath.filterCharts,
|
UaeNumbersAssetPath.filterCharts,
|
||||||
semanticsLabel: 'Filter',
|
semanticsLabel: 'Filter',
|
||||||
colorFilter:ColorFilter.mode(Color(0xFF8E8E8E),BlendMode.srcIn),
|
colorFilter: ColorFilter.mode(
|
||||||
|
Color(0xFF8E8E8E), BlendMode.srcIn),
|
||||||
width: 25,
|
width: 25,
|
||||||
height: 25,
|
height: 25,
|
||||||
),
|
),
|
||||||
@ -1815,9 +1812,15 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
});
|
});
|
||||||
selectedFiltersStorage.clear();
|
selectedFiltersStorage.clear();
|
||||||
formattedFilters = [];
|
formattedFilters = [];
|
||||||
|
|
||||||
|
final locale =
|
||||||
|
ref.watch(localeProvider)?.languageCode ?? 'en';
|
||||||
|
|
||||||
|
print('locale22- $locale');
|
||||||
|
|
||||||
fetchChartData(
|
fetchChartData(
|
||||||
widget.dataSets,
|
widget.dataSets,
|
||||||
locale.languageCode ?? 'en',
|
locale,
|
||||||
tabWiseKpi, // Ensure you are passing the correct KPI here
|
tabWiseKpi, // Ensure you are passing the correct KPI here
|
||||||
formattedFilters // Pass the formatted filter data here
|
formattedFilters // Pass the formatted filter data here
|
||||||
);
|
);
|
||||||
@ -1920,13 +1923,22 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
.expand((item) => item)
|
.expand((item) => item)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
print("FilteringDAtss START1d - $filterData");
|
print("FilteringDAtss START1d - $filterData");
|
||||||
print('TABId1 - $tabId');
|
print('TABId1 - $tabId');
|
||||||
|
|
||||||
Map<String, int> monthMap = {
|
Map<String, int> monthMap = {
|
||||||
'jan': 1, 'feb': 2, 'mar': 3, 'apr': 4, 'may': 5, 'jun': 6,
|
'jan': 1,
|
||||||
'jul': 7, 'aug': 8, 'sep': 9, 'oct': 10, 'nov': 11, 'dec': 12
|
'feb': 2,
|
||||||
|
'mar': 3,
|
||||||
|
'apr': 4,
|
||||||
|
'may': 5,
|
||||||
|
'jun': 6,
|
||||||
|
'jul': 7,
|
||||||
|
'aug': 8,
|
||||||
|
'sep': 9,
|
||||||
|
'oct': 10,
|
||||||
|
'nov': 11,
|
||||||
|
'dec': 12
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var item in filterData) {
|
for (var item in filterData) {
|
||||||
@ -1941,24 +1953,26 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
int yearB = int.parse(bParts[0]);
|
int yearB = int.parse(bParts[0]);
|
||||||
|
|
||||||
// if (yearA != yearB) return yearA.compareTo(yearB);
|
// if (yearA != yearB) return yearA.compareTo(yearB);
|
||||||
if (yearA != yearB) return yearB.compareTo(yearA); // Sort years in descending order
|
if (yearA != yearB)
|
||||||
|
return yearB.compareTo(yearA); // Sort years in descending order
|
||||||
|
|
||||||
if (aParts.length == 1) return -1; // Year-only comes first
|
if (aParts.length == 1) return -1; // Year-only comes first
|
||||||
if (bParts.length == 1) return 1; // Year-only comes first
|
if (bParts.length == 1) return 1; // Year-only comes first
|
||||||
|
|
||||||
int monthA = int.tryParse(aParts[1]) ?? monthMap[aParts[1].toLowerCase()] ?? 0;
|
int monthA =
|
||||||
int monthB = int.tryParse(bParts[1]) ?? monthMap[bParts[1].toLowerCase()] ?? 0;
|
int.tryParse(aParts[1]) ?? monthMap[aParts[1].toLowerCase()] ?? 0;
|
||||||
|
int monthB =
|
||||||
|
int.tryParse(bParts[1]) ?? monthMap[bParts[1].toLowerCase()] ?? 0;
|
||||||
|
|
||||||
return monthB.compareTo(monthA); // Sort months in descending order within the same year
|
return monthB.compareTo(
|
||||||
|
monthA); // Sort months in descending order within the same year
|
||||||
// return monthA.compareTo(monthB);
|
// return monthA.compareTo(monthB);
|
||||||
});
|
});
|
||||||
|
|
||||||
item['filter_data'] = timePeriods;
|
item['filter_data'] = timePeriods;
|
||||||
}
|
} else if (item['filter_key'] == 'REF_AREA') {
|
||||||
else if (item['filter_key'] == 'REF_AREA') {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Sort alphabetically for all other cases
|
// Sort alphabetically for all other cases
|
||||||
List<String> otherFilters = List<String>.from(item['filter_data']);
|
List<String> otherFilters = List<String>.from(item['filter_data']);
|
||||||
otherFilters.sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
|
otherFilters.sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
|
||||||
@ -1966,8 +1980,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// for (var item in filterData) {
|
// for (var item in filterData) {
|
||||||
// if (item['filter_key'] == 'TIME_PERIOD') {
|
// if (item['filter_key'] == 'TIME_PERIOD') {
|
||||||
// // Convert the values to integers, sort them, and convert back to strings
|
// // Convert the values to integers, sort them, and convert back to strings
|
||||||
@ -1992,7 +2004,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void performActionForTab(String tabId) {
|
void performActionForTab(String tabId) {
|
||||||
|
|
||||||
print('Selected Tab perform: $tabId');
|
print('Selected Tab perform: $tabId');
|
||||||
|
|
||||||
// Filter the chartsData array based on the tabId
|
// Filter the chartsData array based on the tabId
|
||||||
@ -2086,8 +2097,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
final locale = ref.watch(localeProvider);
|
final locale = ref.watch(localeProvider);
|
||||||
final localeNotifier = ref.read(localeProvider.notifier);
|
final localeNotifier = ref.read(localeProvider.notifier);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ref.listen<Locale?>(localeProvider, (previous, next) {
|
ref.listen<Locale?>(localeProvider, (previous, next) {
|
||||||
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
|
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
|
||||||
|
|
||||||
@ -2097,9 +2106,11 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
currentTab = tabWiseKpi;
|
currentTab = tabWiseKpi;
|
||||||
print('Saving currentTab: $currentTab After locale change');
|
print('Saving currentTab: $currentTab After locale change');
|
||||||
|
|
||||||
final List<Map<String, dynamic>> safeFilterData = widget.filter_data ?? [];
|
final List<Map<String, dynamic>> safeFilterData =
|
||||||
|
widget.filter_data ?? [];
|
||||||
final String safeKpi = widget.kpi ?? '';
|
final String safeKpi = widget.kpi ?? '';
|
||||||
fetchChartData(widget.dataSets,localeCode, safeKpi, safeFilterData).then((_) {
|
fetchChartData(widget.dataSets, localeCode, safeKpi, safeFilterData)
|
||||||
|
.then((_) {
|
||||||
print('DEBUG KPI: $safeKpi');
|
print('DEBUG KPI: $safeKpi');
|
||||||
|
|
||||||
print('TAB11: $currentTab');
|
print('TAB11: $currentTab');
|
||||||
@ -2114,8 +2125,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
onTabSelected(_tabsData[0]['id']);
|
onTabSelected(_tabsData[0]['id']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
double myheight = MediaQuery.of(context).size.height;
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
double mywidth = MediaQuery.of(context).size.width;
|
double mywidth = MediaQuery.of(context).size.width;
|
||||||
@ -2321,7 +2330,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => shareCurrentPage(context),
|
onTap: () => shareCurrentPage(context),
|
||||||
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -2341,7 +2349,9 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
)
|
)
|
||||||
],),),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -2450,7 +2460,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
// ),
|
// ),
|
||||||
// nonChartData Cards
|
// nonChartData Cards
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0,left:1.0,right: 1.0),
|
padding: const EdgeInsets.only(
|
||||||
|
top: 8.0, left: 1.0, right: 1.0),
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
List<Widget> rows = [];
|
List<Widget> rows = [];
|
||||||
@ -2535,11 +2546,15 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
: (chartsData[index][
|
: (chartsData[index][
|
||||||
'chart_type'] ==
|
'chart_type'] ==
|
||||||
'bar_chart_horizontal')
|
'bar_chart_horizontal')
|
||||||
? 370 : (chartsData[index][
|
? 370
|
||||||
|
: (chartsData[index][
|
||||||
'chart_type'] ==
|
'chart_type'] ==
|
||||||
'horizontal_rotate')
|
'horizontal_rotate')
|
||||||
? 385
|
? 385
|
||||||
: (chartsData[index]['chart_type'] == 'fl_stacked_bar')
|
: (chartsData[index]
|
||||||
|
[
|
||||||
|
'chart_type'] ==
|
||||||
|
'fl_stacked_bar')
|
||||||
? 390
|
? 390
|
||||||
: 350,
|
: 350,
|
||||||
|
|
||||||
@ -2548,7 +2563,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
chartData:
|
chartData:
|
||||||
chartsData[index],
|
chartsData[index],
|
||||||
bodyColor: bodyColor,
|
bodyColor: bodyColor,
|
||||||
chartHeader:chartHeader),)
|
chartHeader: chartHeader),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -2696,16 +2712,14 @@ class CardWidget extends StatelessWidget {
|
|||||||
|
|
||||||
final bodyColor = Color(
|
final bodyColor = Color(
|
||||||
int.parse(
|
int.parse(
|
||||||
(chartScreenData['border_color'] ?? '#898C81').replaceFirst('#', '0xff'),
|
(chartScreenData['border_color'] ?? '#898C81')
|
||||||
|
.replaceFirst('#', '0xff'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (response.isEmpty) {
|
||||||
if(response.isEmpty)
|
|
||||||
{
|
|
||||||
return SizedBox.shrink();
|
return SizedBox.shrink();
|
||||||
}
|
} else if (response.length == 1) {
|
||||||
else if (response.length == 1) {
|
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.all(10),
|
margin: const EdgeInsets.all(10),
|
||||||
// width: card_full_length ? double.infinity : null,
|
// width: card_full_length ? double.infinity : null,
|
||||||
@ -2868,7 +2882,8 @@ class CardWidget extends StatelessWidget {
|
|||||||
BorderRadius.circular(12), // Ensure border radius is applied
|
BorderRadius.circular(12), // Ensure border radius is applied
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min, // Adjust card height based on content
|
mainAxisSize:
|
||||||
|
MainAxisSize.min, // Adjust card height based on content
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
// const Icon(Icons.public,
|
// const Icon(Icons.public,
|
||||||
@ -2969,7 +2984,6 @@ class CardWidget extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 2, // Height of the divider
|
height: 2, // Height of the divider
|
||||||
width: 100,
|
width: 100,
|
||||||
@ -2979,9 +2993,6 @@ class CardWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment
|
mainAxisAlignment: MainAxisAlignment
|
||||||
.center, // Center-aligns the row contents
|
.center, // Center-aligns the row contents
|
||||||
@ -2996,7 +3007,8 @@ class CardWidget extends StatelessWidget {
|
|||||||
: _getColorFromHex(response[1]['font_color']),
|
: _getColorFromHex(response[1]['font_color']),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center, // Ensure proper alignment
|
textAlign: TextAlign.center, // Ensure proper alignment
|
||||||
overflow: TextOverflow.ellipsis, // Truncate if text overflows
|
overflow:
|
||||||
|
TextOverflow.ellipsis, // Truncate if text overflows
|
||||||
),
|
),
|
||||||
const SizedBox(width: 1), // Space between text and icon
|
const SizedBox(width: 1), // Space between text and icon
|
||||||
if (response[1]['font_color'] != '') ...[
|
if (response[1]['font_color'] != '') ...[
|
||||||
@ -3010,7 +3022,6 @@ class CardWidget extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
// '(${response[1]['display_value'] ?? 'NA'})',
|
// '(${response[1]['display_value'] ?? 'NA'})',
|
||||||
RegExp(r'\d').hasMatch(response[1]['display_value'] ?? '')
|
RegExp(r'\d').hasMatch(response[1]['display_value'] ?? '')
|
||||||
|
|||||||
@ -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.30+31
|
version: 1.0.31+32
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.2.3 <4.0.0"
|
sdk: ">=3.2.3 <4.0.0"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user