From 0dc8049ed8baa924adac91e32c66f58dd14d925c Mon Sep 17 00:00:00 2001 From: tanghong668 <13926187239@163.com> Date: Sat, 2 Dec 2023 16:23:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=BC=80=E7=BB=98?= =?UTF-8?q?=E6=9C=ACApp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app/modules/home/views/home_view.dart | 7 +++++-- lib/app/modules/home/widgets/user_widget.dart | 2 +- lib/app/routes/app_pages.dart | 2 +- lib/app/shared/utils/version_utils.dart | 7 +++++++ pubspec.yaml | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index 4fb908a..a204daf 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -582,7 +582,9 @@ class HomeView extends GetView { 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 { } 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) {} diff --git a/lib/app/modules/home/widgets/user_widget.dart b/lib/app/modules/home/widgets/user_widget.dart index f5b5112..f115532 100644 --- a/lib/app/modules/home/widgets/user_widget.dart +++ b/lib/app/modules/home/widgets/user_widget.dart @@ -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, diff --git a/lib/app/routes/app_pages.dart b/lib/app/routes/app_pages.dart index 8d7c3c9..4b3c230 100644 --- a/lib/app/routes/app_pages.dart +++ b/lib/app/routes/app_pages.dart @@ -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( diff --git a/lib/app/shared/utils/version_utils.dart b/lib/app/shared/utils/version_utils.dart index d979d36..d4d62b7 100644 --- a/lib/app/shared/utils/version_utils.dart +++ b/lib/app/shared/utils/version_utils.dart @@ -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); + } } diff --git a/pubspec.yaml b/pubspec.yaml index 9ea21a8..44507ef 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: