88 lines
2.7 KiB
Dart
88 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:skywood/main/lib_file.dart';
|
|
import 'package:skywood/pages/like/pages/collection_page.dart';
|
|
import 'package:skywood/pages/like/pages/play_log_page.dart';
|
|
import 'package:skywood/pages/like/widget/like_header.dart';
|
|
import 'package:skywood/pages/widgets/common_bg_page.dart';
|
|
import 'package:skywood/pages/widgets/pixel_widgets.dart';
|
|
import 'package:skywood/utils/extend/app_keep_alive.dart';
|
|
import 'package:skywood/utils/tools/app_sp.dart';
|
|
|
|
class LikePage extends StatefulWidget {
|
|
const LikePage({super.key});
|
|
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return _MainRootState();
|
|
}
|
|
}
|
|
|
|
class _MainRootState extends State<LikePage> {
|
|
PageController _pageController = PageController(initialPage: 0);
|
|
int _currentIndex = 0;
|
|
static const String _keyIndex = 'LIKE_PAGE_INDEX';
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_loadInitIndex();
|
|
|
|
|
|
}
|
|
|
|
_loadInitIndex() async {
|
|
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CommonBgPage(
|
|
child: SafeArea(
|
|
bottom: false,
|
|
child: Padding(
|
|
padding: EdgeInsets.only(left: 15.w, right: 15.w,
|
|
top: AppScreen.isIos ? 0 : 20.h,
|
|
bottom: (AppScreen.isIos ? 30.h : 10.h)+50.h
|
|
),
|
|
child: Stack(
|
|
children: [
|
|
HelpImg.asset(ConstImg.likeBg, width: AppScreen.screenWidth - 30.w, height: 700.h,
|
|
fit: BoxFit.fill,
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
|
child: Column(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.only(left: 10, top: 10),
|
|
child: LikeHeader(
|
|
initIndex: _currentIndex,
|
|
onSelectedIndex: (index) {
|
|
_pageController.jumpToPage(index);
|
|
_currentIndex = index;
|
|
},
|
|
),
|
|
),
|
|
// 主页面
|
|
Expanded(
|
|
child: PageView(
|
|
controller: _pageController,
|
|
children: [
|
|
CollectionPage(),
|
|
PlayLogPage()
|
|
// AppKeepAlive(child: CollectionPage()),
|
|
// AppKeepAlive(child: PlayLogPage())
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
)),
|
|
);
|
|
}
|
|
}
|
|
|