24 lines
587 B
Dart
24 lines
587 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class LoadingContainer extends StatelessWidget {
|
|
final bool loading;
|
|
final bool fetching;
|
|
final Widget child;
|
|
const LoadingContainer({required this.loading, required this.fetching, required this.child, super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if(loading) {
|
|
return const Center(child: CircularProgressIndicator());
|
|
}
|
|
|
|
return Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
if(fetching) const LinearProgressIndicator(),
|
|
Expanded(child: child),
|
|
],
|
|
);
|
|
}
|
|
}
|