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

class FlutScaffold {
  FlutScaffold._();

  static Scaffold? flutDecode(FlutRuntime runtime, Map<String, dynamic> data) {
    return Scaffold(
      key: runtime.decodeKey(data),
      appBar: runtime.unpackOptionalField<PreferredSizeWidget>(data, 'appBar'),
      body: runtime.unpackOptionalField<Widget>(data, 'body'),
      floatingActionButton: runtime.unpackOptionalField<Widget>(
        data,
        'floatingActionButton',
      ),
      backgroundColor: runtime.unpackOptionalField<Color>(
        data,
        'backgroundColor',
      ),
    );
  }
}
