mirror of
https://github.com/meditohq/medito-app.git
synced 2024-09-11 12:15:46 +03:00
Launch url fix (#612)
* Add requirements * Add iOS requirements * If not launched ope in App WebView * add vibration to explore FAB * Add vibration * Add vibration on FAB * Fix vibration values --------- Co-authored-by: Michael Speed <michaelcspeed@users.noreply.github.com>
This commit is contained in:
parent
e07d4e75ac
commit
afd7a2c248
@ -9,6 +9,7 @@
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
@ -23,6 +24,13 @@
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<data android:mimeType="*/*" />
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<data android:scheme="sms" />
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
|
@ -62,5 +62,11 @@
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>sms</string>
|
||||
<string>tel</string>
|
||||
<string>https</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -65,13 +65,19 @@ Future<void> launchURLInBrowser(String url) async {
|
||||
try {
|
||||
final uri = Uri.parse(url);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(
|
||||
var launched = await launchUrl(
|
||||
uri,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
|
||||
if (!launched) {
|
||||
await launchUrl(
|
||||
uri,
|
||||
mode: LaunchMode.inAppWebView,
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (e, stackTrace) {
|
||||
// Capture the exception using Sentry
|
||||
await Sentry.captureException(
|
||||
e,
|
||||
stackTrace: stackTrace,
|
||||
|
@ -4,6 +4,7 @@ import 'package:Medito/widgets/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:vibration/vibration.dart';
|
||||
import 'widgets/announcement/announcement_widget.dart';
|
||||
import 'widgets/filters/filter_widget.dart';
|
||||
import 'widgets/header/home_header_widget.dart';
|
||||
@ -55,18 +56,38 @@ class _HomeViewState extends ConsumerState<HomeView>
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
backgroundColor: ColorConstants.onyx,
|
||||
onPressed: () {
|
||||
context.push(RouteConstants.search);
|
||||
floatingActionButton: Listener(
|
||||
onPointerDown: (_) async {
|
||||
if (await Vibration.hasVibrator() ?? false) {
|
||||
if ((await Vibration.hasAmplitudeControl()) ?? false) {
|
||||
Vibration.vibrate(amplitude: 20, duration: 30);
|
||||
} else {
|
||||
Vibration.vibrate(duration: 30);
|
||||
}
|
||||
}
|
||||
},
|
||||
icon: Icon(Icons.explore, color: ColorConstants.walterWhite),
|
||||
label: Text(
|
||||
'Explore',
|
||||
style: TextStyle(
|
||||
color: ColorConstants.walterWhite,
|
||||
fontFamily: DmSerif,
|
||||
fontSize: 20,
|
||||
onPointerUp: (_) async {
|
||||
if (await Vibration.hasVibrator() ?? false) {
|
||||
if ((await Vibration.hasAmplitudeControl()) ?? false) {
|
||||
Vibration.vibrate(amplitude: 50, duration: 5);
|
||||
} else {
|
||||
Vibration.vibrate(duration: 5);
|
||||
}
|
||||
}
|
||||
},
|
||||
child: FloatingActionButton.extended(
|
||||
backgroundColor: ColorConstants.onyx,
|
||||
onPressed: () {
|
||||
context.push(RouteConstants.search);
|
||||
},
|
||||
icon: Icon(Icons.explore, color: ColorConstants.walterWhite),
|
||||
label: Text(
|
||||
'Explore',
|
||||
style: TextStyle(
|
||||
color: ColorConstants.walterWhite,
|
||||
fontFamily: DmSerif,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -65,6 +65,7 @@ dependencies:
|
||||
image: ^4.0.17
|
||||
permission_handler: ^10.4.5
|
||||
app_settings: ^5.1.1
|
||||
vibration: ^1.7.3
|
||||
|
||||
dependency_overrides:
|
||||
firebase_core_platform_interface: 4.5.1
|
||||
|
Loading…
Reference in New Issue
Block a user