Skip to content

Commit

Permalink
update:v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
paizi committed Jun 10, 2022
1 parent 426cbd2 commit 06f5356
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 125 deletions.
17 changes: 12 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="毛玉线圈物语"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package com.blingwang.kedama

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
18 changes: 6 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.7.0'
repositories {
//google()
//jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
//google()
//jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
google()
mavenCentral()
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4096M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
Binary file modified images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 77 additions & 25 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show debugPaintSizeEnabled;
import 'package:flutter/services.dart';
Expand All @@ -13,7 +13,6 @@ void main() {
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
final ThemeData theme = ThemeData();
Expand Down Expand Up @@ -58,6 +57,13 @@ selectView(IconData icon, String text, String id) {
}

class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
super.initState();
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}
// Enable hybrid composition

var _scaffoldkey = new GlobalKey<ScaffoldState>();
DateTime lastPopTime = DateTime.now();
WebViewController _controller;
Expand Down Expand Up @@ -134,7 +140,7 @@ class _MyHomePageState extends State<MyHomePage> {
],
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');
Expand All @@ -150,14 +156,16 @@ class _MyHomePageState extends State<MyHomePage> {
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;
});
Expand Down Expand Up @@ -185,7 +193,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
onTap: () {
Navigator.of(context).pop();
_controller.loadUrl('https://bbs.craft.moe');
_controller.loadUrl('https://forum.craft.moe');
},
),
ListTile(
Expand All @@ -201,6 +209,42 @@ class _MyHomePageState extends State<MyHomePage> {
.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),
Expand Down Expand Up @@ -255,12 +299,12 @@ class _MyHomePageState extends State<MyHomePage> {

Widget buildDrawer(BuildContext context) {
return new Container(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.onBackground,
child: ListView(
children: <Widget>[
new Image.asset(
'images/banner.png',
height: 170,
height: 200,
fit: BoxFit.cover,
),
new Container(
Expand Down Expand Up @@ -612,7 +656,7 @@ class AboutScreen extends StatelessWidget {
height: 430,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
child: Column(children: <Widget>[
SizedBox(height: 20),
SizedBox(height: 10),
Text(
'\n请问你们看见我们家的蓝瓜了吗?\n他非常可爱,简直就是小天使\n',
style: TextStyle(
Expand Down Expand Up @@ -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: <Widget>[
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) {
Expand Down Expand Up @@ -673,20 +717,28 @@ class AboutScreen extends StatelessWidget {
fontSize: 16.0);
},
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(children: <TextSpan>[
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),
),
])))),
]),
),
]))
Expand Down
Loading

0 comments on commit 06f5356

Please sign in to comment.