我想在使用FutureProvider
的时候在loading
期间显示Indicator
,但大小仍然是最大的,不能减少.
return ref.watch(futureProvider).when(
loading: () => Container(
height: 10,
width: 10,
constraints: BoxConstraints(maxHeight: 10, maxWidth: 10),
child: const Indicator(),
),
error: (error, stack) => SizedBox(),
data: (answer) => SizedBox(child: answer));
我试着用Container
来包装,并用BoxConstraints
来指定尺寸,但不起作用.如何指定加载期间要显示的Indicator
的大小?