添加打开绘本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,
bottom: 10.h,
child: GestureDetector(
onTap: () {},
onTap: () async {
await VersionUtils.openApp('treetale');
},
child: buildMainApp(
'绘本创作',
Images.homeMainAppPictureBook,
@ -731,7 +733,8 @@ class HomeView extends GetView<HomeController> {
}
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(
onTap: () {
if (controller.availableApp.value) {}

View File

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

View File

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

View File

@ -1,6 +1,8 @@
import 'dart:io';
import 'dart:math';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
class VersionUtils {
static const MethodChannel _kChannel = MethodChannel('version');
@ -36,4 +38,9 @@ class VersionUtils {
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
dio: ^5.3.4
scroll_date_picker: ^3.7.3
url_launcher: ^6.2.1
flutter:
sdk: flutter
flutter_localizations: