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

class FlutGestureDetector {
  FlutGestureDetector._();

  static Widget? flutDecode(FlutRuntime runtime, Map<String, dynamic> data) {
    return GestureDetector(
      key: runtime.decodeKey(data),
      onTap: runtime.unpackOptionalCallback(data, 'onTapId'),
      onPanStart: runtime.unpackOptionalCallback(data, 'onPanStartId'),
      onPanUpdate: runtime.unpackOptionalCallback(data, 'onPanUpdateId'),
      onPanEnd: runtime.unpackOptionalCallback(data, 'onPanEndId'),
      child: runtime.unpackOptionalField<Widget>(data, 'child'),
    );
  }
}
