ffBody method

  1. @override
Widget? ffBody(
  1. BuildContext context
)
override

普通页面建议用CustomScrollView布局,可以配合默认刷新控件一起使用

Implementation

@override
Widget? ffBody(BuildContext context) {
  List<Widget> slivers = [
    SliverToBoxAdapter(
      child: Container(
        child: FFLineContainer(
          children: [
            FFImageButton(
              width: 80,
              heigth: 80,
              borderRadius: BorderRadius.circular(20),
              image: FFImageFactory.netWork(
                  "https://t7.baidu.com/it/u=1595072465,3644073269&fm=193&f=GIF"),
            ),
            FFInk(
              child: FFTextButton(
                notes: "文本展示",
                padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
                // margin: EdgeInsets.only(left: 10),
                unconstrainedBox: true,
                text: "这是按扭",
                color: Colors.pink,
                hiddenKeepFrame: boolValue,
                onClick: () {
                  print("点击我了");
                },
              ),
            ),
            SizedBox(height: 40),
            FFInk(
              child: FFTextButton(
                notes: "多行文本展示",
                padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
                maxLines: 10,
                text:
                    "多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示多行文本展示end",
                color: Colors.pink,
                onClick: () {
                  print("点击我了");
                  boolValue = !boolValue;
                  setState(() {});
                },
              ),
            ),
            SizedBox(height: 40),
            FFImageButton(
              notes: "这是图片网络,带缓存",
              image: FFImageFactory.cacheNetWork(
                  FFImageUtil.utilDefaultNetImage),
              width: 80,
              color: Colors.pink,
            ),
            SizedBox(
              height: 20,
            ),
            FFImageButton(
              notes: "网络图片",
              image: FFImageFactory.netWork(FFImageUtil.utilDefaultNetImage),
              width: 80,
              color: Colors.black,
            ),
            FFImageButton(
              notes: "这是本地图片",
              image: FFImageFactory.asset(
                  "assets/images/common/icon_article_collect_nor@3x.png"),
              width: 40,
              heigth: 40,
              color: Colors.red,
              padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
            ),
            SizedBox(
              height: 20,
            ),
            FFLineContainer(
              notes: "线性布局",
              direction: Axis.vertical,
              children: [
                FFImageButton(
                  image: null,
                  width: 60,
                  heigth: 60,
                  color: Colors.red,
                ),
                FFImageButton(
                  image: null,
                  width: 60,
                  heigth: 60,
                  color: Colors.blue,
                ),
              ],
            ),
            SizedBox(
              height: 20,
            ),
            FFLineContainer(
              direction: Axis.horizontal,
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                FFImageButton(
                  image: null,
                  width: 60,
                  heigth: 60,
                  color: Colors.red,
                ),
                FFImageButton(
                  image: null,
                  width: 60,
                  heigth: 60,
                  color: Colors.blue,
                ),
              ],
            ),
            SizedBox(
              height: 20,
            ),
            FFStackContainer(children: [
              FFImageButton(
                image: null,
                width: 140,
                heigth: 60,
                color: Colors.red,
              ),
              Positioned(
                bottom: 0,
                right: 0,
                child: FFTextButton(
                  text: "我在红色上面",
                ),
              ),
            ])
          ],
        ),
      ),
    ),
  ];

  return CustomScrollView(slivers: slivers);
}