File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ class _GyroscopeScreenState extends State<GyroscopeScreen> {
175175 return AlertDialog (
176176 title: Text (appLocalizations.saveRecording),
177177 content: TextField (
178+ maxLength: 200 ,
178179 controller: filenameController,
179180 decoration: InputDecoration (
180181 hintText: appLocalizations.enterFileName,
@@ -184,11 +185,22 @@ class _GyroscopeScreenState extends State<GyroscopeScreen> {
184185 actions: [
185186 TextButton (
186187 onPressed: () => Navigator .pop (context),
187- child: Text (appLocalizations.cancel. toUpperCase () ),
188+ child: Text (appLocalizations.cancel),
188189 ),
189190 ElevatedButton (
190191 onPressed: () {
191- Navigator .pop (context, filenameController.text);
192+ final text = filenameController.text.trim ();
193+ if (text.length > 200 ) {
194+ ScaffoldMessenger .of (context).showSnackBar (
195+ const SnackBar (
196+ content: Text (
197+ 'File name must be less than 200 characters.' ,
198+ ),
199+ ),
200+ );
201+ return ;
202+ }
203+ Navigator .pop (context, text);
192204 },
193205 child: Text (appLocalizations.save),
194206 ),
You can’t perform that action at this time.
0 commit comments