tuuli_app/lib/pages/not_found_page.dart

47 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
class NotFoundPage extends StatefulWidget {
const NotFoundPage({super.key});
@override
State<StatefulWidget> createState() => _NotFoundPageState();
}
class _NotFoundPageState extends State<NotFoundPage>
with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text(
'Страница не найдена',
style: Theme.of(context).textTheme.headlineMedium,
),
),
bottomSheet: Container(
color: Colors.black.withAlpha(100),
padding: const EdgeInsets.all(16),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (Navigator.of(context).canPop())
ElevatedButton(
onPressed: () {
Get.back(canPop: false);
},
child: const Text('Назад'),
),
const SizedBox(width: 16),
ElevatedButton(
onPressed: () {
Get.offAllNamed("/");
},
child: const Text('Домой'),
),
],
),
),
);
}
}