I'm trying to create a reusable Card widget to use in other dart files throughout my app. I keep getting a named parameter is not defined error. What could the problem be here? Things I've already tried:
- Reinstalling the flutter SDK.
- Running flutter doctor throws no issues related to this.
- Running a Dart re-analyse on VS-Code.
card.dart
home.dart
import 'package:flutter/material.dart';
import 'card.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Card'),
),
body: Card());
}
}
Description of error
Please change the class name differ from Card. Beacuse you already have Card class in dart pakage.
Solution: