admin
2022-05-05 355fe96b2a4c7821256d9e8828d2cb9539904878
flutter_module/lib/ui/widget/refresh_listview.dart
@@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:makemoney/ui/widget/button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
typedef OnRefresh = void Function();
@@ -61,7 +62,7 @@
      required this.content,
      this.emptyView,
      this.refresh,
      this.loadTextColor=const Color(0xFFB8AFB5),
      this.loadTextColor = const Color(0xFFB8AFB5),
      this.loadMore,
      this.enablePullDown = true,
      this.enablePullUp = true});
@@ -157,12 +158,15 @@
        : SmartRefresher(
            enablePullDown: widget.enablePullDown!,
            enablePullUp: widget.enablePullUp!,
            header: const WaterDropHeader(
              complete: Text(
                "刷新完成",
                style: TextStyle(color: Color(0xFFB8AFB5)),
              ),
            ),
            header:
            MaterialClassicHeader(),
            // const WaterDropHeader(
            //   complete: Text(
            //     "刷新完成",
            //     style: TextStyle(color: Color(0xFFB8AFB5)),
            //   ),
            // ),
            footer: CustomFooter(
              builder: (BuildContext context, LoadStatus? mode) {
                Widget body;
@@ -178,7 +182,7 @@
                  body = const Text("松手,加载更多!",
                      style: TextStyle(color: Color(0xFFB8AFB5)));
                } else {
                  body =  Text("~到底了~",
                  body = Text("~到底了~",
                      style: TextStyle(color: widget.loadTextColor));
                }
                return SizedBox(
@@ -207,8 +211,8 @@
                "assets/imgs/common/ic_empty.png",
              ),
              const Text(
                "暂无数据     ",
                style: TextStyle(color: Color(0xFFF698C9), fontSize: 18),
                "~空空如也~",
                style: TextStyle(color: Color(0xFF999999), fontSize: 18),
              )
            ],
          ),
@@ -216,25 +220,36 @@
  }
  Widget errorView() {
    return InkWell(
        onTap: () {
          _onRefresh();
        },
        child: Container(
          alignment: Alignment.center,
          // color: Colors.yellow,
          child: Stack(
            alignment: Alignment.bottomCenter,
            children: [
              Image.asset("assets/imgs/common/ic_network_error.png",
                  width: MediaQuery.of(context).size.width * 2 / 5),
              const Text(
                "网络异常,点击重新加载",
                style: TextStyle(color: Color(0xFFF698C9), fontSize: 18),
              )
            ],
          ),
        ));
    return Container(
      alignment: Alignment.center,
      // color: Colors.yellow,
      child: Stack(
        alignment: Alignment.bottomCenter,
        children: [
          Image.asset("assets/imgs/common/ic_network_error.png",
              width: MediaQuery.of(context).size.width * 3 / 5),
          const Positioned(
              bottom: 50,
              left: 0,
              right: 0,
              child: Text(
                "网络请求出错",
                textAlign: TextAlign.center,
                style: TextStyle(fontSize: 15, color: Color(0xFF999999)),
              )),
          MyFillButton(
            "点击重新加载",
            18,
            width: 170,
            height: 36,
            fontSize: 15,
            onClick: () {
              _onRefresh();
            },
          )
        ],
      ),
    );
  }
  @override