Open eossa opened 3 years ago
I get the same error. It happens after the second time DateTimeField
is tapped and you want to call onEditingComplete on another field in the same form.
Reproducable
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'DateTimeField Error Demo'),
);
}
}
class MyHomePage extends StatelessWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Center(
child: Form(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextFormField(
textInputAction: TextInputAction.next,
onEditingComplete: () =>
FocusScope.of(context).nextFocus(), // Throws error
),
TextFormField(
textInputAction: TextInputAction
.next, // Doesn't throw error, but doesnt work
),
DateTimeField(
format: DateFormat.yMd(),
onShowPicker: // Tap 2 times and calling .nextFocus() doesn't work anymore
(BuildContext context, DateTime currentValue) async {
return DateTime.now();
},
),
],
),
),
),
);
}
}
Have the same issue, any fix? It's the same for the new fork of this library: https://github.com/rekariproject/datetime_picker_formfield
I also have the same issue. Any update?
I also have the same issue. Any update?
I am using:
I have the following code
Steps to replicate the error:
What could I do about this?