~repos /only-bible-app

#kotlin#android#ios

git clone https://pyrossh.dev/repos/only-bible-app.git

The only bible app you will ever need. No ads. No in-app purchases. No distractions.


4fe6dbb5 pyrossh

2 years ago
Improve settings dialog
lib/screens/bible_select_screen.dart CHANGED
@@ -1,3 +1,4 @@
1
+ import "package:flutter/cupertino.dart";
1
2
  import "package:flutter/material.dart";
2
3
  import "package:only_bible_app/state.dart";
3
4
  import "package:only_bible_app/models.dart";
@@ -13,6 +14,8 @@ class BibleSelectScreen extends StatelessWidget {
13
14
  final model = AppModel.of(context);
14
15
  return ScaffoldMenu(
15
16
  child: CustomScrollView(
17
+ // scrollBehavior: CupertinoScrollBehavior(),
18
+ // physics: BouncingScrollPhysics(),
16
19
  slivers: [
17
20
  const SliverHeading(title: "Bibles", showClose: true),
18
21
  SliverTileGrid(
lib/state.dart CHANGED
@@ -194,7 +194,10 @@ class ChapterViewModel extends ChangeNotifier {
194
194
  void onVerseSelected(BuildContext context, int i) {
195
195
  if (!isWide(context)) {
196
196
  if (selectedVerses.isEmpty) {
197
- Scaffold.of(context).showBottomSheet((context) => const ActionsSheet());
197
+ Scaffold.of(context).showBottomSheet(
198
+ clipBehavior: Clip.none,
199
+ (context) => const ActionsSheet(),
200
+ );
198
201
  }
199
202
  }
200
203
  if (selectedVerses.contains(i)) {
lib/theme.dart CHANGED
@@ -22,12 +22,11 @@ final lightTheme = ThemeData(
22
22
  elevation: 10,
23
23
  shadowColor: Colors.black,
24
24
  backgroundColor: Colors.white,
25
- // backgroundColor: Color(0xFFF2F2F7),
26
25
  surfaceTintColor: Colors.white,
26
+ clipBehavior: Clip.antiAliasWithSaveLayer,
27
- shape: Border(
27
+ shape: RoundedRectangleBorder(
28
- top: BorderSide(
28
+ borderRadius: BorderRadius.vertical(
29
- width: 1.5,
30
- color: Colors.black,
29
+ top: Radius.circular(25.0),
31
30
  ),
32
31
  ),
33
32
  ),
@@ -121,14 +120,10 @@ final darkTheme = ThemeData(
121
120
  appBarTheme: lightTheme.appBarTheme.copyWith(
122
121
  backgroundColor: const Color(0xFF1F1F22),
123
122
  ),
124
- bottomSheetTheme: const BottomSheetThemeData(
123
+ bottomSheetTheme: lightTheme.bottomSheetTheme.copyWith(
125
- elevation: 1,
126
- shape: Border(
124
+ shadowColor: const Color(0xFF4B3D60),
127
- top: BorderSide(
125
+ backgroundColor: const Color(0xFF26242C),
128
- width: 1.5,
129
- color: Color(0xAA5D4979),
126
+ surfaceTintColor: const Color(0xAA5D4979),
130
- ),
131
- ),
132
127
  ),
133
128
  dialogTheme: const DialogTheme(
134
129
  elevation: 1,
lib/widgets/actions_bar.dart CHANGED
@@ -9,6 +9,7 @@ class ActionsSheet extends StatelessWidget {
9
9
  Widget build(BuildContext context) {
10
10
  return BottomSheet(
11
11
  onClosing: () {},
12
+ shape: Theme.of(context).dialogTheme.shape,
12
13
  builder: (BuildContext ctx) => Container(
13
14
  padding: EdgeInsets.only(bottom: isIOS() ? 20 : 0),
14
15
  child: const Row(
lib/widgets/more_button.dart CHANGED
@@ -58,17 +58,9 @@ class _MoreButtonState extends State<MoreButton> {
58
58
  context: context,
59
59
  isDismissible: true,
60
60
  enableDrag: true,
61
- // showDragHandle: true,
62
61
  useSafeArea: true,
63
- // clipBehavior: Clip.antiAliasWithSaveLayer,
64
62
  builder: (context) => const SettingsSheet(),
65
63
  );
66
- // Scaffold.of(context).showBottomSheet(
67
- // (context) => const SettingsSheet(),
68
- // constraints: const BoxConstraints(
69
- // maxHeight: 400,
70
- // ),
71
- // );
72
64
  },
73
65
  icon: const Icon(Icons.more_vert),
74
66
  );
lib/widgets/settings_sheet.dart CHANGED
@@ -10,72 +10,93 @@ class SettingsSheet extends StatelessWidget {
10
10
  Widget build(BuildContext context) {
11
11
  final model = AppModel.of(context);
12
12
  final selectedBible = model.bible;
13
- // Navigator.pop(context);
13
+ final modeIcon = model.darkMode ? Icons.dark_mode : Icons.light_mode;
14
+ final modeIconColor = model.darkMode ? const Color(0xFF59EEFF) : const Color(0xFFE5B347);
14
- // Scaffold.of(context).showBodyScrim(false, 0.0);
15
+ final iconColor = Theme.of(context).textTheme.bodyMedium!.color;
16
+ return ColoredBox(
17
+ color: model.darkMode ? const Color(0xFF141415) : const Color(0xFFF2F2F7),
15
- return SettingsList(
18
+ child: SettingsList(
19
+ contentPadding: const EdgeInsets.only(top: 20),
16
- // lightTheme: SettingsThemeData(
20
+ lightTheme: const SettingsThemeData(
17
- // settingsListBackground: Colors.white,
21
+ settingsListBackground: Color(0xFFF2F2F7),
22
+ ),
23
+ darkTheme: const SettingsThemeData(
18
- // ),
24
+ settingsListBackground: Color(0xFF141415),
25
+ ),
19
- sections: [
26
+ sections: [
20
- SettingsSection(
27
+ SettingsSection(
21
- // margin: EdgeInsetsDirectional.symmetric(horizontal: 5),
28
+ margin: const EdgeInsetsDirectional.symmetric(horizontal: 20),
22
- tiles: [
29
+ tiles: [
23
- SettingsTile(
30
+ SettingsTile(
31
+ title: const Text(
24
- title: const Text("Settings"),
32
+ "Settings",
25
- ),
26
- SettingsTile.navigation(
27
- leading: const Icon(Icons.language, color: Colors.green),
28
- title: const Text("Language"),
29
- value: const Text("English"),
30
- ),
31
- SettingsTile.navigation(
32
- leading: const Icon(Icons.book_outlined, color: Colors.blueAccent),
33
- title: const Text("Bible"),
34
- value: Text(selectedBible.name),
35
- onPressed: (_) {
36
- Navigator.of(context).push(
37
- createNoTransitionPageRoute(
38
- const BibleSelectScreen(),
33
+ style: TextStyle(
34
+ fontSize: 16,
35
+ fontWeight: FontWeight.w700,
39
36
  ),
40
- );
37
+ ),
38
+ trailing: IconButton(
39
+ padding: EdgeInsets.zero,
40
+ icon: Icon(Icons.close, color: iconColor),
41
- return null;
41
+ onPressed: () {
42
+ Navigator.of(context).pop();
42
- },
43
+ },
43
- ),
44
+ ),
44
- SettingsTile.switchTile(
45
- onToggle: (value) {
46
- model.toggleMode();
47
- },
48
- initialValue: model.darkMode,
49
- leading: const Icon(Icons.dark_mode_outlined),
50
- title: const Text("Dark mode"),
51
- ),
52
- SettingsTile.switchTile(
53
- onToggle: (value) {
54
- model.toggleBold();
55
- },
56
- initialValue: model.fontBold,
57
- leading: const Icon(Icons.format_bold_outlined),
58
- title: const Text("Bold font"),
59
- ),
60
- SettingsTile(
61
- title: const Text("Increase font size"),
62
- leading: const Icon(Icons.font_download),
63
- trailing: IconButton(
64
- onPressed: model.increaseFont,
65
- icon: const Icon(Icons.add_circle_outline, size: 32, color: Colors.redAccent),
66
45
  ),
67
- ),
68
- SettingsTile(
46
+ SettingsTile.navigation(
47
+ leading: const Icon(Icons.language, color: Colors.green),
69
- title: const Text("Decrease font size"),
48
+ title: const Text("Language"),
70
- leading: const Icon(Icons.font_download),
49
+ value: const Text("English"),
71
- trailing: IconButton(
72
- onPressed: model.decreaseFont,
73
- icon: const Icon(Icons.remove_circle_outline, size: 32, color: Colors.blueAccent),
74
50
  ),
51
+ SettingsTile.navigation(
52
+ leading: const Icon(Icons.book_outlined, color: Colors.blueAccent),
53
+ title: const Text("Bible"),
54
+ value: Text(selectedBible.name),
55
+ onPressed: (c) {
56
+ Navigator.of(c).pushReplacement(
57
+ createNoTransitionPageRoute(
58
+ const BibleSelectScreen(),
75
- ),
59
+ ),
60
+ );
61
+ return null;
62
+ },
63
+ ),
64
+ SettingsTile.switchTile(
65
+ onToggle: (value) {
66
+ model.toggleMode();
67
+ },
68
+ initialValue: model.darkMode,
69
+ leading: Icon(modeIcon, color: modeIconColor),
70
+ title: const Text("Dark mode"),
71
+ ),
72
+ SettingsTile.switchTile(
73
+ onToggle: (value) {
74
+ model.toggleBold();
75
+ },
76
+ initialValue: model.fontBold,
77
+ leading: Icon(Icons.format_bold, color: iconColor),
78
+ title: const Text("Bold font"),
79
+ ),
80
+ SettingsTile(
81
+ title: const Text("Increase font size"),
82
+ leading: Icon(Icons.font_download, color: iconColor),
83
+ trailing: IconButton(
84
+ onPressed: model.increaseFont,
85
+ icon: const Icon(Icons.add_circle_outline, size: 32, color: Colors.redAccent),
86
+ ),
87
+ ),
88
+ SettingsTile(
89
+ title: const Text("Decrease font size"),
90
+ leading: Icon(Icons.font_download, color: iconColor),
91
+ trailing: IconButton(
92
+ onPressed: model.decreaseFont,
93
+ icon: const Icon(Icons.remove_circle_outline, size: 32, color: Colors.blueAccent),
94
+ ),
95
+ ),
76
- ],
96
+ ],
77
- ),
97
+ ),
78
- ],
98
+ ],
99
+ ),
79
100
  );
80
101
  }
81
102
  }