-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
today_materials_page.dart
52 lines (50 loc) · 1.96 KB
/
today_materials_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
49
50
51
52
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:genshindb/application/bloc.dart';
import 'package:genshindb/generated/l10n.dart';
import 'package:genshindb/presentation/shared/loading.dart';
import 'widgets/sliver_character_ascension_materials.dart';
import 'widgets/sliver_weapon_ascension_materials.dart';
class TodayMaterialsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final s = S.of(context);
return BlocBuilder<TodayMaterialsBloc, TodayMaterialsState>(
builder: (context, state) {
return state.when(
loading: () => const Loading(),
loaded: (charsMaterials, weaponMaterials) => Scaffold(
appBar: AppBar(title: Text(s.materials)),
body: SafeArea(
child: CustomScrollView(
slivers: [
SliverPadding(
padding: const EdgeInsets.only(left: 10, top: 10),
sliver: SliverToBoxAdapter(
child: Text(
s.forCharacters,
style: theme.textTheme.subtitle1!.copyWith(fontWeight: FontWeight.bold),
),
),
),
SliverCharacterAscensionMaterials(charAscMaterials: charsMaterials, useListView: false),
SliverPadding(
padding: const EdgeInsets.only(left: 10, top: 10),
sliver: SliverToBoxAdapter(
child: Text(
s.forWeapons,
style: theme.textTheme.subtitle1!.copyWith(fontWeight: FontWeight.bold),
),
),
),
SliverWeaponAscensionMaterials(weaponAscMaterials: weaponMaterials, useListView: false),
],
),
),
),
);
},
);
}
}