添加打开绘本App

This commit is contained in:
tanghong668 2023-12-02 16:23:00 +08:00
parent b1832f04ff
commit 0dc8049ed8
5 changed files with 15 additions and 4 deletions

View File

@ -582,7 +582,9 @@ class HomeView extends GetView<HomeController> {
left: 316.w, left: 316.w,
bottom: 10.h, bottom: 10.h,
child: GestureDetector( child: GestureDetector(
onTap: () {}, onTap: () async {
await VersionUtils.openApp('treetale');
},
child: buildMainApp( child: buildMainApp(
'绘本创作', '绘本创作',
Images.homeMainAppPictureBook, Images.homeMainAppPictureBook,
@ -731,7 +733,8 @@ class HomeView extends GetView<HomeController> {
} }
Widget exploreAppWidget(ExploreApp app) { Widget exploreAppWidget(ExploreApp app) {
final imageId = 'home/${controller.availableApp.value ? app.icon : app.grayIcon}'; final imageId =
'home/${controller.availableApp.value ? app.icon : app.grayIcon}';
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
if (controller.availableApp.value) {} if (controller.availableApp.value) {}

View File

@ -41,7 +41,7 @@ class UserWidget extends GetView {
}, },
}, },
Container( Container(
padding: REdgeInsets.all(6.0), padding: REdgeInsets.all(5.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -18,7 +18,7 @@ part 'app_routes.dart';
class AppPages { class AppPages {
AppPages._(); AppPages._();
static const INITIAL = Routes.SELECT; static const INITIAL = Routes.WELCOME;
static final routes = [ static final routes = [
GetPage( GetPage(

View File

@ -1,6 +1,8 @@
import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
class VersionUtils { class VersionUtils {
static const MethodChannel _kChannel = MethodChannel('version'); static const MethodChannel _kChannel = MethodChannel('version');
@ -36,4 +38,9 @@ class VersionUtils {
return false; return false;
} }
} }
static Future openApp(String scheme) async {
final Uri launchUri = Uri(scheme: scheme);
await launchUrl(launchUri);
}
} }

View File

@ -34,6 +34,7 @@ dependencies:
package_info_plus: ^5.0.1 package_info_plus: ^5.0.1
dio: ^5.3.4 dio: ^5.3.4
scroll_date_picker: ^3.7.3 scroll_date_picker: ^3.7.3
url_launcher: ^6.2.1
flutter: flutter:
sdk: flutter sdk: flutter
flutter_localizations: flutter_localizations: