build method

  1. @override
Widget build(
  1. BuildContext context,
  2. LogsViewModel model
)
override

Builds the UI according to the state in model.

Implementation

@override
Widget build(BuildContext context, LogsViewModel model) => model.logs.isEmpty
  ? const Center(child: Text("No logs yet"))
  : ListView.builder(
    itemCount: model.logs.length,
    controller: model.scrollController,
    reverse: true,
    itemBuilder: (context, index) => LogWidget(model.logs[index]),
  );