24
This commit is contained in:
@@ -1,30 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:iroute/components/components.dart';
|
||||
|
||||
class EmptyPage extends StatelessWidget {
|
||||
const EmptyPage({super.key});
|
||||
final String msg;
|
||||
const EmptyPage({super.key, required this.msg});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: Text('界面走丢了'),
|
||||
// ),
|
||||
body: Scaffold(
|
||||
body: Center(
|
||||
child: Wrap(
|
||||
spacing: 16,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
direction: Axis.vertical,
|
||||
return DragToMoveWrap(
|
||||
child: Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(46),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.nearby_error,size: 64, color: Colors.grey),
|
||||
const SizedBox(width: 20,),
|
||||
Text(
|
||||
'404 界面丢失',
|
||||
style: TextStyle(fontSize: 24, color: Colors.grey),
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Spacer(),
|
||||
const WindowButtons()
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: Wrap(
|
||||
spacing: 16,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
direction: Axis.vertical,
|
||||
children: [
|
||||
Icon(Icons.nearby_error,size: 64, color: Colors.redAccent),
|
||||
Text(
|
||||
msg,
|
||||
style: TextStyle(fontSize: 24, color: Colors.grey),
|
||||
),
|
||||
ElevatedButton(onPressed: (){
|
||||
context.go('/');
|
||||
}, child: Text('返回首页'))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
30
lib/v11/pages/empty/empty_panel.dart
Normal file
30
lib/v11/pages/empty/empty_panel.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:iroute/components/components.dart';
|
||||
|
||||
class EmptyPanel extends StatelessWidget {
|
||||
final String msg;
|
||||
const EmptyPanel({super.key, required this.msg});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Wrap(
|
||||
spacing: 16,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
direction: Axis.vertical,
|
||||
children: [
|
||||
Icon(Icons.nearby_error,size: 64, color: Colors.redAccent),
|
||||
Text(
|
||||
msg,
|
||||
style: TextStyle(fontSize: 24, color: Colors.grey),
|
||||
),
|
||||
ElevatedButton(onPressed: (){
|
||||
context.go('/');
|
||||
}, child: Text('返回首页'))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user