-
Notifications
You must be signed in to change notification settings - Fork 11
/
not_found_view.dart
79 lines (70 loc) · 2.68 KB
/
not_found_view.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:stacked/stacked.dart';
// Project imports:
import 'package:notredame/features/app/error/not_found/not_found_viewmodel.dart';
import 'package:notredame/utils/app_theme.dart';
class NotFoundView extends StatefulWidget {
final String? pageName;
const NotFoundView({super.key, this.pageName});
@override
State<NotFoundView> createState() => _NotFoundState();
}
class _NotFoundState extends State<NotFoundView> {
late NotFoundViewModel viewModel;
_NotFoundState();
@override
void initState() {
viewModel = NotFoundViewModel(pageName: widget.pageName ?? '');
super.initState();
}
@override
Widget build(BuildContext context) =>
ViewModelBuilder<NotFoundViewModel>.nonReactive(
viewModelBuilder: () => viewModel,
builder: (context, model, child) => Scaffold(
body: Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(
bottom: 80,
),
child: Text(
AppIntl.of(context)!.not_found_title,
style: const TextStyle(
fontSize: 25, fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.only(
bottom: 70,
),
child: Text(
AppIntl.of(context)!
.not_found_message(model.notFoundPageName),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 15,
),
),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AppTheme.primary,
),
onPressed: () {
model.navigateToDashboard();
},
child: Text(AppIntl.of(context)!.go_to_dashboard),
),
],
),
),
),
));
}