DoubleBack constructor

const DoubleBack({
  1. Key? key,
  2. required Widget child,
  3. String message = "Press back again to exit",
  4. int waitForSecondBackPress = 2,
  5. Function? onFirstBackPress,
  6. bool condition = true,
  7. VoidCallback? onConditionFail,
  8. TextStyle textStyle = const TextStyle(fontSize: 14, color: Colors.white),
  9. Color background = const Color(0xAA000000),
  10. double backgroundRadius = 20,
})

DoubleBack, wrap a widget to use it

Implementation

const DoubleBack({
  Key? key,
  required this.child,
  this.message = "Press back again to exit",
  this.waitForSecondBackPress = 2,
  this.onFirstBackPress,
  this.condition = true,
  this.onConditionFail,
  this.textStyle = const TextStyle(fontSize: 14, color: Colors.white),
  this.background = const Color(0xAA000000),
  this.backgroundRadius = 20,
}) : super(key: key);