Reputation: 1118
I'm encountering the following errors in my Flutter project while trying to implement a CustomButton
widget:
RaisedButton
isn't defined for the type CustomButton
"text
"Code:
(dart)
class CustomButton extends StatelessWidget {
final Function onTap;
final String Text;
const CustomButton({required this.onTap, required this.Text});
@override
Widget build(BuildContext context) {
return ButtonTheme(
minWidth: 200,
child: RaisedButton(
onPressed: onTap,
child: Text(text,style: TextStyle(fontSize: 15),
),
),
);
}
}
How to solve the issues? Thank you!.
Upvotes: 0
Views: 4246
Reputation: 4769
Upvotes: 1