import 'package:flutter/material.dart';
import 'package:flut/flut/runtime.dart';

class FlutIconButton {
  FlutIconButton._();

  static Widget? flutDecode(FlutRuntime runtime, Map<String, dynamic> data) {
    return IconButton(
      key: runtime.decodeKey(data),
      iconSize: runtime.unpackOptionalField<double>(data, 'iconSize'),
      color: runtime.unpackOptionalField<Color>(data, 'color'),
      onPressed: runtime.unpackNullableRequiredCallback(data, 'onPressedId'),
      tooltip: runtime.unpackOptionalField<String>(data, 'tooltip'),
      icon: runtime.unpackRequiredField<Widget>(data, 'icon'),
    );
  }
}
