~repos /only-bible-app
git clone
https://pyrossh.dev/repos/only-bible-app.git
Discussions:
https://groups.google.com/g/rust-embed-devs
The only bible app you will ever need. No ads. No in-app purchases. No distractions.
e0801c89
—
pyrossh 2 years ago
improve actions sheet
- README.md +1 -1
- lib/state.dart +2 -2
- lib/theme.dart +3 -1
- lib/widgets/actions_bar.dart +0 -24
- lib/widgets/actions_sheet.dart +21 -0
- lib/widgets/verses_view.dart +30 -25
README.md
CHANGED
|
@@ -75,4 +75,4 @@ Note:
|
|
|
75
75
|
1. Add Sqlite for highlighting, notes, chapter verses
|
|
76
76
|
2. Custom Selection should show action bar instead of tooltip/popup menu
|
|
77
77
|
3. Figure out history
|
|
78
|
-
4. Add more text compact/loose
|
|
78
|
+
4. Add more text options compact/loose, line spacing
|
lib/state.dart
CHANGED
|
@@ -11,7 +11,7 @@ import "package:just_audio/just_audio.dart";
|
|
|
11
11
|
import "package:only_bible_app/screens/chapter_view_screen.dart";
|
|
12
12
|
import "package:only_bible_app/utils/dialog.dart";
|
|
13
13
|
import "package:only_bible_app/models.dart";
|
|
14
|
-
import "package:only_bible_app/widgets/
|
|
14
|
+
import "package:only_bible_app/widgets/actions_sheet.dart";
|
|
15
15
|
import "package:provider/provider.dart";
|
|
16
16
|
import "package:shared_preferences/shared_preferences.dart";
|
|
17
17
|
|
|
@@ -205,7 +205,7 @@ class ChapterViewModel extends ChangeNotifier {
|
|
|
205
205
|
if (!isWide(context)) {
|
|
206
206
|
if (selectedVerses.isEmpty) {
|
|
207
207
|
Scaffold.of(context).showBottomSheet(
|
|
208
|
-
clipBehavior: Clip.none,
|
|
208
|
+
// clipBehavior: Clip.none,
|
|
209
209
|
(context) => const ActionsSheet(),
|
|
210
210
|
);
|
|
211
211
|
}
|
lib/theme.dart
CHANGED
|
@@ -27,7 +27,9 @@ final lightTheme = ThemeData(
|
|
|
27
27
|
elevation: 10,
|
|
28
28
|
backgroundColor: Color(0xFFF2F2F7),
|
|
29
29
|
shadowColor: Colors.black,
|
|
30
|
-
surfaceTintColor: Colors.
|
|
30
|
+
surfaceTintColor: Colors.black,
|
|
31
|
+
showDragHandle: true,
|
|
32
|
+
dragHandleSize: Size(50, 3),
|
|
31
33
|
clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
32
34
|
shape: RoundedRectangleBorder(
|
|
33
35
|
borderRadius: BorderRadius.vertical(
|
lib/widgets/actions_bar.dart
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import "package:flutter/material.dart";
|
|
2
|
-
import "package:only_bible_app/state.dart";
|
|
3
|
-
import "package:only_bible_app/widgets/play_button.dart";
|
|
4
|
-
|
|
5
|
-
class ActionsSheet extends StatelessWidget {
|
|
6
|
-
const ActionsSheet({super.key});
|
|
7
|
-
|
|
8
|
-
@override
|
|
9
|
-
Widget build(BuildContext context) {
|
|
10
|
-
return BottomSheet(
|
|
11
|
-
onClosing: () {},
|
|
12
|
-
shape: Theme.of(context).dialogTheme.shape,
|
|
13
|
-
builder: (BuildContext ctx) => Container(
|
|
14
|
-
padding: EdgeInsets.only(bottom: isIOS() ? 20 : 0),
|
|
15
|
-
child: const Row(
|
|
16
|
-
mainAxisAlignment: MainAxisAlignment.center,
|
|
17
|
-
children: [
|
|
18
|
-
PlayButton(),
|
|
19
|
-
],
|
|
20
|
-
),
|
|
21
|
-
),
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
}
|
lib/widgets/actions_sheet.dart
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "package:flutter/material.dart";
|
|
2
|
+
import "package:only_bible_app/state.dart";
|
|
3
|
+
import "package:only_bible_app/widgets/play_button.dart";
|
|
4
|
+
|
|
5
|
+
class ActionsSheet extends StatelessWidget {
|
|
6
|
+
const ActionsSheet({super.key});
|
|
7
|
+
|
|
8
|
+
@override
|
|
9
|
+
Widget build(BuildContext context) {
|
|
10
|
+
return Container(
|
|
11
|
+
color: Theme.of(context).colorScheme.background,
|
|
12
|
+
padding: EdgeInsets.only(bottom: isIOS() ? 20 : 0),
|
|
13
|
+
child: const Row(
|
|
14
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
|
15
|
+
children: [
|
|
16
|
+
PlayButton(),
|
|
17
|
+
],
|
|
18
|
+
),
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
lib/widgets/verses_view.dart
CHANGED
|
@@ -8,9 +8,10 @@ class VersesView extends StatelessWidget {
|
|
|
8
8
|
|
|
9
9
|
@override
|
|
10
10
|
Widget build(BuildContext context) {
|
|
11
|
-
final
|
|
11
|
+
final app = AppModel.of(context);
|
|
12
12
|
final model = ChapterViewModel.of(context);
|
|
13
13
|
final chapter = ChapterViewModel.selectedChapter(context);
|
|
14
|
+
final textStyle = DefaultTextStyle.of(context).style;
|
|
14
15
|
return SwipeDetector(
|
|
15
16
|
onSwipeLeft: (offset) {
|
|
16
17
|
model.onNext(context, model.book, model.chapter);
|
|
@@ -23,41 +24,45 @@ class VersesView extends StatelessWidget {
|
|
|
23
24
|
child: SelectableText.rich(
|
|
24
25
|
scrollPhysics: const BouncingScrollPhysics(),
|
|
25
26
|
contextMenuBuilder: null,
|
|
26
|
-
textScaleFactor: textScaleFactor,
|
|
27
|
+
textScaleFactor: app.textScaleFactor,
|
|
27
28
|
// onSelectionChanged: (selection, _) {
|
|
28
29
|
// // Show copy, highlight, note, audio, share
|
|
29
30
|
// //bottom: 55, // TODO: maybe make this 55 only when actions bar is shown else 20
|
|
30
31
|
// },
|
|
31
32
|
TextSpan(
|
|
33
|
+
style: app.fontBold
|
|
32
|
-
|
|
34
|
+
? textStyle.copyWith(
|
|
35
|
+
fontWeight: FontWeight.w500,
|
|
36
|
+
)
|
|
37
|
+
: textStyle,
|
|
33
38
|
// recognizer: TapAndPanGestureRecognizer()..onDragEnd = (e) => print("Hello"),
|
|
34
39
|
children: chapter.verses
|
|
35
40
|
.asMap()
|
|
36
41
|
.entries
|
|
37
42
|
.map(
|
|
38
43
|
(e) => [
|
|
39
|
-
|
|
44
|
+
WidgetSpan(
|
|
40
|
-
|
|
45
|
+
child: Transform.translate(
|
|
41
|
-
|
|
46
|
+
offset: const Offset(0, -2),
|
|
42
|
-
|
|
47
|
+
child: Text("${e.key + 1} ", style: Theme.of(context).textTheme.labelMedium),
|
|
43
|
-
|
|
48
|
+
),
|
|
44
|
-
|
|
49
|
+
),
|
|
45
|
-
|
|
50
|
+
TextSpan(
|
|
46
|
-
|
|
51
|
+
text: "${e.value.text}\n",
|
|
47
|
-
|
|
52
|
+
style: model.isVerseSelected(e.key)
|
|
48
|
-
|
|
53
|
+
? TextStyle(
|
|
49
|
-
|
|
54
|
+
backgroundColor: Theme.of(context).highlightColor,
|
|
50
|
-
|
|
55
|
+
)
|
|
51
|
-
|
|
56
|
+
: null,
|
|
52
|
-
|
|
57
|
+
recognizer: TapGestureRecognizer()..onTap = () => model.onVerseSelected(context, e.key),
|
|
53
|
-
|
|
58
|
+
),
|
|
54
|
-
|
|
59
|
+
const WidgetSpan(
|
|
55
|
-
|
|
60
|
+
child: Padding(
|
|
56
|
-
|
|
61
|
+
padding: EdgeInsets.only(bottom: 30),
|
|
57
|
-
|
|
62
|
+
),
|
|
58
|
-
|
|
63
|
+
),
|
|
59
|
-
|
|
64
|
+
],
|
|
60
|
-
|
|
65
|
+
)
|
|
61
66
|
.expand((element) => element)
|
|
62
67
|
.toList(),
|
|
63
68
|
),
|