added loading indicator for mapview

This commit is contained in:
2024-03-26 21:41:42 +01:00
parent 10b0c59c3f
commit 7ce510e690
3 changed files with 44 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
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),
],
);
}
}