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

class FlutCard {
  FlutCard._();

  static Card? flutDecode(FlutRuntime runtime, Map<String, dynamic> data) {
    return Card(
      key: runtime.decodeKey(data),
      color: runtime.unpackOptionalField<Color>(data, 'color'),
      elevation: runtime.unpackOptionalField<double>(data, 'elevation'),
      margin: runtime.unpackOptionalField<EdgeInsets>(data, 'margin'),
      child: runtime.unpackOptionalField<Widget>(data, 'child'),
    );
  }
}
