componentTopOptions method
Implementation
Widget componentTopOptions(
ComponentData componentData, BuildContext context) {
Offset componentPosition =
canvasReader.state.toCanvasCoordinates(componentData.position);
return Positioned(
left: componentPosition.dx - 24,
top: componentPosition.dy - 50,
child: Row(
children: [
IconButton(
onPressed: () {
deleteComponentWithPorts(componentData);
context.read<ShowComponentSettingsCubit>().hideSettings();
},
icon: Icon(
Icons.delete_outline,
color: Colors.white,
),
style: IconButton.styleFrom(
backgroundColor: Colors.redAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
const SizedBox(width: 12),
IconButton(
onPressed: () {
_copyComponentDataWithPorts(componentData, context);
},
icon: Icon(
Icons.copy,
color: Colors.white,
),
style: IconButton.styleFrom(
backgroundColor: Colors.lightBlueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
],
),
);
}