-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add "forgot password link" to login view * Move "forgot password" to bottom right of password input * [BOT] Bump version from 4.20.0+1 to 4.21.0+1 * [BOT] Applying format. * SizedBox heights and padding changes * Fix to avoid merge conflict * [BOT] Bump version from 4.21.0+1 to 4.22.0+1 * [BOT] Applying format. * [BOT] Bump version from 4.21.0+1 to 4.22.0+1 * Change url launch method * [BOT] Applying format. * Put launchInBrowser method in service * [BOT] Bump version from 4.21.5+1 to 4.22.0+1 * Put launchInBrowser method in launch_url_service and delete launch_url_in_browser_service * [BOT] Applying format. * Add launchUrlService to WebLinkCardViewModel test * Refactor signets url location * [BOT] Applying format. * Reset work on web_link_card_viewmodel_test * Reset work on web_link_card_viewmodel_test * [BOT] Applying version. * Fix web_link_card_test * Just a TEST ... * Fix another test * Fix test * Use settingsManager.themeMode * [BOT] Applying format. * Fix themeMode * [BOT] Applying format. * [BOT] Applying version. * Brigthness for theme * Remove unused imports * Update lib/core/constants/urls.dart Co-authored-by: Samuel Montambault <[email protected]> * Rename signetsForgottenPassword --------- Co-authored-by: J01716 <[email protected]> Co-authored-by: Samuel Montambault <[email protected]> Co-authored-by: Camille Brulotte <[email protected]> Co-authored-by: camillebrulotte <[email protected]> Co-authored-by: Camille Brulotte <[email protected]> Co-authored-by: Antoine Martineau <[email protected]>
- Loading branch information
1 parent
1472dcc
commit df1f238
Showing
13 changed files
with
127 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,70 @@ | ||
// FLUTTER / DART / THIRD-PARTIES | ||
import 'package:url_launcher/url_launcher.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart' as custom_tabs; | ||
import 'package:url_launcher/url_launcher.dart' as url_launch; | ||
|
||
// Managers | ||
import 'package:notredame/core/managers/settings_manager.dart'; | ||
|
||
// UTILS | ||
import 'package:notredame/ui/utils/app_theme.dart'; | ||
|
||
// OTHER | ||
import 'package:notredame/locator.dart'; | ||
|
||
class LaunchUrlService { | ||
final SettingsManager settingsManager = locator<SettingsManager>(); | ||
|
||
Future<bool> canLaunch(String url) async { | ||
final uri = Uri.parse(url); | ||
return canLaunchUrl(uri); | ||
return url_launch.canLaunchUrl(uri); | ||
} | ||
|
||
Future<bool> launch(String url) async { | ||
final uri = Uri.parse(url); | ||
return launchUrl(uri); | ||
return url_launch.launchUrl(uri); | ||
} | ||
|
||
Future<void> launchInBrowser(String url, Brightness brightness) async { | ||
await custom_tabs.launch( | ||
url, | ||
customTabsOption: custom_tabs.CustomTabsOption( | ||
toolbarColor: brightness == Brightness.light | ||
? AppTheme.etsLightRed | ||
: AppTheme.etsDarkRed, | ||
enableDefaultShare: false, | ||
enableUrlBarHiding: true, | ||
showPageTitle: true, | ||
animation: custom_tabs.CustomTabsSystemAnimation.slideIn(), | ||
extraCustomTabs: const <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', | ||
], | ||
), | ||
safariVCOption: custom_tabs.SafariViewControllerOption( | ||
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, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.