Skip to content

Commit

Permalink
chore: init
Browse files Browse the repository at this point in the history
  • Loading branch information
whes1015 committed Aug 6, 2023
1 parent 08a28e6 commit 06b477f
Show file tree
Hide file tree
Showing 12 changed files with 509 additions and 13 deletions.
11 changes: 3 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,15 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.exptech.dpip.dpip"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 19
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
versionCode 1
versionName "23w32a"
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:dpip/view/init.dart';
import 'package:flutter/material.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
}

Expand Down
34 changes: 34 additions & 0 deletions lib/view/about.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';

bool init = false;

class AboutPage extends StatefulWidget {
const AboutPage({Key? key}) : super(key: key);

@override
_AboutPage createState() => _AboutPage();
}

class _AboutPage extends State<AboutPage> {
@override
void dispose() {
init = false;
super.dispose();
}

@override
Widget build(BuildContext context) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
if (!mounted) return;
setState(() {});
});
return Scaffold(
backgroundColor: Colors.black,
body: SafeArea(
child: Column(
children: [],
),
),
);
}
}
87 changes: 83 additions & 4 deletions lib/view/me.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import 'package:dpip/core/api.dart';
import 'package:dpip/view/setting.dart';
import 'package:dpip/view/version.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'about.dart';

bool init = false;

class MePage extends StatefulWidget {
Expand Down Expand Up @@ -32,6 +36,7 @@ class _MePage extends State<MePage> {
}
init = true;
_List_children = <Widget>[];
PackageInfo packageInfo = await PackageInfo.fromPlatform();
_List_children.add(GestureDetector(
onTap: () {
Navigator.push(
Expand Down Expand Up @@ -70,8 +75,10 @@ class _MePage extends State<MePage> {
textAlign: TextAlign.end,
),
),
const Icon(Icons.arrow_forward_ios_outlined,
color: Colors.white, size: 20)
const Padding(
padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Icon(Icons.arrow_forward_ios_outlined,
color: Colors.white, size: 20)),
],
),
),
Expand Down Expand Up @@ -118,8 +125,80 @@ class _MePage extends State<MePage> {
textAlign: TextAlign.end,
),
),
const Icon(Icons.arrow_forward_ios_outlined,
color: Colors.white, size: 20)
const Padding(
padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Icon(Icons.arrow_forward_ios_outlined,
color: Colors.white, size: 20)),
],
),
),
));
_List_children.add(const Divider(color: Colors.grey, thickness: 0.5));
_List_children.add(GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const VersionPage(),
));
},
child: Padding(
padding: const EdgeInsets.all(5),
child: Row(
children: [
const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"版本",
style: TextStyle(fontSize: 20, color: Colors.white),
),
],
),
Expanded(
child: Text(
"${packageInfo.version} | ${(!packageInfo.version.endsWith("0")) ? "預覽版" : "穩定版"}",
style: const TextStyle(fontSize: 22, color: Colors.white),
textAlign: TextAlign.end,
),
),
const Padding(
padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Icon(Icons.arrow_forward_ios_outlined,
color: Colors.white, size: 20)),
],
),
),
));
_List_children.add(const Divider(color: Colors.grey, thickness: 0.5));
_List_children.add(GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AboutPage(),
));
},
child: const Padding(
padding: EdgeInsets.all(5),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"關於",
style: TextStyle(fontSize: 20, color: Colors.white),
),
],
),
Expanded(
child: SizedBox(),
),
Padding(
padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Icon(Icons.arrow_forward_ios_outlined,
color: Colors.white, size: 20)),
],
),
),
Expand Down
Loading

0 comments on commit 06b477f

Please sign in to comment.