BankRoundUpSettingsSheet constructor

const BankRoundUpSettingsSheet({
  1. required bool isEnabled,
  2. required int multiplier,
  3. required List<SavingsPot> availablePots,
  4. required ValueChanged<bool> onEnabledChanged,
  5. required ValueChanged<int> onMultiplierChanged,
  6. required ValueChanged<String?> onPotSelected,
  7. Key? key,
  8. String? selectedPotId,
  9. String title = 'Round Up Spare Change',
  10. String multiplierSectionLabel = 'Round up by',
  11. String potSectionLabel = 'Save to',
  12. String emptyPotsLabel = 'No savings pots available. Create a pot first.',
  13. String goalTemplate = 'Goal: {amount}',
  14. String potSemanticTemplate = '{pot}, goal {amount}',
  15. String multiplierTemplate = '{n}×',
  16. String multiplierSemanticTemplate = '{n}x multiplier',
  17. String enabledSemanticLabel = 'Round Up enabled',
  18. String disabledSemanticLabel = 'Round Up disabled',
  19. String explanationTemplate = 'We\'ll round up every purchase to the ' 'nearest £1 and save the difference{multiplier} automatically.',
  20. BorderRadius? radius,
  21. Color? backgroundColor,
  22. Color? accentColor,
  23. TextStyle? titleStyle,
  24. IconData? titleIcon,
  25. IconData? potIcon,
  26. IconData? selectedIcon,
  27. IconData? infoIcon,
  28. Duration? animationDuration,
  29. Curve? animationCurve,
})

Implementation

const BankRoundUpSettingsSheet({
  required this.isEnabled,
  required this.multiplier,
  required this.availablePots,
  required this.onEnabledChanged,
  required this.onMultiplierChanged,
  required this.onPotSelected,
  super.key,
  this.selectedPotId,
  this.title = 'Round Up Spare Change',
  this.multiplierSectionLabel = 'Round up by',
  this.potSectionLabel = 'Save to',
  this.emptyPotsLabel = 'No savings pots available. Create a pot first.',
  this.goalTemplate = 'Goal: {amount}',
  this.potSemanticTemplate = '{pot}, goal {amount}',
  this.multiplierTemplate = '{n}×',
  this.multiplierSemanticTemplate = '{n}x multiplier',
  this.enabledSemanticLabel = 'Round Up enabled',
  this.disabledSemanticLabel = 'Round Up disabled',
  this.explanationTemplate = 'We\'ll round up every purchase to the '
      'nearest £1 and save the difference{multiplier} automatically.',
  this.radius,
  this.backgroundColor,
  this.accentColor,
  this.titleStyle,
  this.titleIcon,
  this.potIcon,
  this.selectedIcon,
  this.infoIcon,
  this.animationDuration,
  this.animationCurve,
}) : assert(
        multiplier == 1 ||
            multiplier == 2 ||
            multiplier == 5 ||
            multiplier == 10,
        'multiplier must be 1, 2, 5, or 10',
      );