From dd530fdf93a32c9f6f9bc2a22f21f50e2ed26459 Mon Sep 17 00:00:00 2001 From: debuggerx Date: Fri, 21 Jan 2022 17:42:05 +0800 Subject: [PATCH] feat: add manual and changelog url. --- api/lib/apis.dart | 11 ++++++++--- app/lib/widgets/help_button.dart | 9 ++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/api/lib/apis.dart b/api/lib/apis.dart index 63a3aa2..8016d68 100644 --- a/api/lib/apis.dart +++ b/api/lib/apis.dart @@ -3,7 +3,10 @@ class Apis { static const apiHost = 'home.debuggerx.com'; static const apiPort = 30000; - static const appNewVersionUrl = 'https://www.debuggerx.com'; + static const appNewVersionUrl = 'https://www.debuggerx.com/2022/01/21/dgm-changelog?from=app'; + + static appManualUrl(bool isWeb) => + 'https://www.debuggerx.com/2022/01/21/dgm-manual?from=app_${isWeb ? 'web' : 'linux'}'; static final system = SystemApis(); static final auth = AuthApis(); @@ -35,11 +38,13 @@ class SchemeApis { String user({required StringParam type}) => [path, 'user', type].joinPath(); - String market({required StringParam type, required IntParam page, required IntParam pageSize}) => [path, 'market', type, page, pageSize].joinPath(); + String market({required StringParam type, required IntParam page, required IntParam pageSize}) => + [path, 'market', type, page, pageSize].joinPath(); String download({required StringParam schemeId}) => [path, 'download', schemeId].joinPath(); - String like({required StringParam schemeId, required StringParam isLike}) => [path, 'like', schemeId, isLike].joinPath(); + String like({required StringParam schemeId, required StringParam isLike}) => + [path, 'like', schemeId, isLike].joinPath(); String get userLikes => [path, 'user-likes'].joinPath(); } diff --git a/app/lib/widgets/help_button.dart b/app/lib/widgets/help_button.dart index 3c6e929..19cefbb 100644 --- a/app/lib/widgets/help_button.dart +++ b/app/lib/widgets/help_button.dart @@ -1,5 +1,8 @@ import 'package:dde_gesture_manager/extensions.dart'; +import 'package:dde_gesture_manager_api/apis.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; class HelpButton extends StatelessWidget { const HelpButton({Key? key}) : super(key: key); @@ -7,7 +10,11 @@ class HelpButton extends StatelessWidget { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () {}, + onTap: () async { + if (await canLaunch(Apis.appManualUrl(kIsWeb))) { + await launch(Apis.appManualUrl(kIsWeb)); + } + }, child: MouseRegion( cursor: SystemMouseCursors.click, child: Tooltip(