Skip to content

Commit

Permalink
Step 1
Browse files Browse the repository at this point in the history
  • Loading branch information
misakajimmy committed Jan 14, 2023
1 parent d6a88e1 commit 7dc8037
Show file tree
Hide file tree
Showing 132 changed files with 1,102 additions and 72 deletions.
Binary file added assets/emoji/gogo队.webp
Binary file not shown.
Binary file added assets/emoji/小莞熊.webp
Binary file not shown.
Binary file added assets/emoji/柚恩蜜.webp
Binary file not shown.
Binary file added assets/emoji/美人虞.webp
Binary file not shown.
Binary file added assets/emoji/酷诺米.webp
Binary file not shown.
Binary file added assets/eoe.webp
Binary file not shown.
Binary file added assets/mi/head_bg.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/mi/head_myself_mp4_bg.mp4
Binary file not shown.
Binary file added assets/mi/head_myself_squared_bg.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 added assets/mi/head_tab_bg.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/mi/tail_bg.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 added assets/mi/tail_icon_channel.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 added assets/mi/tail_icon_dynamic.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 added assets/mi/tail_icon_main.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 added assets/mi/tail_icon_myself.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 added assets/mi/tail_icon_pub_btn_bg.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 added assets/mi/tail_icon_selected_channel.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 added assets/mi/tail_icon_selected_dynamic.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 added assets/mi/tail_icon_selected_main.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 added assets/mi/tail_icon_selected_myself.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 added assets/mi/tail_icon_selected_pub_btn_bg.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 added assets/mi/tail_icon_selected_shop.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 added assets/mi/tail_icon_shop.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 added assets/mo/head_bg.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/mo/head_myself_mp4_bg.mp4
Binary file not shown.
Binary file added assets/mo/head_myself_squared_bg.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 added assets/mo/head_tab_bg.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/mo/tail_bg.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 added assets/mo/tail_icon_channel.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 added assets/mo/tail_icon_dynamic.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 added assets/mo/tail_icon_main.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 added assets/mo/tail_icon_myself.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 added assets/mo/tail_icon_pub_btn_bg.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 added assets/mo/tail_icon_selected_channel.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 added assets/mo/tail_icon_selected_dynamic.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 added assets/mo/tail_icon_selected_main.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 added assets/mo/tail_icon_selected_myself.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 added assets/mo/tail_icon_selected_pub_btn_bg.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 added assets/mo/tail_icon_selected_shop.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 added assets/mo/tail_icon_shop.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 added assets/un/head_bg.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/un/head_myself_mp4_bg.mp4
Binary file not shown.
Binary file added assets/un/head_myself_squared_bg.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 added assets/un/head_tab_bg.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/un/tail_bg.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 added assets/un/tail_icon_channel.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 added assets/un/tail_icon_dynamic.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 added assets/un/tail_icon_main.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 added assets/un/tail_icon_myself.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 added assets/un/tail_icon_pub_btn_bg.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 added assets/un/tail_icon_selected_channel.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 added assets/un/tail_icon_selected_dynamic.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 added assets/un/tail_icon_selected_main.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 added assets/un/tail_icon_selected_myself.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 added assets/un/tail_icon_selected_pub_btn_bg.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 added assets/un/tail_icon_selected_shop.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 added assets/un/tail_icon_shop.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 added assets/wan/head_bg.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/wan/head_myself_mp4_bg.mp4
Binary file not shown.
Binary file added assets/wan/head_myself_squared_bg.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 added assets/wan/head_tab_bg.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/wan/tail_bg.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 added assets/wan/tail_icon_channel.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 added assets/wan/tail_icon_dynamic.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 added assets/wan/tail_icon_main.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 added assets/wan/tail_icon_myself.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 added assets/wan/tail_icon_pub_btn_bg.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 added assets/wan/tail_icon_selected_channel.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 added assets/wan/tail_icon_selected_dynamic.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 added assets/wan/tail_icon_selected_main.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 added assets/wan/tail_icon_selected_myself.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 added assets/wan/tail_icon_selected_pub_btn_bg.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 added assets/wan/tail_icon_selected_shop.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 added assets/wan/tail_icon_shop.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 added assets/zao/head_bg.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/zao/head_myself_mp4_bg.mp4
Binary file not shown.
Binary file added assets/zao/head_myself_squared_bg.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 added assets/zao/head_tab_bg.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/zao/tail_bg.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 added assets/zao/tail_icon_channel.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 added assets/zao/tail_icon_dynamic.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 added assets/zao/tail_icon_main.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 added assets/zao/tail_icon_myself.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 added assets/zao/tail_icon_pub_btn_bg.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 added assets/zao/tail_icon_selected_channel.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 added assets/zao/tail_icon_selected_dynamic.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 added assets/zao/tail_icon_selected_main.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 added assets/zao/tail_icon_selected_myself.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 added assets/zao/tail_icon_selected_pub_btn_bg.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 added assets/zao/tail_icon_selected_shop.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 added assets/zao/tail_icon_shop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions jsons/cacheConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"enable":true,
"maxAge":1000,
"maxCount":100
}
6 changes: 0 additions & 6 deletions jsons/profile.json

This file was deleted.

27 changes: 27 additions & 0 deletions jsons/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"bvid": "String",
"aid": 0,
"name": "String",
"mid": 0,
"face": "String",
"tid": 0,
"tname": "String",
"copyright": 0,
"title": "String",
"desc": "String",
"pic": "String",
"tag": "String",
"pubdate": 0,
"duration": "String",
"view": 0,
"danmaku": 0,
"reply": 0,
"favorite": 0,
"coin": 0,
"share": 0,
"like": 0,
"score": 0,
"status": 0,
"created_at": 0,
"updated_at": 0
}
5 changes: 5 additions & 0 deletions jsons/videos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"page": 0,
"numResults": 0,
"result": "$[]video"
}
53 changes: 53 additions & 0 deletions lib/common/Api.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'dart:convert';

import 'package:dio/dio.dart';
import 'package:eoe_fans/models/videos.dart';
import 'package:eoe_fans/models/iResponse.dart';
import 'package:eoe_fans/models/videosRequest.dart';
import 'package:flutter/cupertino.dart';

import 'Global.dart';

class Api {
Api([this.context]);

BuildContext? context;

static String key = '7e013c02952c41078c18ab26f639f02e';

// Options _options;
static Dio dio =
Dio(BaseOptions(baseUrl: 'https://api.eoe.best/eoefans-api/v1', headers: {
'ocp-apim-subscription-key': key,
'Content-Type': 'application/json',
}));

static void init() {
//添加缓存插件
dio.interceptors.add(Global.netCache);
//设置用户token(null,为未登录)
// dio.options.headers[HttpHeaders.authorizationHeader] = Global.profile.token;
}

Future<Videos> videos(VideosRequest params) async {
var paramsData = ({...params.toJson(), 'subscription-key': key});
paramsData.removeWhere((key, value) => value == null);
print(paramsData);
var r = await dio.get('/video-interface/advanced-search',
queryParameters: paramsData);
var tmpVideos = Videos()
..page = 0
..numResults = 0
..result = [];
if (r.statusCode == 200) {
var videoRes =
IResponse<Videos>.fromJson(r.data, (json) => Videos.fromJson(json));
print(videoRes.data?.page);
print(videoRes.data?.numResults);
if (videoRes.data != null) {
tmpVideos = videoRes.data!;
}
}
return tmpVideos;
}
}
6 changes: 3 additions & 3 deletions lib/common/CacheObject.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class NetCache extends Interceptor {
ResponseInterceptorHandler handler,
) async {
// 如果启用缓存,将返回结果保存到缓存
if (Global.profile.cache.enable) {
_saveCache(response);
}
// if (Global.profile.cache.enable) {
// _saveCache(response);
// }
}

_saveCache(Response object) {
Expand Down
92 changes: 70 additions & 22 deletions lib/common/Global.dart
Original file line number Diff line number Diff line change
@@ -1,44 +1,92 @@
import 'dart:convert';

import 'package:eoe_fans/models/eoeTheme.dart';
import 'package:eoe_fans/models/memberMap.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

import '../models/cacheConfig.dart';
import '../models/profile.dart';
import 'CacheObject.dart';

const Map<int, Color> myPink = {
50: Color.fromRGBO(251, 114, 153, .1),
100: Color.fromRGBO(251, 114, 153, .2),
200: Color.fromRGBO(251, 114, 153, .3),
300: Color.fromRGBO(251, 114, 153, .4),
400: Color.fromRGBO(251, 114, 153, .5),
500: Color.fromRGBO(251, 114, 153, .6),
600: Color.fromRGBO(251, 114, 153, .7),
700: Color.fromRGBO(251, 114, 153, .8),
800: Color.fromRGBO(251, 114, 153, .9),
900: Color.fromRGBO(251, 114, 153, 1),
};

const MaterialColor pink = MaterialColor(0xFFFB7299, myPink);

const _themes = <MaterialColor>[
pink,
Colors.blue,
Colors.yellow,
Colors.orange,
Colors.purple,
const _themes = <dynamic>[
{
'id': 'zao',
'name': 'zao',
'assetsPath': 'zao',
},
{
'id': 'wan',
'name': 'wan',
'assetsPath': 'zao',
},
{
'id': 'mo',
'name': 'mo',
'assetsPath': 'zao',
},
{
'id': 'un',
'name': 'un',
'assetsPath': 'zao',
},
{
'id': 'mi',
'name': 'mi',
'assetsPath': 'zao',
}
];

const Map<String, dynamic> membersJson = {
'zao': {
'lastName': '白',
'firstName': '露早',
'bilibiliName': '露早GOGO',
'bilibiliUID': 1669777785,
'nickNames': ['早早'],
},
'wan': {
'lastName': '唐',
'firstName': '莞儿',
'bilibiliName': '莞儿睡不醒',
'bilibiliUID': 1875044092,
'nickNames': [''],
},
'mo': {
'lastName': '苏',
'firstName': '虞莫',
'bilibiliName': '虞莫MOMO',
'bilibiliUID': 1811071010,
'nickNames': ['莫莫'],
},
'un': {
'lastName': '姜',
'firstName': '柚恩',
'bilibiliName': '柚恩不加糖',
'bilibiliUID': 1795147802,
'nickNames': ['柚柚'],
},
'mi': {
'lastName': '安',
'firstName': '米诺',
'bilibiliName': '米诺高分少女',
'bilibiliUID': 1778026586,
'nickNames': ['大米'],
}
};

class Global {
static late SharedPreferences _prefs;
static Profile profile = Profile();
static MemberMap members = MemberMap.fromJson(membersJson);

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

static String currentTheme = 'zao';

//可选主题列表
static List<MaterialColor> get themes => _themes;
static List<EoeTheme> get themes => _themes.map((e) => EoeTheme.fromJson(e)).toList();

//是否为release版
static bool get isRelease => bool.fromEnvironment("dart.vm.product");
Expand Down
12 changes: 12 additions & 0 deletions lib/common/Time.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
String SecondToDate(num seconds) {
var h = seconds ~/ 3600;
var m = seconds ~/ 60 % 60;
var s = seconds % 60;
var res = '';
if (h != 0) {
res += '$h:';
}
res += '$m:';
res += s.toString();
return res;
}
35 changes: 20 additions & 15 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import 'dart:io';

import 'package:eoe_fans/states/ProfileChangeNotifier.dart';
import 'package:eoe_fans/routes/mainPage.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:eoe_fans/states/ProfileChangeNotifier.dart';
import 'package:provider/provider.dart';

import 'common/Global.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
if (Platform.isAndroid) {
// 以下两行 设置android状态栏为透明的沉浸。写在组件渲染之后,是为了在渲染后进行set赋值,覆盖状态栏,写在渲染之前MaterialApp组件会覆盖掉这个值。
SystemUiOverlayStyle systemUiOverlayStyle =
SystemUiOverlayStyle(statusBarColor: Colors.transparent);
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
}
runApp(MyApp());
// if (Platform.isAndroid) {
// // 以下两行 设置android状态栏为透明的沉浸。写在组件渲染之后,是为了在渲染后进行set赋值,覆盖状态栏,写在渲染之前MaterialApp组件会覆盖掉这个值。
// SystemUiOverlayStyle systemUiOverlayStyle =
// SystemUiOverlayStyle(statusBarColor: Colors.transparent);
// SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
// }
Global.init().then((e) => runApp(MyApp()));
}

class MyApp extends StatelessWidget {
Expand All @@ -25,13 +28,15 @@ class MyApp extends StatelessWidget {
],
child: Consumer<ThemeModel>(
builder: (BuildContext context, themeModel, Widget? child) {
const theme = ThemeData();
const app = MaterialApp(
theme: theme,
initialRoute: "/",
routes: {},
);
return app;
return MaterialApp(
initialRoute: '/',
theme: ThemeData(
primarySwatch: Colors.blue,
),
routes: {
'/': (BuildContext context) => MainPage(),
},
);
}));
}
}
10 changes: 5 additions & 5 deletions lib/models/cacheConfig.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ part 'cacheConfig.g.dart';

@JsonSerializable()
class CacheConfig {
CacheConfig({this.enable, this.maxAge, this.maxCount});

bool? enable;
num? maxAge;
num? maxCount;
CacheConfig();

late bool enable;
late num maxAge;
late num maxCount;

factory CacheConfig.fromJson(Map<String,dynamic> json) => _$CacheConfigFromJson(json);
Map<String, dynamic> toJson() => _$CacheConfigToJson(this);
}
9 changes: 4 additions & 5 deletions lib/models/cacheConfig.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions lib/models/eoeTheme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:json_annotation/json_annotation.dart';

part 'eoeTheme.g.dart';

@JsonSerializable()
class EoeTheme {
EoeTheme({required this.id, required this.name, required this.assetsPath});

String id;
String name;
String assetsPath;

factory EoeTheme.fromJson(Map<String, dynamic> json) =>
_$EoeThemeFromJson(json);

Map<String, dynamic> toJson() => _$EoeThemeToJson(this);
}
19 changes: 19 additions & 0 deletions lib/models/eoeTheme.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions lib/models/iResponse.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:json_annotation/json_annotation.dart';

part 'iResponse.g.dart';

enum IResponseCode {
@JsonValue(0)
OK,
@JsonValue(400)
ParamError,
@JsonValue(4001)
NeedLogin,
}

@JsonSerializable(genericArgumentFactories: true)
class IResponse<T> {
IResponse();

late IResponseCode code;
late String message;
late num ttl;
T? data;

factory IResponse.fromJson(
Map<String, dynamic> json,
T Function(dynamic json) fromJsonT,
) =>
_$IResponseFromJson<T>(json, fromJsonT);

Map<String, dynamic> toJson(Object? Function(T value) toJsonT) =>
_$IResponseToJson<T>(this, toJsonT);
}
Loading

0 comments on commit 7dc8037

Please sign in to comment.