Skip to content

Commit

Permalink
DEV UPDATE:Add splash and logo
Browse files Browse the repository at this point in the history
  • Loading branch information
misakajimmy committed Jan 20, 2023
1 parent 5c76e1c commit 584c755
Show file tree
Hide file tree
Showing 67 changed files with 765 additions and 268 deletions.
29 changes: 0 additions & 29 deletions analysis_options.yaml

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions android/app/src/main/res/drawable-night/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions android/app/src/main/res/values-night-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<!-- <item name="android:windowSplashScreenBackground">#ffffff</item>-->
<!-- <item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>-->
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Binary file added assets/head/mi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/head/mo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/head/un.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/head/wan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/head/zao.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo-640.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo-768.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/open/open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "background.png",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "darkbackground.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 13 additions & 3 deletions lib/common/Global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ class Global {
static late SharedPreferences _prefs;
static Profile profile = Profile();

static Map<MemberEnum, Member> get members => membersJson.map((key, value) => MapEntry(key, Member.fromJson(value)));
static Map<MemberEnum, Member> get members =>
membersJson.map((key, value) => MapEntry(key, Member.fromJson(value)));

static String theme = 'zao';

//网络缓存对象
static NetCache netCache = NetCache();

static String currentTheme = 'zao';

//可选主题列表
static List<EoeTheme> get themes =>
_themes.map((e) => EoeTheme.fromJson(e)).toList();
Expand All @@ -103,8 +104,17 @@ class Global {
..enable = true
..maxAge = 3600
..maxCount = 100;

var t = _prefs.getString("theme");
print('theme');
print(theme);
if (t != null && t != '') {
theme = t;
}
}

static saveProfile() =>
_prefs.setString("profile", jsonEncode(profile.toJson()));

static saveTheme(String id) => _prefs.setString("theme", id);
}
24 changes: 15 additions & 9 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import 'dart:io';

import 'package:eoe_fans/routes/mainPage.dart';
import 'package:eoe_fans/routes/setting/settingPage.dart';
import 'package:eoe_fans/routes/setting/settingTheme.dart';
import 'package:eoe_fans/routes/splashPage.dart';
import 'package:flutter/material.dart';
import 'package:eoe_fans/states/ProfileChangeNotifier.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -28,15 +31,18 @@ class MyApp extends StatelessWidget {
],
child: Consumer<ThemeModel>(
builder: (BuildContext context, themeModel, Widget? child) {
return MaterialApp(
initialRoute: '/',
theme: ThemeData(
primarySwatch: Colors.blue,
),
routes: {
'/': (BuildContext context) => MainPage(),
},
);
return MaterialApp(
initialRoute: '/splash',
theme: ThemeData(
primarySwatch: Colors.blue,
),
routes: {
'/': (BuildContext context) => MainPage(),
'/splash': (BuildContext context) => SplashScreen(),
'/setting': (BuildContext context) => const SettingPage(),
'/theme': (BuildContext context) => const SettingTheme(),
},
);
}));
}
}
66 changes: 34 additions & 32 deletions lib/routes/mainPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,38 +36,40 @@ class _MainPageState extends State<MainPage> {
children: _bodyList,
),
Align(
alignment: Alignment.bottomCenter,
child: Theme(
data: Theme.of(context)
.copyWith(canvasColor: Colors.transparent),
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/${Provider.of<ThemeModel>(context).assets}/tail_bg.png'),
fit: BoxFit.fill),
color: Colors.transparent),
child: BottomNavigationBar(
elevation: 0,
backgroundColor: Colors.transparent,
type: BottomNavigationBarType.fixed,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.video_library_outlined),
label: '视频',
),
BottomNavigationBarItem(
icon: Icon(Icons.image),
label: '图片',
),
BottomNavigationBarItem(
icon: Icon(Icons.library_music),
label: '音乐',
),
],
currentIndex: _selectedIndex,
onTap: _onItemTapped,
))))
alignment: Alignment.bottomCenter,
child: Theme(
data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/${Provider.of<ThemeModel>(context).assets}/tail_bg.png'),
fit: BoxFit.fill),
color: Colors.transparent),
child: BottomNavigationBar(
elevation: 0,
backgroundColor: Colors.transparent,
type: BottomNavigationBarType.fixed,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.video_library_outlined),
label: '视频',
),
BottomNavigationBarItem(
icon: Icon(Icons.image),
label: '图片',
),
BottomNavigationBarItem(
icon: Icon(Icons.library_music),
label: '音乐',
),
],
currentIndex: _selectedIndex,
onTap: _onItemTapped,
),
),
),
),
],
),
);
Expand Down
70 changes: 70 additions & 0 deletions lib/routes/setting/settingPage.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import 'package:eoe_fans/common/Global.dart';
import 'package:eoe_fans/models/member.dart';
import 'package:eoe_fans/common/Global.dart';
import 'package:eoe_fans/states/ProfileChangeNotifier.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings_ui/settings_ui.dart';

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

@override
State<SettingPage> createState() => _SettingPageState();
}

class _SettingPageState extends State<SettingPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(
Icons.arrow_back,
color: Colors.white,
),
onPressed: () => Navigator.pop(context),
),
title: const Text(
'设置',
style: TextStyle(color: Colors.white),
),
flexibleSpace: Container(
height: double.maxFinite,
child: Image(
image: AssetImage(
'assets/${Provider.of<ThemeModel>(context).assets}/head_bg.jpg'),
fit: BoxFit.cover,
),
),
),
body: SettingsList(
sections: [
SettingsSection(
title: Text('常规'),
tiles: <SettingsTile>[
SettingsTile.navigation(
leading: Icon(Icons.color_lens_outlined),
title: Text('主题'),
value: Text(Global
.members[Provider.of<ThemeModel>(context).themeMember]
?.firstName ??
''),
trailing: Icon(Icons.keyboard_arrow_right),
onPressed: (BuildContext context) {
Navigator.pushNamed(context, '/theme');
},
),
// SettingsTile.switchTile(
// onToggle: (value) {},
// initialValue: true,
// leading: Icon(Icons.format_paint),
// title: Text('Enable custom theme'),
// ),
],
),
],
),
);
}
}
78 changes: 78 additions & 0 deletions lib/routes/setting/settingTheme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import 'package:eoe_fans/models/member.dart';
import 'package:eoe_fans/states/ProfileChangeNotifier.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
import 'package:eoe_fans/common/Global.dart';
import 'package:provider/provider.dart';

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

@override
State<SettingTheme> createState() => _SettingThemeState();
}

class _SettingThemeState extends State<SettingTheme> {
MemberEnum _memberSelect = MemberEnum.zao;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(
Icons.arrow_back,
color: Colors.white,
),
onPressed: () => Navigator.pop(context),
),
title: const Text("主题"),
flexibleSpace: Container(
height: double.maxFinite,
child: Image(
image: AssetImage('assets/${_memberSelect.name}/head_bg.jpg'),
fit: BoxFit.cover,
),
),
),
body: Stack(
children: [
Swiper(
itemBuilder: (BuildContext context, int index) {
return Container(
child: Image(
image: AssetImage(
'assets/head/${MemberEnum.values[index].name}.jpg'),
fit: BoxFit.cover,
),
);
},
itemCount: MemberEnum.values.length,
onIndexChanged: (int index) {
setState(() {
_memberSelect = MemberEnum.values[index];
Provider.of<ThemeModel>(context, listen: false).theme = _memberSelect.name;
});
},
pagination: const SwiperPagination(
alignment: Alignment.bottomRight,
builder: DotSwiperPaginationBuilder(
color: Colors.black12, // 其他点的颜色
activeColor: Colors.white,
space: 2, // 点与点之间的距离
activeSize: 15 // 当前点的大小
),
),
),
// Positioned(
// child: IconButton(
// icon: Icon(
// Icons.check_box
// ),
// )
// )
],
),
);
}
}
Loading

0 comments on commit 584c755

Please sign in to comment.