This commit is contained in:
Surendiran 2025-06-13 16:36:30 +05:30
commit 60d9a4f161
8 changed files with 181 additions and 65 deletions

View File

@ -30,11 +30,13 @@
</intent-filter>
<meta-data android:name="flutter_deeplinking_enabled"
android:value="true"/>
<meta-data android:name="com.appsflyer.sdk.ONE_LINK_ID"
android:value="LI5k"/>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="fcsc-a161c.web.app" android:pathPrefix="/"/>
<data android:scheme="https" android:host="fcscapp.onelink.me" />
</intent-filter>
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.VIEW" />-->

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -372,8 +372,8 @@ final GoRouter router = GoRouter(
routes: [
GoRoute(
path: '/',
builder: (context, state) => Competitiveness(),
// builder: (context, state) => SessionCheckScreen(),
// builder: (context, state) => Competitiveness(),
builder: (context, state) => SessionCheckScreen(),
),
// GoRoute(
// path: '/',

View File

@ -1,6 +1,7 @@
import 'dart:io';
// import 'package:firebase_core/firebase_core.dart';
// import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:appsflyer_sdk/appsflyer_sdk.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
@ -165,11 +166,51 @@ void main() async {
// }
// }
class MainApp extends ConsumerWidget {
class MainApp extends ConsumerStatefulWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
ConsumerState<MainApp> createState() => _MainAppState();
}
class _MainAppState extends ConsumerState<MainApp> {
late AppsflyerSdk appsflyerSdk;
@override
void initState() {
super.initState();
appsflyerSdk=AppsflyerSdk(
AppsFlyerOptions(
afDevKey: '7TwqHnPoWcAUuiFGpuCVtF',
appId: 'ae.gov.fcsc.frontend',
showDebug: true,
timeToWaitForATTUserAuthorization: 0,
),
);
appsflyerSdk.initSdk(
registerOnDeepLinkingCallback: true,
);
appsflyerSdk.onDeepLinking((DeepLinkResult result){
final status=result.status;
final deeplinkData =result.deepLink;
if((status==Status.FOUND) && deeplinkData !=null){
final data=deeplinkData.clickEvent;
final deepLinkValue = data['deep_link_sub1']as String?;
}else{
print( "Deeplink status is ${status.toShortString()} OR data is null");
}
});
}
Widget build(BuildContext context) {
final locale = ref.watch(localeProvider);
final connectivityProvider = Provider<bool>((ref) {

View File

@ -15,10 +15,7 @@ class ReportDetailPage extends StatelessWidget {
'التقارير التنافسيه لدولة الامارات',
),
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
)
fontFamily: context.translate('Roboto', 'NotoKufi'),
),
),
showBackButton: true,
@ -27,10 +24,11 @@ class ReportDetailPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Header
Container(
padding: EdgeInsets.all(12),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.grey[100],
color: Colors.grey.shade200,
borderRadius: BorderRadius.circular(12),
),
child: Row(
@ -40,7 +38,7 @@ class ReportDetailPage extends StatelessWidget {
child: Text(
'Prosperity Index (2023)',
style: TextStyle(
fontSize: 14,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
@ -57,7 +55,7 @@ class ReportDetailPage extends StatelessWidget {
const Text(
'The Legatum Prosperity Index is published annually by the Legatum Institute. It is a policy-focused report that measures the current state of prosperity since 2007. Using the Prosperity Index framework, nations around the world can assess their strengths and weaknesses in order to determine the economic and strategic choices that need to be made to further build inclusive societies, open economies, and empowered people to drive greater levels of prosperity.',
style: TextStyle(fontSize: 13),
style: TextStyle(fontSize: 14),
),
const SizedBox(height: 24),
@ -68,7 +66,7 @@ class ReportDetailPage extends StatelessWidget {
_RankingCard(
title: 'Rank in 2023',
value: '44',
icon: const Icon(Icons.arrow_downward, color: Colors.red, size: 25,weight: 50),
icon: const Icon(Icons.arrow_downward, color: Colors.red, size: 25, weight: 50),
),
_RankingCard(
title: 'vs. Previous Edition',
@ -80,22 +78,58 @@ class ReportDetailPage extends StatelessWidget {
const SizedBox(height: 24),
// Country ranking section
_CountryRankingItem(
title: 'First Globally',
country: 'DENMARK',
flagPath: 'assets/country_flags/de.png',
),
const Divider(),
_CountryRankingItem(
title: 'First in Oman',
country: 'Oman',
flagPath: 'assets/country_flags/fk.png',
),
const Divider(),
_CountryRankingItem(
title: 'First in Arab Countries',
country: 'UNITED ARAB EMIRATES',
flagPath: 'assets/country_flags/ga.png',
Container(
decoration: BoxDecoration(
color: const Color(0xFFF5F5F5),
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.symmetric(vertical: 8),
child: Column(
children: [
_CountryRankingItem(
title: 'First Globally',
country: 'DENMARK',
flagPath: 'assets/country_flags/de.png',
),
const Divider(),
_CountryRankingItem(
title: 'First in GCC',
country: 'MULTIPLE COUNTRIES',
flagPath: 'assets/competitiveness/multi-frame.jpg',
onTap: () => showDialog(
context: context,
builder: (context) => Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_CountryItem(name: 'Argentina', flag: 'assets/country_flags/ar.png'),
_CountryItem(name: 'Bahrain', flag: 'assets/country_flags/ba.png'),
_CountryItem(name: 'Denmark', flag: 'assets/country_flags/de.png'),
_CountryItem(name: 'Finland', flag: 'assets/country_flags/fi.png'),
_CountryItem(name: 'Oman', flag: 'assets/country_flags/am.png'),
_CountryItem(name: 'Singapore', flag: 'assets/country_flags/si.png'),
_CountryItem(name: 'Saudi Arabia', flag: 'assets/country_flags/sa.png'),
],
),
),
),
),
),
const Divider(),
_CountryRankingItem(
title: 'First in Arab Countries',
country: 'UNITED ARAB EMIRATES',
flagPath: 'assets/country_flags/ga.png',
),
],
),
),
],
),
@ -103,6 +137,7 @@ class ReportDetailPage extends StatelessWidget {
);
}
}
class _RankingCard extends StatelessWidget {
final String title;
final String value;
@ -151,57 +186,86 @@ class _RankingCard extends StatelessWidget {
);
}
}
class _CountryRankingItem extends StatelessWidget {
class _CountryRankingItem extends StatelessWidget {
final String title;
final String country;
final String flagPath;
final VoidCallback? onTap;
const _CountryRankingItem({
required this.title,
required this.country,
required this.flagPath,
this.onTap,
});
@override
Widget build(BuildContext context) {
return Container(
color: Colors.grey[100],
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(fontSize: 14, color: Colors.black54),
),
const SizedBox(height: 4),
Text(
country,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
return GestureDetector(
onTap: onTap,
child: Container(
color: const Color(0xFFF5F5F5),
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(fontSize: 14, color: Colors.black54),
),
),
],
),
),
const SizedBox(width: 16),
ClipOval(
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
const SizedBox(height: 4),
Text(
country,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
child: Image.asset(flagPath, width: 50, height: 50, fit: BoxFit.cover),
),
const SizedBox(width: 16),
ClipOval(
child: Container(
width: 50,
height: 50,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
),
child: Image.asset(flagPath, width: 50, height: 50, fit: BoxFit.cover),
),
),
],
),
),
);
}
}
class _CountryItem extends StatelessWidget {
final String name;
final String flag;
const _CountryItem({required this.name, required this.flag});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
children: [
ClipOval(
child: Image.asset(flag, width: 40, height: 40, fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) => const Icon(Icons.flag),),
),
const SizedBox(width: 12),
Text(name),
],
),
);

View File

@ -2234,7 +2234,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
try {
final String currentRoute = GoRouterState.of(context).uri.toString();
final String baseAppLink = 'https://fcsc-a161c.web.app';
final String baseAppLink = 'https://fcscapp.onelink.me';
final String shareLink = '$baseAppLink$currentRoute';
final String shareText = 'Check this out!\n\n$shareLink';
print('Generated Share Link: $shareLink');

View File

@ -89,6 +89,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.1"
appsflyer_sdk:
dependency: "direct main"
description:
name: appsflyer_sdk
sha256: "21de475f77a827dc063cbe2e76d058a4ac49838513ca78753e630cf568eb7254"
url: "https://pub.dev"
source: hosted
version: "6.16.2"
archive:
dependency: transitive
description:

View File

@ -75,6 +75,7 @@ dependencies:
device_info_plus: ^11.4.0
android_intent_plus: ^5.3.0
app_settings: ^6.1.1
appsflyer_sdk: ^6.16.2
dependency_overrides:
fading_edge_scrollview: ^4.1.1