File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ class _SoundMeterScreenState extends State<SoundMeterScreen> {
147147 return AlertDialog (
148148 title: Text (appLocalizations.saveRecording),
149149 content: TextField (
150+ maxLength: 200 ,
150151 controller: filenameController,
151152 decoration: InputDecoration (
152153 hintText: appLocalizations.enterFileName,
@@ -160,7 +161,18 @@ class _SoundMeterScreenState extends State<SoundMeterScreen> {
160161 ),
161162 ElevatedButton (
162163 onPressed: () {
163- Navigator .pop (context, filenameController.text);
164+ final text = filenameController.text.trim ();
165+ if (text.length > 200 ) {
166+ ScaffoldMessenger .of (context).showSnackBar (
167+ const SnackBar (
168+ content: Text (
169+ 'File name must be less than 200 characters.' ,
170+ ),
171+ ),
172+ );
173+ return ;
174+ }
175+ Navigator .pop (context, text);
164176 },
165177 child: Text (appLocalizations.save),
166178 ),
You can’t perform that action at this time.
0 commit comments