This repository has been archived on 2025-08-25. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Seshat/lib/ui/core/ui/await_loading.dart
2025-08-14 00:27:39 +02:00

49 lines
1 KiB
Dart

import 'dart:async';
import 'package:flutter/material.dart';
class AwaitLoading extends StatefulWidget {
const AwaitLoading({super.key});
@override
State<AwaitLoading> createState() => _AwaitLoadingState();
}
class _AwaitLoadingState extends State<AwaitLoading> {
String text = "";
Timer? t;
@override
void dispose() {
t?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
t = Timer(Duration(seconds: 8), () {
if (context.mounted) {
setState(() {
text =
"Il semblerait qu'il y ait un problème. Vérifiez que vous êtes connecté·e à internet.";
});
}
});
return Column(
children: [
Expanded(child: SizedBox()),
Center(child: CircularProgressIndicator()),
Expanded(
child: Center(
child: SizedBox(
width: 300,
child: Text(text, textAlign: TextAlign.center),
),
),
),
],
);
}
}