File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ class _LuxMeterScreenState extends State<LuxMeterScreen> {
160160 return AlertDialog (
161161 title: Text (appLocalizations.saveRecording),
162162 content: TextField (
163+ maxLength: 200 ,
163164 controller: filenameController,
164165 decoration: InputDecoration (
165166 hintText: appLocalizations.enterFileName,
@@ -169,11 +170,22 @@ class _LuxMeterScreenState extends State<LuxMeterScreen> {
169170 actions: [
170171 TextButton (
171172 onPressed: () => Navigator .pop (context),
172- child: Text (appLocalizations.cancel. toUpperCase () ),
173+ child: Text (appLocalizations.cancel),
173174 ),
174175 ElevatedButton (
175176 onPressed: () {
176- Navigator .pop (context, filenameController.text);
177+ final text = filenameController.text.trim ();
178+ if (text.length > 200 ) {
179+ ScaffoldMessenger .of (context).showSnackBar (
180+ const SnackBar (
181+ content: Text (
182+ 'File name must be less than 200 characters.' ,
183+ ),
184+ ),
185+ );
186+ return ;
187+ }
188+ Navigator .pop (context, text);
177189 },
178190 child: Text (appLocalizations.save),
179191 ),
You can’t perform that action at this time.
0 commit comments