File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -44,3 +44,5 @@ app.*.map.json
4444/android /app /debug
4545/android /app /profile
4646/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!';
2727const kDecryptResultPageTitle = 'Decrypt Result' ;
2828const kDecryptResultAlertTitle = 'Decrypt result is Copied!' ;
2929const kSadSmiley = ':(' ;
30+ const kMaxTextFieldLength = 245 ;
3031
3132final kBigTextStyle = TextStyle (
3233 fontSize: 28. sp,
Original file line number Diff line number Diff line change @@ -41,8 +41,12 @@ class _MessageInputPageState extends State<MessageInputPage> {
4141 padding: EdgeInsets .only (right: 7. w),
4242 icon: Icons .arrow_forward_ios,
4343 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 ());
4650
4751 Navigator .push (
4852 context,
@@ -65,7 +69,7 @@ class _MessageInputPageState extends State<MessageInputPage> {
6569 ),
6670 body: EditorScreenTemplate (
6771 controller: messageController,
68- maxLength: 245 ,
72+ maxLength: kMaxTextFieldLength ,
6973 ),
7074 );
7175 }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class EditorScreenTemplate extends StatelessWidget {
2121 bottom: 5.0 .h,
2222 ),
2323 child: TextField (
24+ decoration: InputDecoration (border: InputBorder .none),
2425 maxLength: maxLength,
2526 controller: controller,
2627 style: kSimpleTextStyle,
@@ -30,6 +31,7 @@ class EditorScreenTemplate extends StatelessWidget {
3031 maxLines: null ,
3132 autocorrect: false ,
3233 expands: true ,
34+ textInputAction: TextInputAction .done,
3335 ),
3436 );
3537 }
You can’t perform that action at this time.
0 commit comments