buildLoadingIndicator function
- required bool isLoading,
Builds loading indicator overlay.
Implementation
Widget buildLoadingIndicator({required bool isLoading}) {
if (!isLoading) return const SizedBox.shrink();
return Positioned(
top: 60,
left: 0,
right: 0,
child: Center(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: BoxDecoration(
color: Colors.black54,
borderRadius: BorderRadius.circular(20),
),
child: const Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
),
SizedBox(width: 8),
Text('Loading places...', style: TextStyle(color: Colors.white)),
],
),
),
),
);
}