mirror of
https://github.com/feeddeck/feeddeck.git
synced 2026-05-03 01:30:28 -05:00
Initial commit
This commit is contained in:
29
app/lib/widgets/column/loading/column_layout_loading.dart
Normal file
29
app/lib/widgets/column/loading/column_layout_loading.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:feeddeck/repositories/items_repository.dart';
|
||||
|
||||
/// The [ColumnLayoutLoading] widget is used to show a linear progress indicator
|
||||
/// below the [ColumnLayoutSearch] widget. When the current status of the
|
||||
/// [ItemsRepository] is `loading` it shows the linear progrss indicator. For
|
||||
/// all other statuses it show a sized box with the same height but without any
|
||||
/// content.
|
||||
class ColumnLayoutLoading extends StatelessWidget {
|
||||
const ColumnLayoutLoading({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ItemsRepository items = Provider.of<ItemsRepository>(context, listen: true);
|
||||
|
||||
if (items.status != ItemsStatus.loading) {
|
||||
return const SizedBox(
|
||||
height: 1,
|
||||
);
|
||||
}
|
||||
|
||||
return const LinearProgressIndicator(
|
||||
minHeight: 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user