File tree 4 files changed +12
-3
lines changed
4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -44,3 +44,5 @@ app.*.map.json
44
44
/android /app /debug
45
45
/android /app /profile
46
46
/android /app /release
47
+ README.md
48
+ README.md
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ const kEncryptResultAlertTitle = 'Encrypt result is Copied!';
27
27
const kDecryptResultPageTitle = 'Decrypt Result' ;
28
28
const kDecryptResultAlertTitle = 'Decrypt result is Copied!' ;
29
29
const kSadSmiley = ':(' ;
30
+ const kMaxTextFieldLength = 245 ;
30
31
31
32
final kBigTextStyle = TextStyle (
32
33
fontSize: 28. sp,
Original file line number Diff line number Diff line change @@ -41,8 +41,12 @@ class _MessageInputPageState extends State<MessageInputPage> {
41
41
padding: EdgeInsets .only (right: 7. w),
42
42
icon: Icons .arrow_forward_ios,
43
43
onPressed: () {
44
- String ? secretMessage = _myRsaBrain
45
- .encryptTheSetterMessage (messageController.text.trim ());
44
+ String ? secretMessage = _myRsaBrain.encryptTheSetterMessage (
45
+ (messageController.text.trim ().length > kMaxTextFieldLength)
46
+ ? messageController.text
47
+ .trim ()
48
+ .substring (0 , kMaxTextFieldLength)
49
+ : messageController.text.trim ());
46
50
47
51
Navigator .push (
48
52
context,
@@ -65,7 +69,7 @@ class _MessageInputPageState extends State<MessageInputPage> {
65
69
),
66
70
body: EditorScreenTemplate (
67
71
controller: messageController,
68
- maxLength: 245 ,
72
+ maxLength: kMaxTextFieldLength ,
69
73
),
70
74
);
71
75
}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class EditorScreenTemplate extends StatelessWidget {
21
21
bottom: 5.0 .h,
22
22
),
23
23
child: TextField (
24
+ decoration: InputDecoration (border: InputBorder .none),
24
25
maxLength: maxLength,
25
26
controller: controller,
26
27
style: kSimpleTextStyle,
@@ -30,6 +31,7 @@ class EditorScreenTemplate extends StatelessWidget {
30
31
maxLines: null ,
31
32
autocorrect: false ,
32
33
expands: true ,
34
+ textInputAction: TextInputAction .done,
33
35
),
34
36
);
35
37
}
You can’t perform that action at this time.
0 commit comments