create method
create the widget given a WidgetData type
data the widget data
environment the current Environment
context the BuildContext
Implementation
@override
Widget create(ButtonWidgetData data, Environment environment, BuildContext context) {
// In edit mode, make the button non-interactive
return IgnorePointer(
ignoring: true,
child: ElevatedButton(
onPressed: () { }, // This won't be called due to IgnorePointer
style: ElevatedButton.styleFrom(
foregroundColor: data.foregroundColor,
backgroundColor: data.backgroundColor,
textStyle: data.font?.textStyle(),
padding: data.padding?.edgeInsets()
),
child: Text(data.label.value),
),
);
}