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

class FlutCircularProgressIndicator {
  FlutCircularProgressIndicator._();

  static CircularProgressIndicator? flutDecode(
    FlutRuntime runtime,
    Map<String, dynamic> data,
  ) {
    return CircularProgressIndicator(
      key: runtime.decodeKey(data),
      color: runtime.unpackOptionalField<Color>(data, 'color'),
      strokeWidth: runtime.unpackOptionalField<double>(data, 'strokeWidth'),
    );
  }
}

class FlutLinearProgressIndicator {
  FlutLinearProgressIndicator._();

  static LinearProgressIndicator? flutDecode(
    FlutRuntime runtime,
    Map<String, dynamic> data,
  ) {
    return LinearProgressIndicator(
      key: runtime.decodeKey(data),
      value: runtime.unpackOptionalField<double>(data, 'value'),
      backgroundColor: runtime.unpackOptionalField<Color>(
        data,
        'backgroundColor',
      ),
      color: runtime.unpackOptionalField<Color>(data, 'color'),
      minHeight: runtime.unpackOptionalField<double>(data, 'minHeight'),
      borderRadius: runtime.unpackOptionalField<BorderRadius>(
        data,
        'borderRadius',
      ),
    );
  }
}
