If you have updated your dart code but while debugging Flutter is still running the older version of the code you should check your import statements.
import 'package:roster/lib/roster.dart';
import 'lib/roster.dart';
Referencing the same file two different ways, even from different files, will confuse the compiler and lead to unexpected and hard to resolve bugs.
The recommendation is to use file imports for all files in your src folder and package references for anything imported via pubspec.yaml.
Written by Brad Evans
Need a reliable senior engineer in your corner?
I have 20+ years of experience building production software, leading engineering teams, and shipping mobile & web apps. No middle-men—just direct, pragmatic engineering.