when I use the following code snippet in flutter
import 'package:flutter/material.dart';
import 'package:flutter_app/features/note/presentation/screens/note_list.dart';
import 'package:flutter_app/features/note/presentation/screens/create_note.dart';
class Routes {
static Map<String, WidgetBuilder> getRoutes() {
return {
'/': (context) => const NoteList(),
'/create': (context) => const CreateNote(),
};
}
}
I get this issue
but when I remove absolute path from the code snippet issue gets resolved
import 'package:flutter/material.dart';
import '../features/note/presentation/screens/note_list.dart';
import '../features/note/presentation/screens/create_note.dart';
class Routes {
static Map<String, WidgetBuilder> getRoutes() {
return {
'/': (context) => const NoteList(),
'/create': (context) => const CreateNote(),
};
}
}
I tried to use relative path and and fixed the issue.