This commit is contained in:
cxc
2023-02-07 17:28:01 +08:00
parent ac65c1dec0
commit 06ff4a41f4
25 changed files with 537 additions and 184 deletions

View File

@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:momo/material/gallery.dart';
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@ -14,16 +16,21 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.pinkAccent,
title: const Text("APP"),
title: const Text(
"App Header",
style: TextStyle(fontWeight: FontWeight.bold),
),
elevation: 10,
),
body: Row(
children: [
MediaQuery.of(context).size.width > 640
? NavigationRail(
elevation: 10,
backgroundColor: const Color(0xffebf6f5),
leading: MediaQuery.of(context).size.width >= 1008
? const Text(
"Header",
"Side Header",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 36),
)
@ -43,11 +50,13 @@ class _HomePageState extends State<HomePage> {
selectedIndex: selectedIndex)
: const SizedBox(
width: 0,
)
),
Expanded(child: pageList[selectedIndex])
],
),
bottomNavigationBar: MediaQuery.of(context).size.width <= 640
? BottomNavigationBar(
elevation: 10,
currentIndex: selectedIndex,
onTap: (idx) {
setState(() {
@ -63,3 +72,10 @@ class _HomePageState extends State<HomePage> {
);
}
}
List<Widget> pageList = [
Gallery(),
Scaffold(
body: Placeholder(),
)
];