File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ class _AccelerometerScreenState extends State<AccelerometerScreen> {
184184 return AlertDialog (
185185 title: Text (appLocalizations.saveRecording),
186186 content: TextField (
187+ maxLength: 200 ,
187188 controller: filenameController,
188189 decoration: InputDecoration (
189190 hintText: appLocalizations.enterFileName,
@@ -193,11 +194,22 @@ class _AccelerometerScreenState extends State<AccelerometerScreen> {
193194 actions: [
194195 TextButton (
195196 onPressed: () => Navigator .pop (context),
196- child: Text (appLocalizations.cancel. toUpperCase () ),
197+ child: Text (appLocalizations.cancel),
197198 ),
198199 ElevatedButton (
199200 onPressed: () {
200- Navigator .pop (context, filenameController.text);
201+ final text = filenameController.text.trim ();
202+ if (text.length > 200 ) {
203+ ScaffoldMessenger .of (context).showSnackBar (
204+ const SnackBar (
205+ content: Text (
206+ 'File name must be less than 200 characters.' ,
207+ ),
208+ ),
209+ );
210+ return ;
211+ }
212+ Navigator .pop (context, text);
201213 },
202214 child: Text (appLocalizations.save),
203215 ),
You can’t perform that action at this time.
0 commit comments