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

class FlutListView {
  FlutListView._();

  static ListView? flutDecode(FlutRuntime runtime, Map<String, dynamic> data) {
    return ListView(
      key: runtime.decodeKey(data),
      scrollDirection: runtime.unpackRequiredField<Axis>(
        data,
        'scrollDirection',
      ),
      reverse: runtime.unpackRequiredField<bool>(data, 'reverse'),
      controller: runtime.unpackOptionalField<ScrollController>(
        data,
        'controller',
      ),
      shrinkWrap: runtime.unpackRequiredField<bool>(data, 'shrinkWrap'),
      padding: runtime.unpackOptionalField<EdgeInsets>(data, 'padding'),
      cacheExtent: runtime.unpackOptionalField<double>(data, 'cacheExtent'),
      children: runtime.unpackRequiredField<List<Widget>>(data, 'children'),
    );
  }
}
