-
Notifications
You must be signed in to change notification settings - Fork 1
/
new_page.dart
48 lines (44 loc) · 1.34 KB
/
new_page.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
import 'package:fantasypl/core/navigation/navigation_bloc.dart';
import 'package:fantasypl/core/ui/text/core_text.dart';
import 'package:fantasypl/features/auth/presentation/bloc/login_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class $NAME$Page extends StatelessWidget {
static final pageKey = ValueKey("$$$NAME$Page");
@override
Key? get key => $NAME$Page.pageKey;
@override
Widget build(BuildContext context) {
return BlocProvider<$NAME$Bloc>(
create: (context) => $NAME$Bloc(),
child: _$NAME$PageContent(),
);
}
}
class _$NAME$PageContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: [
AppBar(),
Expanded(
child: BlocBuilder<$NAME$Bloc, $NAME$State>(
builder: (context, $NAME$State state) {
if (state.isLoading) {
return Center(child: CircularProgressIndicator());
} else if (state.isError) {
return Center(child: CoreText.titleSm("Error"));
} else {
return const SizedBox();
}
},
),
),
],
),
),
);
}
}