@@ -22,141 +22,145 @@ class NavigationBibleDivisionsView extends StackedView<NavigationBibleDivisionsV
2222 NavigationBibleDivisionsViewModel viewModel,
2323 Widget ? child,
2424 ) {
25- return Scaffold (
26- backgroundColor: context.theme.appColors.background,
27- appBar: AppBar (
25+ return PopScope (
26+ canPop: false ,
27+ onPopInvoked: viewModel.onPopInvoked,
28+ child: Scaffold (
2829 backgroundColor: context.theme.appColors.background,
29- centerTitle: true ,
30- scrolledUnderElevation: 0.0 ,
31- title: Text (
32- viewModel.getTitle (),
33- style: TextStyle (
34- color: context.theme.appColors.primary,
35- fontSize: 18.0 ,
36- fontWeight: FontWeight .w500,
30+ appBar: AppBar (
31+ backgroundColor: context.theme.appColors.background,
32+ centerTitle: true ,
33+ scrolledUnderElevation: 0.0 ,
34+ title: Text (
35+ viewModel.getTitle (),
36+ style: TextStyle (
37+ color: context.theme.appColors.primary,
38+ fontSize: 18.0 ,
39+ fontWeight: FontWeight .w500,
40+ ),
3741 ),
3842 ),
39- ),
40- body : Container (
41- padding : const EdgeInsets . only (top : 12.0 ),
42- child : Column (
43- mainAxisSize : MainAxisSize .min,
44- children : [
45- Expanded (
46- child : ListView . builder (
47- itemCount : booksMapping.keys.length,
48- itemBuilder : ( BuildContext context, int index) {
49- String bibleDivisionCode = BooksMapping . bibleDivisionCodeFromIndex (index);
50- return InkWell (
51- onTap : () => viewModel. onTapBibleDivisionItem (bibleDivisionCode),
52- child : Padding (
53- padding : const EdgeInsets . symmetric (vertical : 15.0 , horizontal : 25.0 ),
54- child : Row (
55- mainAxisAlignment : MainAxisAlignment .spaceBetween ,
56- crossAxisAlignment : CrossAxisAlignment .center,
57- children : [
58- Row (
59- children : [
60- Align (
61- alignment : Alignment .topLeft,
62- child : Padding (
63- padding : const EdgeInsets . only (bottom : 13.0 , right : 8 ),
64- child : BibleDivisionIndicator (
65- color : BooksMapping . colorFromBibleDivisionCode (bibleDivisionCode ),
43+ body : Container (
44+ padding : const EdgeInsets . only (top : 12.0 ),
45+ child : Column (
46+ mainAxisSize : MainAxisSize .min,
47+ children : [
48+ Expanded (
49+ child : ListView . builder (
50+ itemCount : booksMapping.keys.length,
51+ itemBuilder : ( BuildContext context, int index) {
52+ String bibleDivisionCode = BooksMapping . bibleDivisionCodeFromIndex ( index);
53+ return InkWell (
54+ onTap : () => viewModel. onTapBibleDivisionItem (bibleDivisionCode),
55+ child : Padding (
56+ padding : const EdgeInsets . symmetric (vertical : 15.0 , horizontal : 25.0 ),
57+ child : Row (
58+ mainAxisAlignment : MainAxisAlignment .spaceBetween,
59+ crossAxisAlignment : CrossAxisAlignment .center ,
60+ children : [
61+ Row (
62+ children : [
63+ Align (
64+ alignment : Alignment .topLeft,
65+ child : Padding (
66+ padding : const EdgeInsets . only (bottom : 13.0 , right : 8 ),
67+ child : BibleDivisionIndicator (
68+ color : BooksMapping . colorFromBibleDivisionCode (bibleDivisionCode),
69+ ),
6670 ),
6771 ),
68- ),
69- Text (
70- BooksMapping . bibleDivisionNameFromCode (bibleDivisionCode),
71- style : TextStyle (
72- color : context.theme.appColors.primary ,
73- fontSize : 16.0 ,
72+ Text (
73+ BooksMapping . bibleDivisionNameFromCode (bibleDivisionCode),
74+ style : TextStyle (
75+ color : context.theme.appColors.primary,
76+ fontSize : 16.0 ,
77+ ) ,
7478 ),
75- ) ,
76- ] ,
77- ),
78- PhosphorIcon (
79- PhosphorIcons . caretRight ( PhosphorIconsStyle .bold) ,
80- color : context.theme.appColors.primary ,
81- size : 18.0 ,
82- semanticLabel : 'Caret right' ,
83- ) ,
84- ] ,
79+ ] ,
80+ ) ,
81+ PhosphorIcon (
82+ PhosphorIcons . caretRight ( PhosphorIconsStyle .bold),
83+ color : context.theme.appColors.primary ,
84+ size : 18.0 ,
85+ semanticLabel : 'Caret right' ,
86+ ) ,
87+ ] ,
88+ ) ,
8589 ),
86- ),
87- );
88- } ,
90+ );
91+ },
92+ ) ,
8993 ),
90- ),
91- Container (
92- color: context.theme.appColors.appbarBackground,
93- padding: const EdgeInsets .symmetric (vertical: 10.0 , horizontal: 25.0 ),
94- child: Column (
95- children: [
96- Row (
97- children: [
98- PhosphorIcon (
99- PhosphorIcons .clockCounterClockwise (PhosphorIconsStyle .regular),
100- color: context.theme.appColors.primaryOnDark,
101- size: 16.0 ,
102- ),
103- const SizedBox (width: 4 ),
104- Text (
105- 'RECENT' ,
106- style: TextStyle (
94+ Container (
95+ color: context.theme.appColors.appbarBackground,
96+ padding: const EdgeInsets .symmetric (vertical: 10.0 , horizontal: 25.0 ),
97+ child: Column (
98+ children: [
99+ Row (
100+ children: [
101+ PhosphorIcon (
102+ PhosphorIcons .clockCounterClockwise (PhosphorIconsStyle .regular),
107103 color: context.theme.appColors.primaryOnDark,
108- fontSize: 12.0 ,
109- fontWeight: FontWeight .w500,
104+ size: 16.0 ,
110105 ),
111- ),
112- ],
113- ),
114- const SizedBox (height: 7.0 ),
115- SizedBox (
116- height: 50 ,
117- child: viewModel.recentBooks.isNotEmpty
118- ? GridView .builder (
119- itemCount: viewModel.recentBooks.length,
120- gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent (
121- maxCrossAxisExtent: 120 ,
122- childAspectRatio: 4 / 2 ,
123- crossAxisSpacing: 18 ,
124- mainAxisSpacing: 8 ,
125- ),
126- itemBuilder: (BuildContext context, int index) {
127- String bookCode = viewModel.recentBooks.elementAt (index);
128- return InkWell (
129- borderRadius: BorderRadius .circular (12.0 ),
130- onTap: () => viewModel.onTapRecentBookItem (bookCode),
131- child: Center (
132- child: Text (
133- BooksMapping .bookNameFromBookCode (bookCode),
134- maxLines: 1 ,
135- overflow: TextOverflow .ellipsis,
136- style: TextStyle (
137- color: context.theme.appColors.primaryOnDark,
138- fontSize: 16.0 ,
106+ const SizedBox (width: 4 ),
107+ Text (
108+ 'RECENT' ,
109+ style: TextStyle (
110+ color: context.theme.appColors.primaryOnDark,
111+ fontSize: 12.0 ,
112+ fontWeight: FontWeight .w500,
113+ ),
114+ ),
115+ ],
116+ ),
117+ const SizedBox (height: 7.0 ),
118+ SizedBox (
119+ height: 50 ,
120+ child: viewModel.recentBooks.isNotEmpty
121+ ? GridView .builder (
122+ itemCount: viewModel.recentBooks.length,
123+ gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent (
124+ maxCrossAxisExtent: 120 ,
125+ childAspectRatio: 4 / 2 ,
126+ crossAxisSpacing: 18 ,
127+ mainAxisSpacing: 8 ,
128+ ),
129+ itemBuilder: (BuildContext context, int index) {
130+ String bookCode = viewModel.recentBooks.elementAt (index);
131+ return InkWell (
132+ borderRadius: BorderRadius .circular (12.0 ),
133+ onTap: () => viewModel.onTapRecentBookItem (bookCode),
134+ child: Center (
135+ child: Text (
136+ BooksMapping .bookNameFromBookCode (bookCode),
137+ maxLines: 1 ,
138+ overflow: TextOverflow .ellipsis,
139+ style: TextStyle (
140+ color: context.theme.appColors.primaryOnDark,
141+ fontSize: 16.0 ,
142+ ),
139143 ),
140144 ),
145+ );
146+ },
147+ )
148+ : Padding (
149+ padding: const EdgeInsets .only (top: 14.0 ),
150+ child: Text (
151+ 'Your recent books will appear here.' ,
152+ style: TextStyle (
153+ color: context.theme.appColors.secondaryOnDark,
154+ fontSize: 13.0 ,
141155 ),
142- );
143- },
144- )
145- : Padding (
146- padding: const EdgeInsets .only (top: 14.0 ),
147- child: Text (
148- 'Your recent books will appear here.' ,
149- style: TextStyle (
150- color: context.theme.appColors.secondaryOnDark,
151- fontSize: 13.0 ,
152156 ),
153157 ),
154- ),
155- ) ,
156- ] ,
158+ ),
159+ ] ,
160+ ) ,
157161 ),
158- ) ,
159- ] ,
162+ ] ,
163+ ) ,
160164 ),
161165 ),
162166 );
0 commit comments