Program is saying : The argument type String Function(String) can't be assigned to the parameter type String?
Function(String?)?`. İn the validator are and under line , I Wrote
error.
import 'package:asdasd/Validation/Student_Validator.dart';
import 'package:asdasd/models/Student.dart';
import 'package:flutter/material.dart';
class StudentAdd extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _StudentAddState();
}
}
class _StudentAddState extends State with StudentValidationMixin {
var student = Student.withoutinfo();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Yeni öğrenci ekleme "),
),
body: Container(
margin: EdgeInsets.all(20.0),
child: Form(
child: Column(
children: <Widget>[
TextFormField(
decoration: InputDecoration(
labelText: "Öğrencinin Adı", hintText: "Musa Develi"),
validator: validateFirstName,//eror
onSaved: (String value){//eror
student.firstName=value;//eror
},
),
],
),
),
),
);
}
}
class StudentValidation {
}