// Flutter imports:
import 'package:flutter/material.dart';

class LooseFocus extends StatelessWidget {
  ///
  /// Теряет фокус если тапнули по пустой области
  ///
  const LooseFocus({
    required this.child,
    super.key,
  });

  /// Потомок
  final Widget child;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
      child: child,
    );
  }
}
