49 lines
1.4 KiB
Dart
49 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
|
|
|
class LoadingWidget extends StatelessWidget {
|
|
const LoadingWidget({
|
|
Key? key,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
type: MaterialType.transparency,
|
|
child: Center(
|
|
child: Container(
|
|
width: 150.w,
|
|
height: 170.h,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white, borderRadius: BorderRadius.circular(8.r)),
|
|
child: LoaderColumn(
|
|
loadingText: "Loading",
|
|
textColor: Colors.black,
|
|
),
|
|
),
|
|
));
|
|
}
|
|
}
|
|
|
|
class LoaderColumn extends Column {
|
|
LoaderColumn({Key? key, String? loadingText, Color? color, Color? textColor})
|
|
: super(
|
|
key: key,
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
CircularProgressIndicator(color: color),
|
|
(loadingText == null || loadingText.isEmpty)
|
|
? const SizedBox.shrink()
|
|
: Padding(
|
|
padding: REdgeInsets.only(top: 16.0),
|
|
child: CustomTextWidget(
|
|
text: loadingText!,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|