LCOV - code coverage report
Current view: top level - src/utils - lifecycle_hooks.dart Coverage Total Hit
Test: lcov.info Lines: 100.0 % 1 1
Test Date: 2026-04-18 12:40:21 Functions: - 0 0

            Line data    Source code
       1              : import 'package:flutter/foundation.dart';
       2              : 
       3              : /// Hooks that fire at key points in a [Debouncer]'s lifecycle.
       4              : ///
       5              : /// All callbacks are optional — supply only the ones you need.
       6              : ///
       7              : /// Example:
       8              : /// ```dart
       9              : /// final debouncer = Debouncer(
      10              : ///   delay: Duration(milliseconds: 300),
      11              : ///   hooks: LifecycleHooks(
      12              : ///     onFire: () => print('action fired'),
      13              : ///     onCancel: () => print('timer cancelled'),
      14              : ///   ),
      15              : /// );
      16              : /// ```
      17              : class LifecycleHooks {
      18              :   /// Called just before the debounced action executes.
      19              :   final VoidCallback? onFire;
      20              : 
      21              :   /// Called when a pending timer is cancelled due to a new call arriving.
      22              :   final VoidCallback? onCancel;
      23              : 
      24              :   /// Called when [Debouncer.dispose] is invoked.
      25              :   final VoidCallback? onDispose;
      26              : 
      27            1 :   const LifecycleHooks({
      28              :     this.onFire,
      29              :     this.onCancel,
      30              :     this.onDispose,
      31              :   });
      32              : }
        

Generated by: LCOV version 2.4-0