2021-04-24 07:46:53 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class TabTransitionWidget extends StatefulWidget {
|
|
|
|
final Widget child;
|
|
|
|
|
2022-03-10 18:39:57 +00:00
|
|
|
const TabTransitionWidget(this.child, {Key? key})
|
2022-03-11 15:36:42 +00:00
|
|
|
: super(key: key);
|
2021-04-24 07:46:53 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
_TabTransitionWidgetState createState() => _TabTransitionWidgetState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _TabTransitionWidgetState extends State<TabTransitionWidget> {
|
|
|
|
var _show = false;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
Future.delayed(Duration(microseconds: 10)).then((value) {
|
|
|
|
if (mounted) setState(() => _show = true);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
if (!_show)
|
|
|
|
return Center(child: CircularProgressIndicator());
|
|
|
|
else
|
|
|
|
return widget.child;
|
|
|
|
}
|
|
|
|
}
|