2022-01-02 21:49:37 -05:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class LoadingIndicator extends StatelessWidget {
|
2022-06-28 10:32:16 -04:00
|
|
|
final String? subtitle;
|
2022-01-02 21:49:37 -05:00
|
|
|
final double spacing;
|
|
|
|
|
|
2023-10-28 18:13:23 -04:00
|
|
|
const LoadingIndicator({super.key, this.subtitle, this.spacing = 8});
|
2022-01-02 21:49:37 -05:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2022-01-24 17:27:42 -05:00
|
|
|
if (subtitle == null) {
|
|
|
|
|
return const Center(child: CircularProgressIndicator.adaptive());
|
|
|
|
|
}
|
2022-06-28 10:32:16 -04:00
|
|
|
return Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
const CircularProgressIndicator.adaptive(),
|
|
|
|
|
SizedBox(height: spacing),
|
|
|
|
|
Text(
|
2022-01-24 17:27:42 -05:00
|
|
|
subtitle!,
|
2024-09-06 21:43:27 -07:00
|
|
|
style: TextStyle(
|
|
|
|
|
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
|
2022-06-28 10:32:16 -04:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2022-01-02 21:49:37 -05:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|