1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter(dart) error: The argument type can't be assigned to the parameter type...

Discussão em 'Mobile' iniciado por Stack, Outubro 7, 2024 às 09:12.

  1. Stack

    Stack Membro Participativo

    In the new version of Flutter, I encountered an error as follows.

    error: The argument type 'List?' can't be assigned to the parameter type 'dynamic Function(List?)'. (argument_type_not_assignable at [temel_widget] lib\screens\student_add.dart:14)

    class StudentAdd extends StatefulWidget {
    //Student addStudent = Student.withId(0, "", "", 0);
    List<Student>? students;
    StudentAdd(List<Student>? students) {
    this.students = students;
    }
    @override
    State<StatefulWidget> createState() {
    return _StudentAddState(students); **This here error message**
    }
    }


    class _StudentAddState extends State with StudentValidationMixin {
    //Student addStudent = Student.withId(0, "", "", 0);

    List<Student>? students=[];
    var student = Student.withoutInfo();
    var formKey = GlobalKey<FormState>();

    _StudentAddState(StudentAdd(List<Student>? students)) {
    this.students = students;
    }

    Continue reading...

Compartilhe esta Página