diff --git a/Makefile b/Makefile index 5a09cedb2..bab6b2e73 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ internalsdk/protos/vpn.pb.go: protos_shared/vpn.proto routes: lib/core/router/router.gr.dart lib/core/router/router.gr.dart: $(shell find lib -name \*.dart -print) - @flutter packages pub run build_runner build --delete-conflicting-outputs + @dart run build_runner build --delete-conflicting-outputs test: @flutter test diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f8f0010eb..7b5e6b360 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,11 +1,12 @@ + package="org.getlantern.lantern" + android:installLocation="auto"> + - - + + @@ -27,76 +28,88 @@ android:label="Request for sending mobiamobroadcast to Mobiamo" android:protectionLevel="signature" /> - + + tools:replace="allowBackup, label" + > + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/LaunchTheme" /> - - + + + + + + + + + + + + + - + android:stopWithTask="false"/> - + - + - + - + android:screenOrientation="portrait"> - + android:noHistory="true" + android:screenOrientation="portrait"/> + android:screenOrientation="portrait" /> - - + - @@ -125,17 +140,21 @@ - - - - - - - - + + + + + + + + - - + + @@ -145,6 +164,6 @@ + android:value="ca-app-pub-2685698271254859~9283700921" /> diff --git a/lib/account/report_issue.dart b/lib/account/report_issue.dart index d278ff650..cf465ffa8 100644 --- a/lib/account/report_issue.dart +++ b/lib/account/report_issue.dart @@ -6,9 +6,9 @@ import 'package:lantern/common/ui/app_loading_dialog.dart'; @RoutePage(name: 'ReportIssue') class ReportIssue extends StatefulWidget { - ReportIssue({ - Key? key, - }) : super(key: key); + final String? description; + + const ReportIssue({Key? key, this.description}) : super(key: key); @override State createState() => _ReportIssueState(); @@ -40,6 +40,7 @@ class _ReportIssueState extends State { final descFieldKey = GlobalKey(); late final descController = CustomTextEditingController( + text: widget.description ?? '', formKey: descFieldKey, validator: (value) { if (value!.isEmpty) { diff --git a/lib/app.dart b/lib/app.dart index 937b5b043..6334c1793 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -113,8 +113,9 @@ class LanternApp extends StatelessWidget { GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], - routeInformationParser: globalRouter.defaultRouteParser(), - routerDelegate: globalRouter.delegate(), + routerConfig: globalRouter.config( + deepLinkBuilder: navigateToDeepLink, + ), supportedLocales: const [ Locale('ar', 'EG'), Locale('fr', 'FR'), @@ -140,6 +141,23 @@ class LanternApp extends StatelessWidget { ); } + DeepLink navigateToDeepLink(PlatformDeepLink deepLink) { + logger.d("DeepLink configuration: ${deepLink.configuration.toString()}"); + if (deepLink.path.toLowerCase().startsWith('/report-issue')) { + logger.d("DeepLink uri: ${deepLink.uri.toString()}"); + final pathUrl = deepLink.uri.toString(); + final segment = pathUrl.split('#'); + //If deeplink doesn't have data it should send to report issue with empty description' + if (segment.length >= 2) { + final description = segment[1]; + return DeepLink([const Home(), ReportIssue(description: '#$description')]); + } + return DeepLink([const Home(), ReportIssue()]); + } else { + return DeepLink.defaultPath; + } + } + Locale currentLocale(String lang) { if (lang == '' || lang.startsWith('en')) { return const Locale('en', 'US'); diff --git a/lib/core/router/router.gr.dart b/lib/core/router/router.gr.dart index 6d078f41d..427bd68ca 100644 --- a/lib/core/router/router.gr.dart +++ b/lib/core/router/router.gr.dart @@ -11,7 +11,6 @@ import 'dart:io' as _i46; import 'package:auto_route/auto_route.dart' as _i42; -import 'package:flutter/cupertino.dart' as _i47; import 'package:lantern/account/account.dart' as _i2; import 'package:lantern/account/account_management.dart' as _i1; import 'package:lantern/account/blocked_users.dart' as _i9; @@ -374,7 +373,10 @@ abstract class $AppRouter extends _i42.RootStackRouter { orElse: () => const ReportIssueArgs()); return _i42.AutoRoutePage( routeData: routeData, - child: _i36.ReportIssue(key: args.key), + child: _i36.ReportIssue( + key: args.key, + description: args.description, + ), ); }, ResellerCodeCheckout.name: (routeData) { @@ -396,11 +398,9 @@ abstract class $AppRouter extends _i42.RootStackRouter { ); }, SplitTunneling.name: (routeData) { - final args = routeData.argsAs( - orElse: () => const SplitTunnelingArgs()); return _i42.AutoRoutePage( routeData: routeData, - child: _i39.SplitTunneling(key: args.key), + child: const _i39.SplitTunneling(), ); }, StripeCheckout.name: (routeData) { @@ -1498,10 +1498,14 @@ class ReplicaVideoViewerArgs { class ReportIssue extends _i42.PageRouteInfo { ReportIssue({ _i44.Key? key, + String? description, List<_i42.PageRouteInfo>? children, }) : super( ReportIssue.name, - args: ReportIssueArgs(key: key), + args: ReportIssueArgs( + key: key, + description: description, + ), initialChildren: children, ); @@ -1512,13 +1516,18 @@ class ReportIssue extends _i42.PageRouteInfo { } class ReportIssueArgs { - const ReportIssueArgs({this.key}); + const ReportIssueArgs({ + this.key, + this.description, + }); final _i44.Key? key; + final String? description; + @override String toString() { - return 'ReportIssueArgs{key: $key}'; + return 'ReportIssueArgs{key: $key, description: $description}'; } } @@ -1592,31 +1601,16 @@ class SettingsArgs { /// generated route for /// [_i39.SplitTunneling] -class SplitTunneling extends _i42.PageRouteInfo { - SplitTunneling({ - _i47.Key? key, - List<_i42.PageRouteInfo>? children, - }) : super( +class SplitTunneling extends _i42.PageRouteInfo { + const SplitTunneling({List<_i42.PageRouteInfo>? children}) + : super( SplitTunneling.name, - args: SplitTunnelingArgs(key: key), initialChildren: children, ); static const String name = 'SplitTunneling'; - static const _i42.PageInfo page = - _i42.PageInfo(name); -} - -class SplitTunnelingArgs { - const SplitTunnelingArgs({this.key}); - - final _i47.Key? key; - - @override - String toString() { - return 'SplitTunnelingArgs{key: $key}'; - } + static const _i42.PageInfo page = _i42.PageInfo(name); } /// generated route for diff --git a/pubspec.yaml b/pubspec.yaml index a7fb9fe0a..8ab9560f6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,7 +41,7 @@ dependencies: flutter_switch: ^0.3.2 flag: ^7.0.0 - #Loogs and crash reporting + #Loogs and crash reporting catcher_2: ^1.0.0 sentry_flutter: ^7.16.1 @@ -162,8 +162,8 @@ flutter: # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true -# module: -# androidX: true + # module: + # androidX: true # To add assets to your application, add an assets section, like this: assets: