diff --git a/android/app/build.gradle b/android/app/build.gradle index 62e6868..f85352b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 31 + compileSdkVersion 33 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -37,15 +37,22 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.blingwang.kedama" minSdkVersion 19 - targetSdkVersion 31 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - ndk { - abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' + ndk { + abiFilters.clear() + } + splits { + abi { + enable true + reset() + include 'arm64-v8a', 'armeabi-v7a', 'x86_64' + universalApk true + } } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0541bc1..2840516 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> { + @override + void initState() { + super.initState(); + if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); + } + // Enable hybrid composition + var _scaffoldkey = new GlobalKey(); DateTime lastPopTime = DateTime.now(); WebViewController _controller; @@ -134,7 +140,7 @@ class _MyHomePageState extends State { ], onSelected: (String value) { if (value == 'feedback') { - _controller.loadUrl('https://bbs.craft.moe/d/521-app/'); + _controller.loadUrl('https://forum.craft.moe/d/521-app/'); } if (value == 'exit') { SystemChannels.platform.invokeMethod('SystemNavigator.pop'); @@ -150,14 +156,16 @@ class _MyHomePageState extends State { body: Builder( builder: (BuildContext context) { return WebView( - initialUrl: 'https://bbs.craft.moe', + initialUrl: 'https://forum.craft.moe', javascriptMode: JavascriptMode.unrestricted, onPageFinished: (url) { - _controller.evaluateJavascript("document.title").then((result) { + _controller + .runJavascriptReturningResult("document.title") + .then((result) { webtitle = result; }); _controller - .evaluateJavascript("window.location.href") + .runJavascriptReturningResult("window.location.href") .then((result) { weburl = result; }); @@ -185,7 +193,7 @@ class _MyHomePageState extends State { ), onTap: () { Navigator.of(context).pop(); - _controller.loadUrl('https://bbs.craft.moe'); + _controller.loadUrl('https://forum.craft.moe'); }, ), ListTile( @@ -201,6 +209,42 @@ class _MyHomePageState extends State { .loadUrl('https://dl.blingwang.cn/static/bbs_search.html'); }, ), + ListTile( + leading: + Icon(Icons.map, color: Theme.of(context).colorScheme.secondary), + title: Text( + '世界地图', + style: TextStyle(color: Theme.of(context).colorScheme.secondary), + ), + onTap: () { + Navigator.of(context).pop(); + _controller.loadUrl('https://3ec5k.csb.app/?world=v5'); + }, + ), + ListTile( + leading: Icon(Icons.location_pin, + color: Theme.of(context).colorScheme.secondary), + title: Text( + '毛线交通向导', + style: TextStyle(color: Theme.of(context).colorScheme.secondary), + ), + onTap: () { + Navigator.of(context).pop(); + _controller.loadUrl('https://map.ououe.com/'); + }, + ), + ListTile( + leading: Icon(Icons.terminal, + color: Theme.of(context).colorScheme.secondary), + title: Text( + '指令大全', + style: TextStyle(color: Theme.of(context).colorScheme.secondary), + ), + onTap: () { + Navigator.of(context).pop(); + _controller.loadUrl('https://www.craft.moe/help'); + }, + ), ListTile( leading: Icon(Icons.local_laundry_service, color: Theme.of(context).colorScheme.secondary), @@ -255,12 +299,12 @@ class _MyHomePageState extends State { Widget buildDrawer(BuildContext context) { return new Container( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.onBackground, child: ListView( children: [ new Image.asset( 'images/banner.png', - height: 170, + height: 200, fit: BoxFit.cover, ), new Container( @@ -612,7 +656,7 @@ class AboutScreen extends StatelessWidget { height: 430, margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0), child: Column(children: [ - SizedBox(height: 20), + SizedBox(height: 10), Text( '\n请问你们看见我们家的蓝瓜了吗?\n他非常可爱,简直就是小天使\n', style: TextStyle( @@ -640,10 +684,10 @@ class AboutScreen extends StatelessWidget { Container( width: 300, height: 80, - margin: EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 50.0), + margin: EdgeInsets.fromLTRB(50.0, 0.0, 0.0, 0.0), child: Row(children: [ Container( - margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 0.0), + margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 0.0), child: Egg( neededNum: 20, onTap: (int tapNum, int neededNum) { @@ -673,20 +717,28 @@ class AboutScreen extends StatelessWidget { fontSize: 16.0); }, child: RichText( + textAlign: TextAlign.center, text: TextSpan(children: [ - TextSpan( - text: '更多精彩,等你发现!\n', - style: TextStyle( - color: - Theme.of(context).colorScheme.secondary, - fontSize: 20.0), - ), - TextSpan( - text: '©2021 blw.moe All rights reserved.\n', - style: TextStyle( - color: Colors.grey, fontSize: 16.0), - ), - ])))), + TextSpan( + text: '更多精彩,等你发现\n', + style: TextStyle( + color: Theme.of(context) + .colorScheme + .secondary, + fontSize: 20.0), + ), + TextSpan( + text: 'Version 1.3.0\n', + style: TextStyle( + color: Colors.grey, fontSize: 16.0), + ), + TextSpan( + text: + '©2022 blw.moe All rights reserved.\n', + style: TextStyle( + color: Colors.grey, fontSize: 16.0), + ), + ])))), ]), ), ])) diff --git a/pubspec.lock b/pubspec.lock index 5221e1c..6e071eb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,79 +5,79 @@ packages: dependency: transitive description: name: archive - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.3.0" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.9.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" crypto: dependency: transitive description: name: crypto - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -87,16 +87,16 @@ packages: dependency: "direct main" description: name: flutter_egg - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" flutter_launcher_icons: dependency: "direct main" description: name: flutter_launcher_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.9.2" + version: "0.9.3" flutter_test: dependency: "direct dev" description: flutter @@ -111,84 +111,91 @@ packages: dependency: "direct main" description: name: fluttertoast - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "8.0.8" + version: "8.0.9" http: dependency: "direct main" description: name: http - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.4" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" image: dependency: transitive description: name: image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.5" + version: "3.2.0" js: dependency: transitive description: name: js - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.1.4" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.2" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" - pedantic: + version: "1.8.1" + petitparser: dependency: transitive description: - name: pedantic - url: "https://pub.flutter-io.cn" + name: petitparser + url: "https://pub.dartlang.org" source: hosted - version: "1.11.1" - petitparser: + version: "5.0.0" + plugin_platform_interface: dependency: transitive description: - name: petitparser - url: "https://pub.flutter-io.cn" + name: plugin_platform_interface + url: "https://pub.dartlang.org" source: hosted - version: "4.3.0" + version: "2.1.2" share: dependency: "direct main" description: name: share - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" sky_engine: @@ -200,79 +207,100 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.9" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" webview_flutter: dependency: "direct main" description: name: webview_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + url: "https://pub.dartlang.org" source: hosted - version: "2.0.14" + version: "2.8.11" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.1" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.1" xml: dependency: transitive description: name: xml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "5.3.0" + version: "6.1.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "3.1.1" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 226b63e..550b621 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Kedama Unoffical APP # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.3 +version: 1.3.0 environment: sdk: ">=2.1.0 <3.0.0" @@ -22,12 +22,12 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.3 + cupertino_icons: ^1.0.5 share: ^2.0.4 - flutter_launcher_icons: ^0.9.2 - webview_flutter: ^2.0.14 - fluttertoast: ^8.0.8 - http: ^0.13.3 + flutter_launcher_icons: ^0.9.3 + webview_flutter: ^3.0.4 + fluttertoast: ^8.0.9 + http: ^0.13.4 flutter_egg: ^1.0.3 dev_dependencies: