grid method

ChalonaGrid<RESULT> grid({
  1. required List<ChalonaGridHeader> headers,
  2. required GridDetailFn<RESULT> detail,
})

Implementation

ChalonaGrid<RESULT> grid({
  required List<ChalonaGridHeader> headers,
  required GridDetailFn<RESULT> detail,
}) {
  Function(RESULT x)? onTap;
  var context = _context;
  var route = _routeForEdit;
  if (context != null && route != null) {
    onTap = (x) async {
      await route.go(context, arg: x.get()['id']);
      request();
    };
  }

  return ChalonaGrid<RESULT>(
    source: this,
    headers: headers,
    detail: detail,
    onTapRow: onTap,
  );
}