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

class FlutCheckbox {
  FlutCheckbox._();

  static Widget? flutDecode(FlutRuntime runtime, Map<String, dynamic> data) {
    return Checkbox(
      key: runtime.decodeKey(data),
      value: runtime.unpackNullableRequiredField<bool>(data, 'value'),
      tristate: runtime.unpackRequiredField<bool>(data, 'tristate'),
      onChanged: runtime.unpackNullableRequiredCallback(data, 'onChangedId'),
      activeColor: runtime.unpackOptionalField<Color>(data, 'activeColor'),
      checkColor: runtime.unpackOptionalField<Color>(data, 'checkColor'),
      autofocus: runtime.unpackRequiredField<bool>(data, 'autofocus'),
    );
  }
}
