Skip to content

Commit

Permalink
Merge branch 'master' into feature/1085-upgrade-gradle-to-8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierPaquet-Rapold authored Nov 15, 2024
2 parents 5e1d4df + 4fc303b commit e1760eb
Show file tree
Hide file tree
Showing 35 changed files with 182 additions and 365 deletions.
25 changes: 13 additions & 12 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ PODS:
- PromisesSwift (~> 2.1)
- FirebaseSharedSwift (11.5.0)
- Flutter (1.0.0)
- flutter_custom_tabs_ios (2.0.0):
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 6.0.3)
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 6.0.3)
- flutter_secure_storage (6.0.0):
- Flutter
- fluttertoast (0.0.2):
Expand Down Expand Up @@ -171,6 +176,7 @@ PODS:
- nanopb/encode (= 3.30910.0)
- nanopb/decode (3.30910.0)
- nanopb/encode (3.30910.0)
- OrderedSet (6.0.3)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -191,9 +197,6 @@ PODS:
- Toast (4.1.1)
- url_launcher_ios (0.0.1):
- Flutter
- webview_flutter_wkwebview (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
Expand All @@ -204,7 +207,7 @@ DEPENDENCIES:
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
- firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`)
- Flutter (from `Flutter`)
- flutter_custom_tabs_ios (from `.symlinks/plugins/flutter_custom_tabs_ios/ios`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
Expand All @@ -216,7 +219,6 @@ DEPENDENCIES:
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- SwiftyXMLParser (from `https://github.com/yahoojapan/SwiftyXMLParser.git`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`)

SPEC REPOS:
trunk:
Expand All @@ -238,6 +240,7 @@ SPEC REPOS:
- GoogleMaps
- GoogleUtilities
- nanopb
- OrderedSet
- PromisesObjC
- PromisesSwift
- Toast
Expand All @@ -259,8 +262,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_remote_config/ios"
Flutter:
:path: Flutter
flutter_custom_tabs_ios:
:path: ".symlinks/plugins/flutter_custom_tabs_ios/ios"
flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
fluttertoast:
Expand All @@ -283,8 +286,6 @@ EXTERNAL SOURCES:
:git: https://github.com/yahoojapan/SwiftyXMLParser.git
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"

CHECKOUT OPTIONS:
SwiftyXMLParser:
Expand Down Expand Up @@ -312,7 +313,7 @@ SPEC CHECKSUMS:
FirebaseSessions: 3f56f177d9e53a85021d16b31f9a111849d1dd8b
FirebaseSharedSwift: 302ac5967857ad7e7388b15382d705b8c8d892aa
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_custom_tabs_ios: a651b18786388923b62de8c0537607de87c2eccf
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
Google-Maps-iOS-Utils: 66d6de12be1ce6d3742a54661e7a79cb317a9321
Expand All @@ -323,6 +324,7 @@ SPEC CHECKSUMS:
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
Expand All @@ -333,7 +335,6 @@ SPEC CHECKSUMS:
SwiftyXMLParser: 027d9e6fb54a38d95dccec025bcea9693f699c47
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4

PODFILE CHECKSUM: 18f1615a0bcd417392c9107b3e8dc59c76a68dac

Expand Down
17 changes: 9 additions & 8 deletions lib/features/app/error/outage/widgets/outage_social_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
import 'package:flutter/material.dart';

// Package imports:
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';

// Project imports:
import 'package:notredame/constants/urls.dart';
import 'package:notredame/utils/utils.dart';
import 'package:notredame/utils/locator.dart';
import 'package:notredame/features/app/integration/launch_url_service.dart';

class OutageSocialSection extends StatelessWidget {
const OutageSocialSection({super.key});
OutageSocialSection({super.key});
final LaunchUrlService _launchUrlService = locator<LaunchUrlService>();

@override
Widget build(BuildContext context) {
Expand All @@ -27,28 +28,28 @@ class OutageSocialSection extends StatelessWidget {
color: Colors.white,
),
onPressed: () =>
Utils.launchURL(Urls.clubWebsite, AppIntl.of(context)!)),
IconButton(
_launchUrlService.launchInBrowser(Urls.clubWebsite)),
IconButton(
icon: const FaIcon(
FontAwesomeIcons.github,
color: Colors.white,
),
onPressed: () =>
Utils.launchURL(Urls.clubGithub, AppIntl.of(context)!)),
_launchUrlService.launchInBrowser(Urls.clubGithub)),
IconButton(
icon: const FaIcon(
Icons.mail_outline,
color: Colors.white,
),
onPressed: () =>
Utils.launchURL(Urls.clubEmail, AppIntl.of(context)!)),
_launchUrlService.writeEmail(Urls.clubEmail, "")),
IconButton(
icon: const FaIcon(
FontAwesomeIcons.discord,
color: Colors.white,
),
onPressed: () =>
Utils.launchURL(Urls.clubDiscord, AppIntl.of(context)!)),
_launchUrlService.launchInBrowser(Urls.clubDiscord))
],
),
],
Expand Down
80 changes: 31 additions & 49 deletions lib/features/app/integration/launch_url_service.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Flutter imports:
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

// Package imports:
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart' as custom_tabs;
import 'package:url_launcher/url_launcher.dart' as url_launch;

// Project imports:
Expand All @@ -12,58 +11,41 @@ import 'package:notredame/utils/locator.dart';

class LaunchUrlService {
final SettingsManager settingsManager = locator<SettingsManager>();
final browser = ChromeSafariBrowser();

Future<bool> canLaunch(String url) async {
final uri = Uri.parse(url);
return url_launch.canLaunchUrl(uri);
Future<void> writeEmail(String emailAddress, String subject) async {
final uri = Uri.parse('mailto:$emailAddress?subject=$subject');
if (await url_launch.canLaunchUrl(uri)) {
url_launch.launchUrl(uri);
} else {
throw 'Could not send email to $emailAddress';
}
}

Future<bool> launch(String url) async {
final uri = Uri.parse(url);
return url_launch.launchUrl(uri);
Future<void> call(String phoneNumber) async {
final uri = Uri.parse('tel:$phoneNumber');
if (await url_launch.canLaunchUrl(uri)) {
url_launch.launchUrl(uri);
} else {
throw 'Could not call $phoneNumber';
}
}

Future<void> launchInBrowser(String url, Brightness brightness) async {
await custom_tabs.launchUrl(
Uri.parse(url),
customTabsOptions: custom_tabs.CustomTabsOptions(
colorSchemes: custom_tabs.CustomTabsColorSchemes.defaults(
toolbarColor: brightness == Brightness.light
? AppTheme.etsLightRed
: AppTheme.etsDarkRed),
shareState: custom_tabs.CustomTabsShareState.off,
urlBarHidingEnabled: true,
showTitle: true,
animations: custom_tabs.CustomTabsSystemAnimations.slideIn(),
browser: const custom_tabs.CustomTabsBrowserConfiguration(
fallbackCustomTabs: <String>[
// ref. https://play.google.com/store/apps/details?id=org.mozilla.firefox
'org.mozilla.firefox',
// https://play.google.com/store/apps/details?id=com.brave.browser
'com.brave.browser',
// https://play.google.com/store/apps/details?id=com.opera.browser
'com.opera.browser',
'com.opera.mini.native',
'com.opera.gx',
// https://play.google.com/store/apps/details?id=com.sec.android.app.sbrowser
'com.sec.android.app.sbrowser',
// ref. https://play.google.com/store/apps/details?id=com.microsoft.emmx
'com.microsoft.emmx',
// https://play.google.com/store/apps/details?id=com.UCMobile.intl
'com.UCMobile.intl',
])),
safariVCOptions: custom_tabs.SafariViewControllerOptions(
preferredBarTintColor: brightness == Brightness.light
? AppTheme.etsLightRed
: AppTheme.etsDarkRed,
preferredControlTintColor: brightness == Brightness.light
? AppTheme.lightThemeBackground
: AppTheme.darkThemeBackground,
barCollapsingEnabled: true,
entersReaderIfAvailable: false,
dismissButtonStyle:
custom_tabs.SafariViewControllerDismissButtonStyle.close,
),
void launchInBrowser(String url) {
browser.open(
url: WebUri(url),
settings: ChromeSafariBrowserSettings(
// Android
dismissButtonStyle: DismissButtonStyle.CLOSE,
enableUrlBarHiding: true,
toolbarBackgroundColor: AppTheme.accent,
navigationBarColor: AppTheme.primaryDark,

// iOS
barCollapsingEnabled: true,
preferredControlTintColor: AppTheme.lightThemeBackground,
preferredBarTintColor: AppTheme.accent,
)
);
}
}
6 changes: 0 additions & 6 deletions lib/features/app/navigation/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import 'package:notredame/features/app/error/outage/outage_view.dart';
import 'package:notredame/features/app/navigation/router_paths.dart';
import 'package:notredame/features/app/signets-api/models/course.dart';
import 'package:notredame/features/app/startup/startup_view.dart';
import 'package:notredame/features/app/widgets/link_web_view.dart';
import 'package:notredame/features/dashboard/dashboard_view.dart';
import 'package:notredame/features/ets/ets_view.dart';
import 'package:notredame/features/ets/events/api-client/models/news.dart';
import 'package:notredame/features/ets/events/author/author_view.dart';
import 'package:notredame/features/ets/events/news/news-details/news_details_view.dart';
import 'package:notredame/features/ets/events/news/news_view.dart';
import 'package:notredame/features/ets/quick-link/models/quick_link.dart';
import 'package:notredame/features/ets/quick-link/quick_links_view.dart';
import 'package:notredame/features/ets/quick-link/widgets/security-info/security_view.dart';
import 'package:notredame/features/more/about/about_view.dart';
Expand Down Expand Up @@ -106,10 +104,6 @@ Route<dynamic> generateRoute(RouteSettings routeSettings) {
pageBuilder: (_, __, ___) => AuthorView(
authorId: routeSettings.arguments! as String,
));
case RouterPaths.webView:
return MaterialPageRoute(
settings: RouteSettings(name: routeSettings.name),
builder: (_) => LinkWebView(routeSettings.arguments! as QuickLink));
case RouterPaths.security:
return MaterialPageRoute(
settings: RouteSettings(name: routeSettings.name),
Expand Down
1 change: 0 additions & 1 deletion lib/features/app/navigation/router_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class RouterPaths {
static const String student = "/student";
static const String gradeDetails = "/student/grade/details";
static const String ets = "/ets";
static const String webView = "/ets/web-view";
static const String security = "/ets/security";
static const String usefulLinks = "/ets/useful-links";
static const String news = "/ets/news";
Expand Down
46 changes: 0 additions & 46 deletions lib/features/app/widgets/link_web_view.dart

This file was deleted.

Loading

0 comments on commit e1760eb

Please sign in to comment.