centered loading

This commit is contained in:
komekh 2024-08-30 13:54:44 +05:00
parent 2a8e6cb679
commit 0eead07f00
2 changed files with 12 additions and 6 deletions

View File

@ -64,9 +64,12 @@ class _HistoriesScreenState extends State<HistoriesScreen> {
BlocBuilder<OrderBloc, OrderState>(
builder: (context, state) {
if (state is OrderLoading && state.orders.isEmpty) {
return const SliverToBoxAdapter(
child: Center(
child: CircularProgressIndicator(),
return SliverToBoxAdapter(
child: SizedBox(
height: MediaQuery.of(context).size.height - kToolbarHeight * 3,
child: const Center(
child: CircularProgressIndicator(),
),
),
);
} else if (state is OrderError && state.orders.isEmpty) {

View File

@ -70,9 +70,12 @@ class _OrdersScreenState extends State<OrdersScreen> with AutomaticKeepAliveClie
BlocBuilder<OrderBloc, OrderState>(
builder: (context, state) {
if (state is OrderLoading && state.orders.isEmpty || state is OrderInitial) {
return const SliverToBoxAdapter(
child: Center(
child: CircularProgressIndicator(),
return SliverToBoxAdapter(
child: SizedBox(
height: MediaQuery.of(context).size.height / 2.5,
child: const Center(
child: CircularProgressIndicator(),
),
),
);
} else if (state is OrderError && state.orders.isEmpty) {