Skip to content

Commit

Permalink
Update 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
misakajimmy committed Jan 21, 2023
1 parent d660c89 commit f2eea2e
Show file tree
Hide file tree
Showing 16 changed files with 290 additions and 151 deletions.
Binary file added assets/banner1.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/banner2.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/banner3.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/jijiji.jpg
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 lib/common/Global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:eoe_fans/models/eoeTheme.dart';
import 'package:eoe_fans/models/member.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';

import '../models/cacheConfig.dart';
Expand Down Expand Up @@ -89,8 +90,12 @@ class Global {
//是否为release版
static bool get isRelease => bool.fromEnvironment("dart.vm.product");

static late PackageInfo packageInfo;

//初始化全局信息,会在App启动时启动
static Future init() async {
WidgetsFlutterBinding.ensureInitialized();

_prefs = await SharedPreferences.getInstance();
var _profile = _prefs.getString("profile");
if (_profile != null) {
Expand All @@ -111,6 +116,7 @@ class Global {
if (t != null && t != '') {
theme = t;
}
packageInfo = await PackageInfo.fromPlatform();
}

static saveProfile() =>
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:eoe_fans/routes/mainPage.dart';
import 'package:eoe_fans/routes/setting/aboutUs.dart';
import 'package:eoe_fans/routes/setting/settingPage.dart';
import 'package:eoe_fans/routes/setting/settingTheme.dart';
import 'package:eoe_fans/routes/splashPage.dart';
Expand Down Expand Up @@ -41,6 +42,7 @@ class MyApp extends StatelessWidget {
'/splash': (BuildContext context) => SplashScreen(),
'/setting': (BuildContext context) => const SettingPage(),
'/theme': (BuildContext context) => const SettingTheme(),
'/about': (BuildContext context) => const AboutUs(),
},
);
}));
Expand Down
10 changes: 6 additions & 4 deletions lib/routes/music/musicPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ class _MusicPageState extends State<MusicPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: GestureDetector(
child: Text('leading'),
body: Container(
height: double.maxFinite,
padding: EdgeInsets.only(bottom: 50),
child: Image(
image: AssetImage('assets/jijiji.jpg'),
fit: BoxFit.cover,
),
),
body: Text('MusicPage'),
);
}
}
11 changes: 10 additions & 1 deletion lib/routes/picture/picturePage.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:ffi';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

Expand All @@ -12,7 +14,14 @@ class _PicturePageState extends State<PicturePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Text('PicturePage'),
body: Container(
height: double.maxFinite,
padding: EdgeInsets.only(bottom: 50),
child: Image(
image: AssetImage('assets/jijiji.jpg'),
fit: BoxFit.cover,
),
),
);
}
}
57 changes: 57 additions & 0 deletions lib/routes/setting/aboutUs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import 'package:flutter/material.dart';

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

@override
State<AboutUs> createState() => _AboutUsState();
}

const developers = [
{'name': '乔治', 'title': '总技术负责人'},
{'name': '阿正', 'title': '后端负责人'},
{'name': '艾米莉娅', 'title': '后端开发'},
{'name': '锋子', 'title': '前端开发'},
{'name': 'master1lan', 'title': '前端开发'},
{'name': '御坂吉米', 'title': '移动端开发'},
{'name': '隔壁PM(Wing)', 'title': '产品经理'},
{'name': 'UI-阿池', 'title': 'UI设计'},
{'name': '梁心', 'title': 'LOGO设计'},
];

class _AboutUsState extends State<AboutUs> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: PreferredSize(
preferredSize: Size.fromHeight(270),
child: AppBar(
centerTitle: true,
flexibleSpace: Container(
height: double.maxFinite,
child: Image(
alignment: Alignment.topCenter,
image: AssetImage(
'assets/logo.jpg'),
fit: BoxFit.cover,
),
),
),
),
body: ListView(
children: developers
.map((e) => ListTile(
leading: CircleAvatar(
child: Icon(
Icons.manage_accounts_rounded,
size: 24,
),
),
title: Text(e['title']!),
subtitle: Text(e['name']!),
))
.toList(),
),
);
}
}
23 changes: 23 additions & 0 deletions lib/routes/setting/settingPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class _SettingPageState extends State<SettingPage> {
Navigator.pushNamed(context, '/theme');
},
),

// SettingsTile.switchTile(
// onToggle: (value) {},
// initialValue: true,
Expand All @@ -63,6 +64,28 @@ class _SettingPageState extends State<SettingPage> {
// ),
],
),
SettingsSection(
title: Text('关于'),
tiles: [
SettingsTile.navigation(
leading: Icon(Icons.update),
title: Text('检查版本'),
value: Text(
'当前版本: ${Global.packageInfo.version}'),
// onPressed: (BuildContext context) {
// Navigator.pushNamed(context, '/theme');
// },
),
SettingsTile.navigation(
leading: Icon(Icons.info_outline),
title: Text('关于我们'),
trailing: Icon(Icons.keyboard_arrow_right),
onPressed: (BuildContext context) {
Navigator.pushNamed(context, '/about');
},
),
],
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/video/videoList.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class _VideoListState extends State<VideoList> {
// double progress = notification.metrics.pixels /
// notification.metrics.maxScrollExtent;
// print("${(progress * 100).toInt()}%");
print(notification.metrics.maxScrollExtent - notification.metrics.pixels);
// print(notification.metrics.maxScrollExtent - notification.metrics.pixels);
//重新构建
setState(() {
if (notification.metrics.maxScrollExtent - notification.metrics.pixels < 1000 && !_loading) {
Expand Down
14 changes: 12 additions & 2 deletions lib/routes/video/videoListItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ class VideoListItem extends StatelessWidget {
right: 0,
child: Container(
padding: const EdgeInsets.all(4.0),
decoration: new BoxDecoration(
color: Color.fromRGBO(0, 0, 0, .3),
gradient: LinearGradient(
colors: [Colors.transparent, Colors.black],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expand All @@ -59,7 +67,7 @@ class VideoListItem extends StatelessWidget {
child: Text(
video.view < 10000
? video.view.toString()
: '${(video.view / 10000).toStringAsFixed(2)}万',
: '${(video.view / 10000).toStringAsFixed(1)}万',
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 10, color: Colors.white),
Expand Down Expand Up @@ -93,7 +101,9 @@ class VideoListItem extends StatelessWidget {
SecondToDate(int.parse(video.duration)),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 10, color: Colors.white),
fontSize: 10,
color: Colors.white,
),
),
)
],
Expand Down
21 changes: 17 additions & 4 deletions lib/routes/video/videoSwiper.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
import 'package:url_launcher/url_launcher.dart';

const images = [
'https://i0.hdslb.com/bfs/banner/8ad45f463da4c6411b94c960a713dd72bbf97657.jpg',
'https://i0.hdslb.com/bfs/banner/023d359000172a213d7a5537295e4236fca63004.png',
'https://i0.hdslb.com/bfs/banner/6c87d994adab02603270d84c93bdc99dab6e64be.jpg'
'assets/banner1.jpg',
'assets/banner2.png',
'assets/banner3.png',
];

const urls = [
'https://b23.tv/GI9EDCl',
'bilibili://video/BV1Pv4y1C7TE',
'https://b23.tv/kI0MBkx'
];

class VideoSwiper extends StatelessWidget {
Expand All @@ -17,12 +24,18 @@ class VideoSwiper extends StatelessWidget {
itemBuilder: (BuildContext context, int index) {
return Container(
child: Image(
image: CachedNetworkImageProvider(images[index]),
image: AssetImage(images[index]),
fit: BoxFit.fill,
),
);
},
itemCount: images.length,
onTap: (int index) async {
print(index);
if (!await launchUrl(Uri.parse(urls[index]))) {
throw 'Could not launch ${urls[index]}';
}
},
pagination: const SwiperPagination(
alignment: Alignment.bottomRight,
builder: DotSwiperPaginationBuilder(
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import FlutterMacOS
import Foundation

import package_info_plus
import path_provider_macos
import shared_preferences_foundation
import sqflite
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
Expand Down
Loading

0 comments on commit f2eea2e

Please sign in to comment.