button function

Widget button (
  1. SamModel sm,
  2. {@required Object action,
  3. @required String label}
)

Return a basic button widget adapted to the host platform.

The label is used as text on the button. A SizedBox wrapper should be used to set the size if needed.

The action should be an action code from the Enums list of action code that is the companion of sm.

Implementation

Widget button(SamModel sm,{@required Object action,@required String label}) {
  //assert(action.startsWith("sa"));
  return PlatformButton(
     onPressed: () => sm.actionCall(action),
     child: Text(label),
  );
}