Skip to content

Commit

Permalink
feat(quiz): bloquer le deeplink
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaudon committed Dec 17, 2024
1 parent c35e537 commit 396e240
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 25 deletions.
10 changes: 5 additions & 5 deletions app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="${applicationName}"
android:allowBackup="false"
android:enableOnBackInvokedCallback="true"
android:label="${appName}"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:label="${appName}">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleInstance"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand Down
2 changes: 1 addition & 1 deletion app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version '1.0.0'
id "com.android.application" version '8.7.2' apply false
id "com.android.application" version '8.7.3' apply false
id "org.jetbrains.kotlin.android" version '2.0.21' apply false
}

Expand Down
4 changes: 2 additions & 2 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PODS:
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (8.41.0)
- sentry_flutter (8.11.0):
- sentry_flutter (8.11.1):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 8.41.0)
Expand Down Expand Up @@ -71,7 +71,7 @@ SPEC CHECKSUMS:
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
Sentry: 54d0fe6c0df448497c8ed4cce66ccf7027e1823e
sentry_flutter: 83a84efb7f978522c9127fbc0c07dab09663eecc
sentry_flutter: d8bce6e1d6c4f57d0208e274f745d1eee8bae249
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe

Expand Down
1 change: 1 addition & 0 deletions app/ios/Runner/Runner.development.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:jagis.beta.gouv.fr</string>
<string>webcredentials:jagis.beta.gouv.fr</string>
</array>
</dict>
</plist>
1 change: 1 addition & 0 deletions app/ios/Runner/Runner.production.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:jagis.beta.gouv.fr</string>
<string>webcredentials:jagis.beta.gouv.fr</string>
</array>
</dict>
</plist>
4 changes: 4 additions & 0 deletions app/lib/app/router/app_router.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:app/core/infrastructure/tracker.dart';
import 'package:app/core/presentation/pages/error_route_page.dart';
import 'package:app/features/accueil/presentation/pages/home_page.dart';
import 'package:app/features/actions/detail/presentation/pages/action_detail_page.dart';
import 'package:app/features/actions/list/presentation/pages/action_list_page.dart';
Expand Down Expand Up @@ -87,6 +88,9 @@ GoRouter goRouter({required final Tracker tracker}) => GoRouter(
],
),
],
errorPageBuilder: (final context, final state) => const NoTransitionPage(
child: FnvErrorRoutePage(),
),
redirect: (final context, final state) =>
switch (context.read<AuthenticationBloc>().state) {
AuthenticationInitial() => null,
Expand Down
40 changes: 40 additions & 0 deletions app/lib/core/presentation/pages/error_route_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'package:app/core/assets/svgs.dart';
import 'package:app/core/presentation/widgets/composants/scaffold.dart';
import 'package:app/features/accueil/presentation/pages/home_page.dart';
import 'package:app/l10n/l10n.dart';
import 'package:dsfr/dsfr.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';

class FnvErrorRoutePage extends StatelessWidget {
const FnvErrorRoutePage({super.key});

@override
Widget build(final context) => FnvScaffold(
body: ListView(
padding: MediaQuery.paddingOf(context).copyWith(
left: DsfrSpacings.s2w,
right: DsfrSpacings.s2w,
),
children: [
const Text(
Localisation.erreurRoutePageTitre,
style: DsfrTextStyle.headline3(),
),
SvgPicture.asset(AssetsSvgs.errorIllustration),
const Text(
Localisation.erreurRoutePageDescription,
style: DsfrTextStyle.bodyXl(),
),
const SizedBox(height: DsfrSpacings.s4w),
DsfrButton(
label: Localisation.erreurRoutePageAction,
variant: DsfrButtonVariant.primary,
size: DsfrButtonSize.lg,
onPressed: () => context.go(HomePage.path),
),
],
),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _Mission extends StatelessWidget {
MissionPage.name,
pathParameters: {
'mission': mission.code,
'thematique': mission.themeType.name,
'thematique': mission.themeType.routeCode,
},
);
if (context.mounted) {
Expand Down
7 changes: 7 additions & 0 deletions app/lib/features/theme/core/domain/theme_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,44 @@ import 'package:flutter/material.dart';

enum ThemeType {
alimentation(
routeCode: 'me-nourrir',
displayName: '🥗 Me nourrir',
backgroundColor: Color(0xFFE3FBAF),
foregroundColor: Color(0xFF175202),
),
transport(
routeCode: 'me-deplacer',
displayName: '🚗 Me déplacer',
backgroundColor: Color(0xFFD2E9FF),
foregroundColor: Color(0xFF021952),
),
logement(
routeCode: 'me-loger',
displayName: '🏠 Me loger',
backgroundColor: Color(0xFFFFE2E0),
foregroundColor: Color(0xFF52022E),
),
consommation(
routeCode: 'consommer',
displayName: '👕 Consommer',
backgroundColor: Color(0xFFFFE8D7),
foregroundColor: Color(0xFF522E02),
),
decouverte(
routeCode: 'decouverte',
displayName: 'Découverte',
backgroundColor: Color(0xFFDDEDEA),
foregroundColor: Color(0xFF024452),
);

const ThemeType({
required this.routeCode,
required this.displayName,
required this.backgroundColor,
required this.foregroundColor,
});

final String routeCode;
final String displayName;
String get displayNameWithoutEmoji => removeEmoji(displayName).trim();
final Color backgroundColor;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/features/theme/presentation/pages/theme_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class _Mission extends StatelessWidget {
MissionPage.name,
pathParameters: {
'mission': mission.code,
'thematique': mission.themeType.name,
'thematique': mission.themeType.routeCode,
},
),
child: SizedBox(
Expand Down
4 changes: 4 additions & 0 deletions app/lib/l10n/l10n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ abstract final class Localisation {
static const entre70et100m2 = 'Entre 70 et 100 m²';
static const entrezLeCodeRecuParMail = 'Entrez le code reçu par e-mail !';
static const codeDeVerification = 'Code de vérification';
static const erreurRoutePageTitre = 'Page non trouvée';
static const erreurRoutePageDescription =
'La page est introuvable. Excusez-nous pour la gêne occasionnée.';
static const erreurRoutePageAction = "Page d'accueil";
static const erreurInattendue = 'Erreur inattendue';
static const erreurInattendueContent =
'Désolé, le service rencontre un problème, nous y travaillons pour le résoudre le plus rapidement possible.';
Expand Down
36 changes: 22 additions & 14 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ packages:
dependency: transitive
description:
name: archive
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
sha256: "08064924cbf0ab88280a0c3f60db9dd24fec693927e725ecb176f16c629d1cb8"
url: "https://pub.dev"
source: hosted
version: "3.6.1"
version: "4.0.1"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -273,10 +273,10 @@ packages:
dependency: transitive
description:
name: device_info_plus_platform_interface
sha256: "282d3cf731045a2feb66abfe61bbc40870ae50a3ed10a4d3d217556c35c8c2ba"
sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2"
url: "https://pub.dev"
source: hosted
version: "7.0.1"
version: "7.0.2"
diacritic:
dependency: transitive
description:
Expand Down Expand Up @@ -572,10 +572,10 @@ packages:
dependency: transitive
description:
name: image
sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d
sha256: "20842a5ad1555be624c314b0c0cc0566e8ece412f61e859a42efeb6d4101a26c"
url: "https://pub.dev"
source: hosted
version: "4.3.0"
version: "4.5.0"
intl:
dependency: "direct main"
description:
Expand Down Expand Up @@ -864,6 +864,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.5.1"
posix:
dependency: transitive
description:
name: posix
sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a
url: "https://pub.dev"
source: hosted
version: "6.0.1"
provider:
dependency: transitive
description:
Expand Down Expand Up @@ -932,18 +940,18 @@ packages:
dependency: transitive
description:
name: shared_preferences_android
sha256: "7f172d1b06de5da47b6264c2692ee2ead20bbbc246690427cdb4fc301cd0c549"
sha256: "02a7d8a9ef346c9af715811b01fbd8e27845ad2c41148eefd31321471b41863d"
url: "https://pub.dev"
source: hosted
version: "2.3.4"
version: "2.4.0"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d"
sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"
url: "https://pub.dev"
source: hosted
version: "2.5.3"
version: "2.5.4"
shared_preferences_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -1033,10 +1041,10 @@ packages:
dependency: transitive
description:
name: stream_transform
sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f"
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
Expand Down Expand Up @@ -1209,10 +1217,10 @@ packages:
dependency: transitive
description:
name: watcher
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
web:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/dsfr.dart/example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version '1.0.0'
id "com.android.application" version '8.7.2' apply false
id "com.android.application" version '8.7.3' apply false
id "org.jetbrains.kotlin.android" version '2.0.21' apply false
}

Expand Down

0 comments on commit 396e240

Please sign in to comment.