Skip to content

Commit f31cc41

Browse files
committed
完善页面逻辑
1 parent 410fc2c commit f31cc41

File tree

17 files changed

+4240
-411
lines changed

17 files changed

+4240
-411
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
android:name="flutterEmbedding"
4646
android:value="2" />
4747

48-
<meta-data
49-
android:name="io.flutter.embedding.android.EnableImpeller"
50-
android:value="true" />
48+
<!-- <meta-data-->
49+
<!-- android:name="io.flutter.embedding.android.EnableImpeller"-->
50+
<!-- android:value="true" />-->
5151

5252
<!-- ADD THIS "SERVICE" element -->
5353
<service

android/app/src/main/res/values/styles.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<!-- Show a splash screen on the activity. Automatically removed when
66
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
8-
<item name="android:navigationBarColor">@android:color/transparent</item>
98
</style>
109
<!-- Theme applied to the Android Window as soon as the process has started.
1110
This theme determines the color of the Android Window while your
@@ -15,6 +14,5 @@
1514
This Theme is only used starting with V2 of Flutter's Android embedding. -->
1615
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
1716
<item name="android:windowBackground">?android:colorBackground</item>
18-
<item name="android:navigationBarColor">@android:color/transparent</item>
1917
</style>
2018
</resources>

assets/lottie/empty_status.json

Lines changed: 3396 additions & 1 deletion
Large diffs are not rendered by default.

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
CODE_SIGN_IDENTITY = "Apple Development";
361361
CODE_SIGN_STYLE = Automatic;
362362
CURRENT_PROJECT_VERSION = 24;
363-
DEVELOPMENT_TEAM = L8RH7BB425;
363+
DEVELOPMENT_TEAM = 9B8F54HHWB;
364364
ENABLE_BITCODE = NO;
365365
INFOPLIST_FILE = Runner/Info.plist;
366366
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music";
@@ -370,7 +370,7 @@
370370
"@executable_path/Frameworks",
371371
);
372372
MARKETING_VERSION = 2.0.3;
373-
PRODUCT_BUNDLE_IDENTIFIER = com.qcry.app;
373+
PRODUCT_BUNDLE_IDENTIFIER = com.paopaogou.app;
374374
PRODUCT_NAME = "$(TARGET_NAME)";
375375
PROVISIONING_PROFILE_SPECIFIER = "";
376376
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -495,7 +495,7 @@
495495
CODE_SIGN_IDENTITY = "Apple Development";
496496
CODE_SIGN_STYLE = Automatic;
497497
CURRENT_PROJECT_VERSION = 24;
498-
DEVELOPMENT_TEAM = L8RH7BB425;
498+
DEVELOPMENT_TEAM = 9B8F54HHWB;
499499
ENABLE_BITCODE = NO;
500500
INFOPLIST_FILE = Runner/Info.plist;
501501
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music";
@@ -505,7 +505,7 @@
505505
"@executable_path/Frameworks",
506506
);
507507
MARKETING_VERSION = 2.0.3;
508-
PRODUCT_BUNDLE_IDENTIFIER = com.qcry.app;
508+
PRODUCT_BUNDLE_IDENTIFIER = com.paopaogou.app;
509509
PRODUCT_NAME = "$(TARGET_NAME)";
510510
PROVISIONING_PROFILE_SPECIFIER = "";
511511
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -524,7 +524,7 @@
524524
CODE_SIGN_IDENTITY = "Apple Development";
525525
CODE_SIGN_STYLE = Automatic;
526526
CURRENT_PROJECT_VERSION = 24;
527-
DEVELOPMENT_TEAM = L8RH7BB425;
527+
DEVELOPMENT_TEAM = 9B8F54HHWB;
528528
ENABLE_BITCODE = NO;
529529
INFOPLIST_FILE = Runner/Info.plist;
530530
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music";
@@ -534,7 +534,7 @@
534534
"@executable_path/Frameworks",
535535
);
536536
MARKETING_VERSION = 2.0.3;
537-
PRODUCT_BUNDLE_IDENTIFIER = com.qcry.app;
537+
PRODUCT_BUNDLE_IDENTIFIER = com.paopaogou.app;
538538
PRODUCT_NAME = "$(TARGET_NAME)";
539539
PROVISIONING_PROFILE_SPECIFIER = "";
540540
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

lib/main.dart

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,36 @@ import 'package:bujuan/pages/a_rebuild/home/home.dart';
88
import 'package:bujuan/pages/a_rebuild/outside/outside.dart';
99
import 'package:bujuan/pages/a_rebuild/playlist/playlist.dart';
1010
import 'package:bujuan/pages/a_rebuild/user/user.dart';
11-
import 'package:bujuan/pages/album/controller.dart';
12-
import 'package:bujuan/pages/index/cound_controller.dart';
13-
import 'package:bujuan/pages/index/index_controller.dart';
1411
import 'package:bujuan/pages/login/login.dart';
15-
import 'package:bujuan/pages/play_list/playlist_controller.dart';
16-
import 'package:bujuan/pages/playlist_manager/playlist_manager_controller.dart';
17-
import 'package:bujuan/pages/user/user_controller.dart';
18-
import 'package:bujuan/routes/router.gr.dart';
1912
import 'package:flutter/material.dart';
2013
import 'package:flutter/services.dart';
2114
import 'package:flutter_displaymode/flutter_displaymode.dart';
2215
import 'package:flutter_riverpod/flutter_riverpod.dart';
2316
import 'package:flutter_screenutil/flutter_screenutil.dart';
24-
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
25-
import 'package:get/get.dart';
2617
import 'package:get_it/get_it.dart';
2718
import 'package:go_router/go_router.dart';
2819
import 'package:hive_flutter/hive_flutter.dart';
2920
import 'package:just_audio/just_audio.dart';
3021
import 'package:window_manager/window_manager.dart';
3122

3223
import 'common/constants/colors.dart';
33-
import 'common/netease_api/src/netease_api.dart';
3424

3525
main() async {
3626
WidgetsFlutterBinding.ensureInitialized();
3727
bool land = PlatformUtils.isMacOS || PlatformUtils.isWindows || OtherUtils.isPad();
3828
final getIt = GetIt.instance;
3929
await _initAudioServer(getIt);
4030
if (PlatformUtils.isAndroid) {
41-
await FlutterDisplayMode.setHighRefreshRate();
42-
SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(
31+
// await FlutterDisplayMode.setHighRefreshRate();
32+
// SystemChrome.setEnabledSystemUIMode(
33+
// SystemUiMode.edgeToEdge,
34+
// );
35+
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
36+
// 沉浸式状态栏(仅安卓)
4337
statusBarColor: Colors.transparent,
38+
// 沉浸式导航指示器
4439
systemNavigationBarColor: Colors.transparent,
45-
systemNavigationBarContrastEnforced: false,
46-
);
47-
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
48-
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, overlays: [SystemUiOverlay.top]);
40+
));
4941
}
5042
//如果满足横屏条件,强制屏幕为横屏
5143
if (land) {
@@ -58,26 +50,26 @@ main() async {
5850
navigatorKey: rootNavigatorKey,
5951
routes: [
6052
ShellRoute(navigatorKey: shellNavigatorKey, builder: (BuildContext context, GoRouterState state, Widget child) => Outside(child: child), routes: [
61-
GoRoute(path: '/', builder: (c, s) => const HomePage(),routes: [
53+
GoRoute(path: '/', builder: (c, s) => const HomePage(), routes: [
6254
GoRoute(path: 'playlist', builder: (c, s) => PlayList(s.extra! as Play)),
6355
]),
6456
GoRoute(path: '/user', builder: (c, s) => const User()),
6557
GoRoute(path: '/login', builder: (c, s) => const LoginViewPage()),
66-
6758
])
6859
],
6960
);
70-
runApp(ProviderScope(
61+
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge).then((value) => runApp(ProviderScope(
7162
child: ScreenUtilInit(
72-
designSize: const Size(750, 1334),
73-
minTextAdapt: true,
74-
splitScreenMode: true,
75-
builder: (context, child) => MaterialApp.router(
76-
theme: AppTheme.dark,
77-
routerConfig: router,
78-
// showPerformanceOverlay: true,
79-
),
80-
)));
63+
designSize: const Size(750, 1334),
64+
minTextAdapt: true,
65+
splitScreenMode: true,
66+
builder: (context, child) {
67+
return MaterialApp.router(
68+
// showPerformanceOverlay: true,
69+
theme: AppTheme.light,
70+
routerConfig: router,
71+
);
72+
}))));
8173
// SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge).then((value) => runApp(ScreenUtilInit(
8274
// designSize: !land ? const Size(750, 1334) : const Size(2339, 1080),
8375
// minTextAdapt: true,
@@ -161,9 +153,9 @@ main() async {
161153
// }
162154

163155
Future<void> _initAudioServer(getIt) async {
164-
getIt.registerSingleton<RootRouter>(RootRouter());
156+
// getIt.registerSingleton<RootRouter>(RootRouter());
165157
getIt.registerSingleton<AudioPlayer>(AudioPlayer());
166-
getIt.registerSingleton<ZoomDrawerController>(ZoomDrawerController());
158+
// getIt.registerSingleton<ZoomDrawerController>(ZoomDrawerController());
167159
await Hive.initFlutter('BuJuan');
168160
getIt.registerSingleton<Box>(await Hive.openBox('cache'));
169161
await NeteaseMusicApi.init(debug: false);

lib/pages/a_rebuild/home/home.dart

Lines changed: 66 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:bujuan/common/constants/key.dart';
55
import 'package:bujuan/pages/a_rebuild/outside/outside.dart';
66
import 'package:bujuan/widget/simple_extended_image.dart';
77
import 'package:flutter/material.dart';
8+
import 'package:flutter/services.dart';
89
import 'package:flutter_riverpod/flutter_riverpod.dart';
910
import 'package:flutter_screenutil/flutter_screenutil.dart';
1011
import 'package:get_it/get_it.dart';
@@ -25,48 +26,80 @@ final newSongList = FutureProvider.autoDispose((ref) async {
2526
MultiPlayListWrap2 multiPlayListWrap2 = await NeteaseMusicApi().userPlayList(userData.profile?.userId ?? '-1');
2627
List<Play> list = (multiPlayListWrap2.playlist ?? []);
2728
if (list.isNotEmpty) {
28-
playlist..clear()..addAll(list);
29+
playlist
30+
..clear()
31+
..addAll(list);
2932
}
3033
}
3134
return playlist;
3235
});
3336

34-
class HomePage extends ConsumerWidget{
37+
class HomePage extends ConsumerWidget {
3538
const HomePage({super.key});
3639

3740
@override
3841
Widget build(BuildContext context, WidgetRef ref) {
3942
final newSong = ref.watch(newSongList);
40-
return Scaffold(
41-
appBar: AppBar(
42-
centerTitle: false,
43-
leading: IconButton(onPressed: (){}, icon: SimpleExtendedImage('http://p1.music.126.net/bfipOCObq0KmuW4m0o31mQ==/109951168928616871.jpg?param=180y180',borderRadius: BorderRadius.circular(90.w),width: 75.w,height: 75.w,)),
44-
title: const Text('晚上好',style: TextStyle(fontWeight: FontWeight.w600),),
45-
actions: [
46-
IconButton(onPressed: (){}, icon: const Icon(Icons.settings))
47-
],
48-
),
49-
body: newSong.when(data: (data){
50-
return ListView.builder(
51-
padding: EdgeInsets.only(left: 30.w,right: 30.w,bottom: 100.w),
52-
itemBuilder: (context, index) => GestureDetector(
53-
child: Padding(padding: EdgeInsets.symmetric(vertical: 20.w),child: Row(
54-
children: [
55-
SimpleExtendedImage('${data[index].coverImgUrl}?param=200y200',cacheWidth: 200,width: 90.w,height: 90.w,),
56-
Padding(padding: EdgeInsets.symmetric(horizontal: 10.w)),
57-
Expanded(child: Text(data[index].name??''),)
58-
],
59-
),),
60-
onTap: (){
61-
context.go('/playlist',extra: data[index]);
62-
},
63-
),
64-
itemCount: data.length,
65-
);
66-
}, loading: () => const Center(child: CircularProgressIndicator(),), error: (error, stack) => Center(child: Text('Error: $error'),),),
67-
);
43+
// return Scaffold(
44+
// appBar: AppBar(
45+
// centerTitle: false,
46+
// leading: IconButton(
47+
// onPressed: () {
48+
// SystemChrome.setEnabledSystemUIMode(
49+
// SystemUiMode.edgeToEdge,
50+
// );
51+
// },
52+
// icon: SimpleExtendedImage(
53+
// 'http://p1.music.126.net/bfipOCObq0KmuW4m0o31mQ==/109951168928616871.jpg?param=180y180',
54+
// borderRadius: BorderRadius.circular(90.w),
55+
// width: 75.w,
56+
// height: 75.w,
57+
// )),
58+
// title: const Text(
59+
// '晚上好',
60+
// style: TextStyle(fontWeight: FontWeight.w600),
61+
// ),
62+
// actions: [IconButton(onPressed: () {}, icon: const Icon(Icons.settings))],
63+
// ),
64+
// // body: newSong.when(
65+
// // data: (data) {
66+
// // return ListView.builder(
67+
// // padding: EdgeInsets.only(left: 30.w, right: 30.w, bottom: 100.w),
68+
// // itemBuilder: (context, index) => GestureDetector(
69+
// // child: Padding(
70+
// // padding: EdgeInsets.symmetric(vertical: 20.w),
71+
// // child: Row(
72+
// // children: [
73+
// // SimpleExtendedImage(
74+
// // '${data[index].coverImgUrl}?param=200y200',
75+
// // cacheWidth: 200,
76+
// // width: 90.w,
77+
// // height: 90.w,
78+
// // ),
79+
// // Padding(padding: EdgeInsets.symmetric(horizontal: 10.w)),
80+
// // Expanded(
81+
// // child: Text(data[index].name ?? ''),
82+
// // )
83+
// // ],
84+
// // ),
85+
// // ),
86+
// // onTap: () {
87+
// // context.go('/playlist', extra: data[index]);
88+
// // },
89+
// // ),
90+
// // itemCount: data.length,
91+
// // );
92+
// // },
93+
// // loading: () => const Center(
94+
// // child: CircularProgressIndicator(),
95+
// // ),
96+
// // error: (error, stack) => Center(
97+
// // child: Text('Error: $error'),
98+
// // ),
99+
// // ),
100+
// );
101+
return Container();
68102
}
69103

70-
71-
// audioServeHandler.changeQueueLists(mediaItem ?? [], index: index);
72-
}
104+
// audioServeHandler.changeQueueLists(mediaItem ?? [], index: index);
105+
}

lib/pages/a_rebuild/outside/outside.dart

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:audio_service/audio_service.dart';
22
import 'package:bujuan/pages/a_rebuild/outside/panel.dart';
33
import 'package:bujuan/widget/weslide/panel.dart';
44
import 'package:flutter/material.dart';
5+
import 'package:flutter/services.dart';
56
import 'package:flutter_riverpod/flutter_riverpod.dart';
67
import 'package:flutter_screenutil/flutter_screenutil.dart';
78
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
@@ -26,20 +27,24 @@ class Outside extends ConsumerWidget {
2627

2728
@override
2829
Widget build(BuildContext context, WidgetRef ref) {
29-
print('object===============outslider');
3030
return Scaffold(
31-
backgroundColor: const Color(0xff121212),
3231
body: SlidingUpPanel(
3332
body: child,
3433
boxShadow: const [],
3534
color: Colors.transparent,
3635
parallaxEnabled: true,
37-
parallaxOffset: .03,
36+
parallaxOffset: .01,
3837
maxHeight: MediaQuery.of(context).size.height,
3938
minHeight: 120.w + 70 + MediaQuery.of(context).padding.bottom,
40-
onPanelSlide: (double position) => ref.refresh(slideProvider.notifier).state = position,
39+
onPanelSlide: (double position) {
40+
ref.refresh(slideProvider.notifier).state = position;
41+
},
42+
4143
onPanelOpened: () => ref.refresh(isOpen.notifier).state = true,
42-
onPanelClosed: () => ref.refresh(isOpen.notifier).state = false,
44+
onPanelClosed: () {
45+
ref.refresh(isOpen.notifier).state = false;
46+
ref.read(pageController).animateTo(0, duration: const Duration(milliseconds: 10), curve: Curves.easeInOut);
47+
},
4348
panelBuilder: () => const Panel(),
4449
controller: ref.read(panelController),
4550
disableDraggableOnScrolling: false,
@@ -63,27 +68,27 @@ class Footer extends ConsumerWidget {
6368
height: 70,
6469
selectedIndex: selectIndex,
6570
iconSize: 24,
66-
showElevation: true,
71+
showElevation: false,
6772
onItemSelected: (index) {
6873
ref.refresh(indexProvider.notifier).state = index;
6974
context.go(ref.read(routers)[index]);
7075
},
7176
items: [
7277
ThebrioflashynavbarItem(
73-
icon: Icon(Icons.event),
74-
title: Text('主页'),
78+
icon: const Icon(Icons.home),
79+
title: const Text('Home'),
7580
),
7681
ThebrioflashynavbarItem(
77-
icon: Icon(Icons.search),
78-
title: Text('搜索'),
82+
icon: const Icon(Icons.search),
83+
title: const Text('Search'),
7984
),
8085
ThebrioflashynavbarItem(
81-
icon: Icon(Icons.highlight),
82-
title: Text('排行'),
86+
icon: const Icon(Icons.face),
87+
title: const Text('Top'),
8388
),
8489
ThebrioflashynavbarItem(
85-
icon: Icon(Icons.settings),
86-
title: Text('设置'),
90+
icon: const Icon(Icons.settings),
91+
title: const Text('Setting'),
8792
),
8893
],
8994
),

0 commit comments

Comments
 (0)