insertRows method

Future<void> insertRows(
  1. int index, {
  2. int count = 1,
  3. List<String> text = const [],
})

Insert count rows before index (-1 appends at end).

Optional text entries map to the proto tab-separated row payload.

Implementation

Future<void> insertRows(
  int index, {
  int count = 1,
  List<String> text = const [],
}) async {
  final req = InsertRowsRequest()
    ..gridId = _gridId
    ..index = index
    ..count = count;
  if (text.isNotEmpty) {
    req.text.addAll(text);
  }
  await VolvoxGridService.InsertRows(req);
  notifyListeners();
}