Refresh indicator without scrollview

后端 未结 8 1037
失恋的感觉
失恋的感觉 2020-12-14 15:52

I know with a ListView or SingleChildScrollView RefreshIndicator just works natively but I want to use a RefreshIndicator

8条回答
  •  感情败类
    2020-12-14 16:31

    More flexible solution is put your scrollable empty/error state widget into LayoutBuilder

    LayoutBuilder(
      builder: (context, constraints) => SingleChildScrollView(
        physics: AlwaysScrollableScrollPhysics(),
        child: SizedBox(
          height: constraints.maxHeight,
          child: ErrorState(
              subtitle: (snapshot.data as ErrorStateful).errorMessage),
        ),
      ),
    );
    

提交回复
热议问题