diff --git a/.firebaserc b/.firebaserc index 8c804c3e..f4483484 100644 --- a/.firebaserc +++ b/.firebaserc @@ -1,5 +1,5 @@ { "projects": { - "default": "uae-stats-demo" + "default": "fcsc-da580" } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6c6699ac..4e74a35d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -26,6 +26,24 @@ + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/java/ae/gov/fcsc/frontend/MainActivity.java b/android/app/src/main/java/ae/gov/fcsc/frontend/MainActivity.java new file mode 100644 index 00000000..f4c43bb3 --- /dev/null +++ b/android/app/src/main/java/ae/gov/fcsc/frontend/MainActivity.java @@ -0,0 +1,6 @@ +package ae.gov.fcsc.frontend; + +import io.flutter.embedding.android.FlutterActivity; + +public class MainActivity extends FlutterActivity { +} diff --git a/android/app/src/main/kotlin/ae/gov/fcsc/frontend/MainActivity.kt b/android/app/src/main/kotlin/ae/gov/fcsc/frontend/MainActivity.kt deleted file mode 100644 index 09aad86f..00000000 --- a/android/app/src/main/kotlin/ae/gov/fcsc/frontend/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package ae.gov.fcsc.frontend - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() diff --git a/firebase.json b/firebase.json index 08b57089..ebf22e80 100644 --- a/firebase.json +++ b/firebase.json @@ -1,18 +1,6 @@ { - "flutter": { - "platforms": { - "dart": { - "lib/firebase_options.dart": { - "projectId": "uae-stats-demo", - "configurations": { - "web": "1:225888316715:web:b96ad37877684cd2dd296e" - } - } - } - } - }, "hosting": { - "public": "build/web", + "public": "p", "ignore": [ "firebase.json", "**/.*", diff --git a/lib/presentation/Screens/charts/screens/chart_screen.dart b/lib/presentation/Screens/charts/screens/chart_screen.dart index 22f1e054..e98179f5 100644 --- a/lib/presentation/Screens/charts/screens/chart_screen.dart +++ b/lib/presentation/Screens/charts/screens/chart_screen.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:go_router/go_router.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:pocketbase/pocketbase.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; @@ -17,6 +18,11 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/Screens/app_tour/Target_content.dart'; import '../filters/search_filter_helper.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:share_plus/share_plus.dart'; +import 'package:path_provider/path_provider.dart'; +import 'dart:io'; class ChartScreen1 extends ConsumerStatefulWidget { final String dataSets; @@ -147,17 +153,17 @@ class _ChartScreen1State extends ConsumerState { }); // ToastUtil.showSuccessToast("Added to Bookmark."); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - AppLocalizations.of(context)!.added_to_Bookmark, - style: TextStyle( - color: Color(0xFF2F692C), fontWeight: FontWeight.w600), - ), - backgroundColor: Color(0xFFD6E9C6), - duration: Duration(seconds: 2), - ), - ); + // ScaffoldMessenger.of(context).showSnackBar( + // SnackBar( + // content: Text( + // AppLocalizations.of(context)!.added_to_Bookmark, + // style: TextStyle( + // color: Color(0xFF2F692C), fontWeight: FontWeight.w600), + // ), + // backgroundColor: Color(0xFFD6E9C6), + // duration: Duration(seconds: 2), + // ), + // ); print("Bookmark added: ${response.id}"); } catch (e) { @@ -225,90 +231,90 @@ class _ChartScreen1State extends ConsumerState { } /// Show confirmation dialog before removing bookmark - void showRemoveBookmarkDialog() { - double myheight = MediaQuery.of(context).size.height; - showDialog( - context: context, - barrierDismissible: false, // User must tap button to dismiss dialog - builder: (context) => AlertDialog( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), // Rounded corners - ), - contentPadding: EdgeInsets.zero, - content: Stack( - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox( - height: myheight / 30, - ), - Text( - context.translate( - 'Are you sure you want to remove this bookmark?', - 'هل أنت متأكد أنك تريد إزالة هذه الإشارة المرجعية؟'), - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18, - color: Color(0xFF898C81), - ), - ) - ], - ), - ), - ], - ), - 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 - ), - ), - 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), - ), - ), - ), - ], - ), - ); - } + // void showRemoveBookmarkDialog() { + // double myheight = MediaQuery.of(context).size.height; + // showDialog( + // context: context, + // barrierDismissible: false, // User must tap button to dismiss dialog + // builder: (context) => AlertDialog( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(5.0), // Rounded corners + // ), + // contentPadding: EdgeInsets.zero, + // content: Stack( + // children: [ + // Padding( + // padding: const EdgeInsets.all(10.0), + // child: Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // SizedBox( + // height: myheight / 30, + // ), + // Text( + // context.translate( + // 'Are you sure you want to remove this bookmark?', + // 'هل أنت متأكد أنك تريد إزالة هذه الإشارة المرجعية؟'), + // textAlign: TextAlign.center, + // style: TextStyle( + // fontSize: 18, + // color: Color(0xFF898C81), + // ), + // ) + // ], + // ), + // ), + // ], + // ), + // 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 + // ), + // ), + // 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), + // ), + // ), + // ), + // ], + // ), + // ); + // } //when the popup need for bookmark // void showAddBookmarkDialog() { // double myheight = MediaQuery.of(context).size.height; @@ -400,9 +406,24 @@ class _ChartScreen1State extends ConsumerState { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - 'The bookmark is added successfully', + 'Added to Bookmark', + style: TextStyle(color: Colors.white, fontSize: 14), ), - backgroundColor: Colors.green, + backgroundColor: Colors.black, // Match the dark background + duration: Duration(seconds: 2), + ), + ); + } + + void showRemoveBookmarkDialog() { + removeBookmark(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + 'Removed from BookMark', + style: TextStyle(color: Colors.white, fontSize: 14), + ), + backgroundColor: Colors.black, // Match the dark background duration: Duration(seconds: 2), ), ); @@ -2052,7 +2073,7 @@ class _ChartScreen1State extends ConsumerState { GestureDetector( onTap: () { if (isBookmarked) { - showRemoveBookmarkDialog(); + showRemoveBookmarkDialog(); } else { showAddBookmarkDialog(); } @@ -2127,14 +2148,39 @@ class _ChartScreen1State extends ConsumerState { // width: 24, // height: 24, // ), + GestureDetector( + onTap: () async { + try { + final svgAssetPath = 'assets/images/sample.svg'; // Update with your actual path + final directory = await getTemporaryDirectory(); + final file = File('${directory.path}/shared_image.svg'); + + // Load the SVG asset and write to the temp file + final svgData = await DefaultAssetBundle.of(context).loadString(svgAssetPath); + await file.writeAsString(svgData); + + // Share the file + await Share.shareXFiles([XFile(file.path)], text: "Check this out!"); + } catch (e) { + print("Error sharing file: $e"); + } + }, + child: SvgPicture.asset( + UaeNumbersAssetPath.share, + semanticsLabel: 'share', + width: 24, + height: 24, + ), + ) - SvgPicture.asset( - UaeNumbersAssetPath.share, - semanticsLabel: 'share', - width: 24, - height: 24, - ), + + // SvgPicture.asset( + // UaeNumbersAssetPath.share, + // semanticsLabel: 'share', + // width: 24, + // height: 24, + // ), ], ) ], diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart index cf44f52a..5fac90a9 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart @@ -109,17 +109,17 @@ class _BookMarkState extends ConsumerState { '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), - ), - ); + // 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."); @@ -329,9 +329,9 @@ class _BookMarkState extends ConsumerState { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - 'The bookmark is removed successfully', + 'Removed from BookMark', ), - backgroundColor: Colors.green, + backgroundColor: Colors.black, duration: Duration(seconds: 2), ), ); diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index 6f0a366c..52ade75c 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -799,23 +799,53 @@ class _BaseScaffoldState extends ConsumerState { SizedBox( width: mywidth / 20, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Text(userId ?? 'Loading user...'), // Display userId here - // Text('Mohammad@fcsc.com') - if (userId == "guest") ...[ - Text(userName ?? 'Guest User'), - ] else ...[ - Text(userName ?? 'Loading...'), - Text( - userEmail ?? 'Loading...', - style: TextStyle(fontSize: 12), - // maxLines: 2, // Allow the text to wrap to the next line - overflow: TextOverflow.ellipsis, - ), - ] - ], + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // // Text(userId ?? 'Loading user...'), // Display userId here + // // Text('Mohammad@fcsc.com') + // if (userId == "guest") ...[ + // Text(userName ?? 'Guest User'), + // ] else ...[ + // Text(userName ?? 'Loading...'), + // Tooltip( + // message: userEmail ?? 'Loading...', + // child: Text( + // userEmail ?? 'Loading...', + // style: TextStyle(fontSize: 12), + // softWrap: true, + // maxLines: 1, + // overflow: TextOverflow.ellipsis, + // ), + // ), + // + // ] + // ], + // ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (userId == "guest") ...[ + Text(userName ?? 'Guest User'), + ] else ...[ + Text(userName ?? 'Loading...'), + Tooltip( + message: userEmail ?? 'Loading...', // Shows full email on hover + child: SizedBox( + width: MediaQuery.of(context).size.width * 0.6, // Adjust width as needed + child: Text( + userEmail ?? 'Loading...', + style: TextStyle(fontSize: 12), + // softWrap: true, + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + ), + ], + ], + ), ), ], ), diff --git a/p/404.html b/p/404.html new file mode 100644 index 00000000..829eda8f --- /dev/null +++ b/p/404.html @@ -0,0 +1,33 @@ + + + + + + Page Not Found + + + + +
+

404

+

Page Not Found

+

The specified file was not found on this website. Please check the URL for mistakes and try again.

+

Why am I seeing this?

+

This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html file in your project's configured public directory.

+
+ + diff --git a/p/index.html b/p/index.html new file mode 100644 index 00000000..c78755d8 --- /dev/null +++ b/p/index.html @@ -0,0 +1,89 @@ + + + + + + Welcome to Firebase Hosting + + + + + + + + + + + + + + + + + + + +
+

Welcome

+

Firebase Hosting Setup Complete

+

You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!

+ Open Hosting Documentation +
+

Firebase SDK Loading…

+ + + + diff --git a/public/.well-known/assetlinks.json b/public/.well-known/assetlinks.json new file mode 100644 index 00000000..af8eb41b --- /dev/null +++ b/public/.well-known/assetlinks.json @@ -0,0 +1,12 @@ +[ + { + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "ae.gov.fcsc.frontend", + "sha256_cert_fingerprints": [ + "3D:BB:9E:B6:3E:80:50:6F:52:EB:73:B8:AD:F9:5F:5A:0A:05:BE:E4:CA:D1:AF:F7:26:2C:56:3F:35:1D:4E:81" + ] + } + } +]