I am new on Flutter and I would like to set up a form. This is my code:
const TextField(
decoration: InputDecoration(
labelText: 'Nom',
hintText: 'Entrez votre nom',
icon: Icon(
Icons.person,
color: Colors.blue,
size: 25,
),
keyboardType: TextInputType.text,
autocorrect: true,
autofocus: true,
)),
const TextField(
decoration: InputDecoration(
labelText: 'Prenom',
hintText: 'Entrez votre Prenom',
icon: Icon(
Icons.person,
color: Colors.blue,
size: 25,
),
keyboardType: TextInputType.text,
)),
const TextField(
decoration: InputDecoration(
labelText: 'Telephome',
hintText: 'Entrez votre numero de telephone',
icon: Icon(
Icons.phone,
color: Colors.blue,
size: 25,
),
keyboardType: TextInputType.number,
)),
const TextField(decoration: InputDecoration(
labelText: 'Mot de passe',
hintText: 'Entrez votre mot de passe',
icon: Icon(
Icons.lock,
color: Colors.red,
size: 25,
),
keyboardType: TextInputType.visiblePassword,
ObscureText: true,
)),
when i run i see this error:
lib/main.dart:48:15: Error: No named parameter with the name 'keyboardType'. keyboardType: TextInputType.text, ^^^^^^^^^^^^ ../../flutter/packages/flutter/lib/src/material/input_decorator.dart:2522:9: Context: Found this candidate, but the arguments don't match. const InputDecoration({ ^^^^^^^^^^^^^^^ lib/main.dart:61:15: Error: No named parameter with the name 'keyboardType'. keyboardType: TextInputType.text, ^^^^^^^^^^^^ ../../flutter/packages/flutter/lib/src/material/input_decorator.dart:2522:9: Context: Found this candidate, but the arguments don't match. const InputDecoration({ ^^^^^^^^^^^^^^^ lib/main.dart:72:15: Error: No named parameter with the name 'keyboardType'. keyboardType: TextInputType.number, ^^^^^^^^^^^^ ../../flutter/packages/flutter/lib/src/material/input_decorator.dart:2522:9: Context: Found this candidate, but the arguments don't match. const InputDecoration({ ^^^^^^^^^^^^^^^ lib/main.dart:82:15: Error: No named parameter with the name 'keyboardType'. keyboardType: TextInputType.visiblePassword, ^^^^^^^^^^^^ ../../flutter/packages/flutter/lib/src/material/input_decorator.dart:2522:9: Context: Found this candidate, but the arguments don't match. const InputDecoration({ ^^^^^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:273:21: Error: The method 'ancestorWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'ancestorWidgetOfExactType'. return context?.ancestorWidgetOfExactType(SmartRefresher); ^^^^^^^^^^^^^^^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:277:41: Error: Method not found: 'TypeMatcher'. return context?.ancestorStateOfType(TypeMatcher()); ^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:277:21: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'. return context?.ancestorStateOfType(TypeMatcher()); ^^^^^^^^^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:1003:20: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. return context.inheritFromWidgetOfExactType(RefreshConfiguration); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.3/lib/src/internals/indicator_wrap.dart:631:9: Error: A value of type 'ValueNotifier' can't be assigned to a variable of type 'ValueNotifier'.
- 'ValueNotifier' is from 'package:flutter/src/foundation/change_notifier.dart' ('../../flutter/packages/flutter/lib/src/foundation/change_notifier.dart'). ? refresher.controller.headerMode
please help me