Command constructor

Command(
  1. void function(), [
  2. bool canExecuteFunction()?
])

Implementation

Command(void Function() function, [bool Function()? canExecuteFunction])
    : _function = function {
  _canExecuteFunction = canExecuteFunction ?? () => true;
}