Skip to content

Commit

Permalink
add feedback and document
Browse files Browse the repository at this point in the history
Signed-off-by: 疯魔慕薇 <[email protected]>
  • Loading branch information
kofj committed Apr 14, 2024
1 parent 3be6541 commit 2582f2a
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 21 deletions.
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ PODS:
- GoogleUtilities/UserDefaults (7.13.0):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- in_app_review (0.2.0):
- Flutter
- nanopb (2.30910.0):
- nanopb/decode (= 2.30910.0)
- nanopb/encode (= 2.30910.0)
Expand Down Expand Up @@ -160,6 +162,7 @@ DEPENDENCIES:
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
- Flutter (from `Flutter`)
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- purchases_flutter (from `.symlinks/plugins/purchases_flutter/ios`)
Expand Down Expand Up @@ -200,6 +203,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_crashlytics/ios"
Flutter:
:path: Flutter
in_app_review:
:path: ".symlinks/plugins/in_app_review/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
Expand Down Expand Up @@ -231,6 +236,7 @@ SPEC CHECKSUMS:
GoogleAppMeasurement: ccefe3eac9b0aa27f96066809fb1a7fe4b462626
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: d053d902a8edaa9904e1bd00c37535385b8ed152
in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
nanopb: 438bc412db1928dac798aa6fd75726007be04262
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
Expand Down
7 changes: 7 additions & 0 deletions lib/common/const.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ final privacyUrl = Uri(
path: "/docs/privacy/",
);

final docUrl = Uri(
scheme: "https",
host: "k8z.dev",
path: "/docs/",
query: "_f=app",
);

final stdeulaUrl = Uri(
scheme: "https",
host: "www.apple.com",
Expand Down
4 changes: 3 additions & 1 deletion lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class MessageLookup extends MessageLookupByLibrary {
"deployments": MessageLookupByLibrary.simpleMessage("Deployments"),
"discovery_and_lb": MessageLookupByLibrary.simpleMessage(
"Discovery and Load Balancing"),
"documents": MessageLookupByLibrary.simpleMessage("Documents"),
"edit": MessageLookupByLibrary.simpleMessage("Edit"),
"empyt_context": MessageLookupByLibrary.simpleMessage(
"can not get cluster kubeconfig, contexts maybe empty"),
Expand All @@ -171,6 +172,7 @@ class MessageLookup extends MessageLookupByLibrary {
"export": MessageLookupByLibrary.simpleMessage("Export"),
"exported": m10,
"external_ip": m11,
"feedback": MessageLookupByLibrary.simpleMessage("Feedback"),
"general": MessageLookupByLibrary.simpleMessage("General"),
"general_debug": MessageLookupByLibrary.simpleMessage("debug"),
"general_debug_sqlview":
Expand Down Expand Up @@ -248,7 +250,6 @@ class MessageLookup extends MessageLookupByLibrary {
"sponsor_desc": MessageLookupByLibrary.simpleMessage(
"Sponsor me so that I can continue to develop and maintain this app."),
"sponsorme": MessageLookupByLibrary.simpleMessage("Sponsor me"),
"sponsors": MessageLookupByLibrary.simpleMessage("Sponsors"),
"stateful_set_text": m32,
"stateful_sets": MessageLookupByLibrary.simpleMessage("StatefulSets"),
"status": MessageLookupByLibrary.simpleMessage("Status"),
Expand All @@ -271,6 +272,7 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Resotre success."),
"subscriptions_yearly": MessageLookupByLibrary.simpleMessage("Yearly"),
"success": MessageLookupByLibrary.simpleMessage("Success"),
"support": MessageLookupByLibrary.simpleMessage("Support"),
"tail_lines": MessageLookupByLibrary.simpleMessage("Tail Lines"),
"terminal": MessageLookupByLibrary.simpleMessage("Terminal"),
"terminals_opened": m36,
Expand Down
4 changes: 3 additions & 1 deletion lib/generated/intl/messages_zh_CN.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
"deployment_text": m7,
"deployments": MessageLookupByLibrary.simpleMessage("Deployments"),
"discovery_and_lb": MessageLookupByLibrary.simpleMessage("服务发现与负载均衡"),
"documents": MessageLookupByLibrary.simpleMessage("文档"),
"edit": MessageLookupByLibrary.simpleMessage("编辑"),
"empyt_context": MessageLookupByLibrary.simpleMessage(
"无法从 kubeconfig 读取集群信息, contexts 字段可能为空"),
Expand All @@ -162,6 +163,7 @@ class MessageLookup extends MessageLookupByLibrary {
"export": MessageLookupByLibrary.simpleMessage("导出"),
"exported": m10,
"external_ip": m11,
"feedback": MessageLookupByLibrary.simpleMessage("反馈"),
"general": MessageLookupByLibrary.simpleMessage("常规"),
"general_debug": MessageLookupByLibrary.simpleMessage("调试"),
"general_debug_sqlview": MessageLookupByLibrary.simpleMessage("sql 视图"),
Expand Down Expand Up @@ -231,7 +233,6 @@ class MessageLookup extends MessageLookupByLibrary {
"sponsor_desc":
MessageLookupByLibrary.simpleMessage("赞助我以便于我可以继续开发维护这款应用程序。"),
"sponsorme": MessageLookupByLibrary.simpleMessage("赞助我"),
"sponsors": MessageLookupByLibrary.simpleMessage("赞助"),
"stateful_set_text": m32,
"stateful_sets": MessageLookupByLibrary.simpleMessage("StatefulSets"),
"status": MessageLookupByLibrary.simpleMessage("状态"),
Expand All @@ -251,6 +252,7 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("恢复成功"),
"subscriptions_yearly": MessageLookupByLibrary.simpleMessage("每年"),
"success": MessageLookupByLibrary.simpleMessage("成功"),
"support": MessageLookupByLibrary.simpleMessage("支持"),
"tail_lines": MessageLookupByLibrary.simpleMessage("尾部行数"),
"terminal": MessageLookupByLibrary.simpleMessage("终端"),
"terminals_opened": m36,
Expand Down
40 changes: 30 additions & 10 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,6 @@
"@eula": {},
"privacy_policy": "Privacy Policy",
"@privacy_policy": {},
"sponsors": "Sponsors",
"@sponsors": {},
"sponsorme": "Sponsor me",
"@sponsorme": {},
"sponsor_desc": "Sponsor me so that I can continue to develop and maintain this app.",
Expand Down Expand Up @@ -525,5 +523,11 @@
"placeholders": {
"error": {}
}
}
},
"support": "Support",
"@support": {},
"feedback": "Feedback",
"@feedback": {},
"documents": "Documents",
"@documents": {}
}
10 changes: 7 additions & 3 deletions lib/l10n/intl_zh_CN.arb
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,6 @@
"@eula": {},
"privacy_policy": "隐私政策",
"@privacy_policy": {},
"sponsors": "赞助",
"@sponsors": {},
"sponsorme": "赞助我",
"@sponsorme": {},
"sponsor_desc": "赞助我以便于我可以继续开发维护这款应用程序。",
Expand Down Expand Up @@ -515,5 +513,11 @@
"placeholders": {
"error": {}
}
}
},
"support": "支持",
"@support": {},
"feedback": "反馈",
"@feedback": {},
"documents": "文档",
"@documents": {}
}
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
import 'package:auto_hyphenating_text/auto_hyphenating_text.dart';
import 'package:in_app_review/in_app_review.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -37,6 +38,12 @@ void main() async {
await initRevenueCatState();
await K8zNative.startLocalServer();

final inAppReview = InAppReview.instance;
if (await inAppReview.isAvailable()) {
talker.info("request review");
inAppReview.requestReview();
}

await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
Expand Down
22 changes: 21 additions & 1 deletion lib/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:k8zdev/common/const.dart';
import 'package:k8zdev/common/ops.dart';
import 'package:k8zdev/dao/dao.dart';
Expand Down Expand Up @@ -212,13 +213,32 @@ class _SettingsPageState extends State<SettingsPage> {
),

SettingsSection(
title: Text(lang.sponsors),
title: Text(lang.support),
tiles: [
// sponsor me
SettingsTile.navigation(
title: Text(lang.sponsorme),
leading: const Icon(Icons.monetization_on_outlined),
onPressed: (context) =>
GoRouter.of(context).pushNamed("appstore"),
),
// feedback
SettingsTile.navigation(
title: Text(lang.feedback),
leading: const Icon(Icons.rate_review_outlined),
onPressed: (context) async {
final inAppReview = InAppReview.instance;
await inAppReview.openStoreListing(appStoreId: "6478047741");
},
),
// docs
SettingsTile.navigation(
title: Text(lang.documents),
leading: const Icon(Icons.help_center_outlined),
onPressed: (context) async {
await launchUrl(docUrl);
},
),
],
),
// debug tool
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import file_selector_macos
import firebase_analytics
import firebase_core
import firebase_crashlytics
import in_app_review
import package_info_plus
import path_provider_foundation
import purchases_flutter
Expand All @@ -25,6 +26,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
PurchasesFlutterPlugin.register(with: registry.registrar(forPlugin: "PurchasesFlutterPlugin"))
Expand Down
6 changes: 6 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ PODS:
- GoogleUtilities/UserDefaults (7.13.0):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- in_app_review (0.2.0):
- FlutterMacOS
- nanopb (2.30910.0):
- nanopb/decode (= 2.30910.0)
- nanopb/encode (= 2.30910.0)
Expand Down Expand Up @@ -165,6 +167,7 @@ DEPENDENCIES:
- firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`)
- firebase_crashlytics (from `Flutter/ephemeral/.symlinks/plugins/firebase_crashlytics/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- in_app_review (from `Flutter/ephemeral/.symlinks/plugins/in_app_review/macos`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- purchases_flutter (from `Flutter/ephemeral/.symlinks/plugins/purchases_flutter/macos`)
Expand Down Expand Up @@ -207,6 +210,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/firebase_crashlytics/macos
FlutterMacOS:
:path: Flutter/ephemeral
in_app_review:
:path: Flutter/ephemeral/.symlinks/plugins/in_app_review/macos
package_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
path_provider_foundation:
Expand Down Expand Up @@ -242,6 +247,7 @@ SPEC CHECKSUMS:
GoogleAppMeasurement: ccefe3eac9b0aa27f96066809fb1a7fe4b462626
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: d053d902a8edaa9904e1bd00c37535385b8ed152
in_app_review: a850789fad746e89bce03d4aeee8078b45a53fd0
nanopb: 438bc412db1928dac798aa6fd75726007be04262
package_info_plus: fa739dd842b393193c5ca93c26798dff6e3d0e0c
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
Expand Down
20 changes: 18 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,22 @@ packages:
url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
version: "4.1.7"
in_app_review:
dependency: "direct main"
description:
name: in_app_review
sha256: "99869244d09adc76af16bf8fd731dd13cef58ecafd5917847589c49f378cbb30"
url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
version: "2.0.9"
in_app_review_platform_interface:
dependency: transitive
description:
name: in_app_review_platform_interface
sha256: fed2c755f2125caa9ae10495a3c163aa7fab5af3585a9c62ef4a6920c5b45f10
url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
version: "2.0.5"
infinite_listview:
dependency: transitive
description:
Expand Down Expand Up @@ -1007,10 +1023,10 @@ packages:
dependency: "direct main"
description:
name: url_launcher
sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e"
sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e"
url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
version: "6.2.5"
version: "6.2.6"
url_launcher_android:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ dependencies:
auto_hyphenating_text: ^0.2.0
json2yaml: ^3.0.1
numberpicker: ^2.1.2
in_app_review: ^2.0.9

dependency_overrides:
meta: 1.11.0
Expand Down

0 comments on commit 2582f2a

Please sign in to comment.