Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzqs committed Apr 29, 2024
1 parent d13bb57 commit ec07754
Show file tree
Hide file tree
Showing 34 changed files with 420 additions and 149 deletions.
34 changes: 17 additions & 17 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: 135454af32477f815a7525073027a3ff9eff1bfd
channel: stable
revision: "bae5e49bc2a867403c43b2aae2de8f8c33b037e4"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
- platform: android
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
- platform: ios
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
- platform: linux
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
- platform: macos
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
- platform: web
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
- platform: windows
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
create_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4
base_revision: bae5e49bc2a867403c43b2aae2de8f8c33b037e4

# User provided section

Expand Down
28 changes: 12 additions & 16 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,12 +22,9 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
namespace "com.example.genshin_gacha_analysis"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
Expand All @@ -44,10 +42,10 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.genshin_wish_analysis"
applicationId "com.example.genshin_gacha_analysis"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 19
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand All @@ -66,6 +64,4 @@ flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
dependencies {}
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.genshin_wish_analysis">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
41 changes: 24 additions & 17 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.genshin_wish_analysis">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="genshin_wish_analysis"
android:label="genshin_gacha_analysis"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand All @@ -13,28 +12,36 @@
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the
Android process has started. This theme is visible to the user
while
the Flutter UI initializes. After that, this theme continues
to
determine the Window background behind the Flutter UI. -->
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to
generate GeneratedPluginRegistrant.java -->
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
<uses-permission android:name="android.permission.NFC" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example.genshin_gacha_analysis

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity()

This file was deleted.

3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.genshin_wish_analysis">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}

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

allprojects {
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G
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 @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
31 changes: 23 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"
12 changes: 12 additions & 0 deletions ios/RunnerTests/RunnerTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Flutter
import UIKit
import XCTest

class RunnerTests: XCTestCase {

func testExample() {
// If you add code to the Runner application, consider adding tests here.
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
}

}
2 changes: 2 additions & 0 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:genshin_wish_analysis/page/nfc/index.dart';

import 'global.dart';
import 'page/home/index.dart';
Expand All @@ -20,6 +21,7 @@ class GenshinWishAnalysisApp extends StatelessWidget {
routes: {
'/': (ctx) => const HomePage(),
'/setting': (ctx) => const SettingPage(),
'/nfc': (ctx) => const NfcPage(),
},
initialRoute: '/',
builder: EasyLoading.init(),
Expand Down
1 change: 0 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:desktop_webview_window/desktop_webview_window.dart';
import 'package:flutter/material.dart';
import 'package:genshin_wish_analysis/app.dart';
import 'package:genshin_wish_analysis/global.dart';
import 'package:universal_platform/universal_platform.dart';

void main(List<String> args) {
Expand Down
10 changes: 7 additions & 3 deletions lib/page/card/card_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ class CardListView extends StatelessWidget {
title: Text(e.name),
subtitle: Text(DateFormat('yyyy-MM-dd HH:mm:ss').format(e.time)),
leading: Icon(
e.type == GachaResultItemType.character ? Icons.person : Icons.device_unknown,
e.type == GachaResultItemType.character
? Icons.person
: Icons.device_unknown,
),
trailing: (int rank) {
switch (rank) {
case 4:
return Text('$rank星', style: const TextStyle(color: Colors.purple));
return Text('$rank星',
style: const TextStyle(color: Colors.purple));
case 5:
return Text('$rank星', style: const TextStyle(color: Colors.yellow));
return Text('$rank星',
style: const TextStyle(color: Colors.yellow));
default:
return Text('$rank星');
}
Expand Down
3 changes: 0 additions & 3 deletions lib/page/card/index.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:genshin_wish_analysis/global.dart';
import 'package:genshin_wish_analysis/page/card/card_list_view.dart';
import 'package:genshin_wish_analysis/service/gacha_service.dart';
import 'package:genshin_wish_analysis/service/gacha_type_enum.dart';
import 'package:intl/intl.dart';

class GachaHistoryView extends StatefulWidget {
const GachaHistoryView({super.key});
Expand Down
10 changes: 8 additions & 2 deletions lib/page/home/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:genshin_wish_analysis/global.dart';
import 'package:genshin_wish_analysis/page/card/index.dart';
import 'package:genshin_wish_analysis/page/login/index.dart';
import 'package:genshin_wish_analysis/service/gacha_type_enum.dart';
import 'package:genshin_wish_analysis/service/mhy_service.dart';

final _log = GlobalObjects.logger;
Expand Down Expand Up @@ -168,7 +167,14 @@ class _HomePageState extends State<HomePage> {
leading: const Icon(Icons.copy),
title: const Text('获取祈愿地址'),
onTap: getUrl,
)
),
ListTile(
leading: const Icon(Icons.launch),
title: const Text('NFC'),
onTap: () {
Navigator.of(context).pushNamed('/nfc');
},
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/page/login/mobile_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class _MobileLoginPageState extends State<MobileLoginPage> {
Uri.parse('https://user.mihoyo.com/'),
);
},
child: Text('刷新'),
child: const Text('刷新'),
),
],
),
Expand Down
Loading

0 comments on commit ec07754

Please sign in to comment.