This commit is contained in:
cxc
2023-02-09 17:07:14 +08:00
parent 1b88c226ad
commit 2aa59649a8
16 changed files with 156 additions and 41 deletions

View File

@ -21,6 +21,7 @@ class _HomePageState extends ConsumerState<HomePage> {
{"path": "/", "title": "相册"},
{"path": "/profile", "title": "用户"}
];
int key = 0;
@override
Widget build(BuildContext context) {
@ -58,26 +59,25 @@ class _HomePageState extends ConsumerState<HomePage> {
contentType: MediaType(mimeType!.split("/").first,
mimeType.split("/").last))
});
await dio.post("/image/upload", data: data);
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: const [
Icon(
Icons.check_circle,
color: Colors.white,
),
SizedBox(
width: 10,
),
Text("上传成功")
],
),
backgroundColor: Colors.lightGreen,
));
await dio.post("/image/upload", data: data).then((value) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: const [
Icon(
Icons.check_circle,
color: Colors.white,
),
SizedBox(
width: 10,
),
Text("上传成功")
],
),
backgroundColor: Colors.lightGreen,
));
});
} else {}
// context.go("/login");
},
child: const Icon(Icons.add),
)
@ -99,7 +99,9 @@ class _HomePageState extends ConsumerState<HomePage> {
setState(() {
selectedIndex = idx;
});
context.go(tabList[idx]["path"] ?? "");
context.go(Uri(
path: tabList[idx]["path"] ?? "",
).toString());
},
destinations: const [
NavigationRailDestination(