Open IiemB opened 3 months ago
added actionsBuilder to customize the buttons and their actions before returning value from dialogue
actionsBuilder
example :
showOmniDateTimePicker( context: context, is24HourMode: true, isForce2Digits: true, initialDate: DateTime.now(), firstDate: DateTime(2020), lastDate: DateTime(2025), padding: const EdgeInsets.all(12), insetPadding: const EdgeInsets.all(12), borderRadius: BorderRadius.circular(12), actionsBuilder: (onCancelPressed, cancelText, onSavePressed, saveText) => [ Expanded( child: OutlinedButton( onPressed: () { // ... others actions onCancelPressed.call(); }, child: Text(cancelText), // or Other text ), ), const SizedBox( height: 20, child: VerticalDivider(), ), Expanded( child: FilledButton( onPressed: () { // ... others actions onSavePressed.call(); }, child: Text(saveText), // or Other text ), ), ], ),
showOmniDateTimeRangePicker( context: context, is24HourMode: true, isForce2Digits: true, padding: const EdgeInsets.all(12), insetPadding: const EdgeInsets.all(12), borderRadius: BorderRadius.circular(12), actionsBuilder: (onCancelPressed, cancelText, onSavePressed, saveText) => [ Expanded( child: OutlinedButton( onPressed: () { // ... others actions onCancelPressed.call(); }, child: Text(cancelText), // or Other text ), ), const SizedBox( height: 20, child: VerticalDivider(), ), Expanded( child: FilledButton( onPressed: () { // ... others actions onSavePressed.call(); }, child: Text(saveText), // or Other text ), ), ], ),
added
actionsBuilder
to customize the buttons and their actions before returning value from dialogueexample :