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

class FlutMaterialApp {
  FlutMaterialApp._();

  static MaterialApp? flutDecode(
    FlutRuntime runtime,
    Map<String, dynamic> data,
  ) {
    return MaterialApp(
      key: runtime.decodeKey(data),
      title: runtime.unpackRequiredField<String>(data, 'title'),
      theme: runtime.unpackOptionalField<ThemeData>(data, 'theme'),
      home: runtime.unpackOptionalField<Widget>(data, 'home'),
    );
  }
}
