Skip to content

Commit af31772

Browse files
authored
Merge pull request #1684 from matthiasn/feat/keyboard_scroll
feat: scroll to make texteditor visible on mobile
2 parents fb2808e + fb28feb commit af31772

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

lib/pages/journal/entry_details_page.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ class EntryDetailPage extends StatelessWidget {
6666
LinkedEntriesWidget(item: item),
6767
LinkedFromEntriesWidget(item: item),
6868
],
69-
).animate().fadeIn(duration: const Duration(milliseconds: 250)),
69+
).animate().fadeIn(
70+
duration: const Duration(
71+
milliseconds: 100,
72+
),
73+
),
7074
),
7175
);
7276
},

lib/widgets/journal/editor/editor_toolbar.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ToolbarWidget extends StatelessWidget {
1212

1313
@override
1414
Widget build(BuildContext context) {
15-
const duration = Duration(milliseconds: 800);
15+
const duration = Duration(milliseconds: 400);
1616
const curve = Curves.easeInOutQuint;
1717
const height = 60.0;
1818

lib/widgets/journal/editor/editor_widget.dart

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// ignore_for_file: avoid_dynamic_calls
22

3+
import 'dart:async';
4+
35
import 'package:flex_color_scheme/flex_color_scheme.dart';
46
import 'package:flutter/material.dart';
57
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -8,6 +10,7 @@ import 'package:flutter_quill/flutter_quill.dart';
810
import 'package:lotti/blocs/journal/entry_cubit.dart';
911
import 'package:lotti/blocs/journal/entry_state.dart';
1012
import 'package:lotti/themes/theme.dart';
13+
import 'package:lotti/utils/platform.dart';
1114
import 'package:lotti/widgets/journal/editor/editor_styles.dart';
1215
import 'package:lotti/widgets/journal/editor/editor_toolbar.dart';
1316

@@ -75,6 +78,15 @@ class EditorWidget extends StatelessWidget {
7578
}
7679
}
7780

81+
if (snapshot.isFocused && isMobile) {
82+
Timer(const Duration(milliseconds: 100), () {
83+
Scrollable.ensureVisible(
84+
context,
85+
duration: const Duration(milliseconds: 300),
86+
);
87+
});
88+
}
89+
7890
// ignore: deprecated_member_use
7991
return RawKeyboardListener(
8092
focusNode: FocusNode(),

pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1523,10 +1523,10 @@ packages:
15231523
dependency: "direct main"
15241524
description:
15251525
name: matrix
1526-
sha256: "90e8743a3836414751400ecb24c9b41a20472b316f77010dc4ddcf300d511906"
1526+
sha256: cc054acbc89777d06a0d17bff5e3ab2eca6bdd3ff89b076d2a552ffc30b7b8aa
15271527
url: "https://pub.dev"
15281528
source: hosted
1529-
version: "0.25.9"
1529+
version: "0.25.10"
15301530
matrix_api_lite:
15311531
dependency: transitive
15321532
description:

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: lotti
22
description: Achieve your goals and keep your data private with Lotti.
33
publish_to: 'none'
4-
version: 0.9.430+2387
4+
version: 0.9.431+2388
55

66
msix_config:
77
display_name: LottiApp

0 commit comments

Comments
 (0)