2021-09-29 23:57:09 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-09-05 03:05:46 +00:00
|
|
|
import 'package:pikapika/basic/config/IconLoading.dart';
|
2021-09-29 23:57:09 +00:00
|
|
|
|
|
|
|
class ContentLoading extends StatelessWidget {
|
|
|
|
final String label;
|
|
|
|
|
|
|
|
const ContentLoading({Key? key, required this.label}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return LayoutBuilder(
|
|
|
|
builder: (BuildContext context, BoxConstraints constraints) {
|
|
|
|
var width = constraints.maxWidth;
|
|
|
|
var height = constraints.maxHeight;
|
|
|
|
var min = width < height ? width : height;
|
|
|
|
var theme = Theme.of(context);
|
|
|
|
return Center(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(child: Container()),
|
|
|
|
SizedBox(
|
|
|
|
width: min / 2,
|
|
|
|
height: min / 2,
|
2022-09-05 03:05:46 +00:00
|
|
|
child: currentIconLoading()
|
|
|
|
? Icon(Icons.refresh, color: Colors.grey[100])
|
|
|
|
: CircularProgressIndicator(
|
|
|
|
color: theme.colorScheme.secondary,
|
|
|
|
backgroundColor: Colors.grey[100],
|
|
|
|
),
|
2021-09-29 23:57:09 +00:00
|
|
|
),
|
|
|
|
Container(height: min / 10),
|
|
|
|
Text(label, style: TextStyle(fontSize: min / 15)),
|
|
|
|
Expanded(child: Container()),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|