errorWidget property

Widget Function(BuildContext context, BaseModel model) errorWidget
getter/setter pair

Implementation

Widget Function(BuildContext context, BaseModel model) errorWidget =
    (BuildContext context, BaseModel model) => Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              const Text(
                '加载失败',
                style: TextStyle(
                  color: Colors.red,
                  fontSize: 16.0,
                ),
              ),
              const SizedBox(
                height: 10.0,
              ),
              ElevatedButton(
                onPressed: () {
                  model.refresh();
                },
                child: const Text('重新加载'),
              ),
            ],
          ),
        );