addFloatingActionButton function

FloatingActionButton addFloatingActionButton(
  1. {@required BuildContext context,
  2. @required Db db,
  3. @required DbTable schema}
)

Get the floating action button to add a record

Implementation

FloatingActionButton addFloatingActionButton(
    {@required BuildContext context,
    @required Db db,
    @required DbTable schema}) {
  return FloatingActionButton(
    child: const Icon(Icons.add),
    onPressed: () => Navigator.of(context)
        .push<TableFormPage>(MaterialPageRoute(builder: (BuildContext context) {
      return TableFormPage(
        db: db,
        formLabel: "Add a row",
        schema: schema,
      );
    })),
  );
}