1
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:derma_flutter/page/my/my_page.dart';
|
||||
import 'package:derma_flutter/page/record/list/record_list_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:remixicon/remixicon.dart';
|
||||
@@ -15,30 +16,35 @@ class LayoutPage extends StatefulWidget {
|
||||
|
||||
class _LayoutPageState extends State<LayoutPage> {
|
||||
///分页
|
||||
final PageController _pageController = PageController(initialPage: 1);
|
||||
final PageController _pageController = PageController(initialPage: 0);
|
||||
|
||||
int get currentPage {
|
||||
if (!_pageController.hasClients) return 1; // 没 attach 直接 0
|
||||
return _pageController.page?.round() ?? 1;
|
||||
}
|
||||
|
||||
//tabbar列表
|
||||
//TabBar列表
|
||||
final List<PageItem> _pages = [
|
||||
PageItem(
|
||||
name: "record",
|
||||
icon: RemixIcons.history_line,
|
||||
page: RecordListPage(),
|
||||
),
|
||||
PageItem(
|
||||
name: "Home",
|
||||
icon: RemixIcons.home_2_line,
|
||||
page: HomePage(),
|
||||
),
|
||||
PageItem(
|
||||
name: "Home",
|
||||
name: "Record",
|
||||
icon: RemixIcons.history_line,
|
||||
page: RecordListPage(),
|
||||
),
|
||||
PageItem(
|
||||
name: "Book",
|
||||
icon: RemixIcons.book_open_line,
|
||||
page: EducationListPage(),
|
||||
),
|
||||
PageItem(
|
||||
name: "My",
|
||||
icon: RemixIcons.user_line,
|
||||
page: MyPage(),
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
@@ -50,6 +56,7 @@ class _LayoutPageState extends State<LayoutPage> {
|
||||
children: _pages.map((item) => item.page).toList(),
|
||||
),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
type: BottomNavigationBarType.fixed,
|
||||
currentIndex: currentPage,
|
||||
onTap: (index) {
|
||||
_pageController.jumpToPage(index);
|
||||
|
||||
@@ -53,8 +53,6 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
||||
quality: 85,
|
||||
rotate: 0,
|
||||
);
|
||||
print("压缩前:${File(path).lengthSync()}");
|
||||
print("压缩后长度${result?.length}");
|
||||
EasyLoading.show(
|
||||
status: 'Skin analysis in progress, please wait...',
|
||||
maskType: EasyLoadingMaskType.clear,
|
||||
|
||||
@@ -36,7 +36,7 @@ class UploadBox extends StatelessWidget {
|
||||
left: 0,
|
||||
child: Image.asset(
|
||||
"assets/image/bg_hushi.png",
|
||||
width: 0.7.sw,
|
||||
width: 0.63.sw,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
23
lib/page/my/my_page.dart
Normal file
23
lib/page/my/my_page.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../widgets/common/app_backend.dart';
|
||||
|
||||
class MyPage extends StatefulWidget {
|
||||
const MyPage({super.key});
|
||||
|
||||
@override
|
||||
State<MyPage> createState() => _MyPageState();
|
||||
}
|
||||
|
||||
class _MyPageState extends State<MyPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBackend(
|
||||
child: Column(
|
||||
children: [
|
||||
Text("ds")
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
left: 20,
|
||||
right: 20,
|
||||
),
|
||||
child: Column(
|
||||
child: ListView(
|
||||
children: [
|
||||
LogoBox(),
|
||||
PageHeader(),
|
||||
|
||||
@@ -22,7 +22,7 @@ class AppBackend extends StatelessWidget {
|
||||
stops: [0, 0.6, 1],
|
||||
),
|
||||
),
|
||||
child: child,
|
||||
child: SafeArea(child: child),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,6 @@ class AppHeader extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AppHeaderState extends State<AppHeader> {
|
||||
void _handLogout() {
|
||||
var appStore = context.read<AppStore>();
|
||||
appStore.logout();
|
||||
context.go(RoutePaths.login);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -48,31 +43,6 @@ class _AppHeaderState extends State<AppHeader> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
PopupMenuButton(
|
||||
offset: const Offset(0, 50),
|
||||
color: Theme.of(context).cardColor,
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
onTap: _handLogout,
|
||||
child: Text("Log out"),
|
||||
),
|
||||
];
|
||||
},
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(RemixIcons.user_3_line, color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user