0.6.12 - bug fixes

This commit is contained in:
exttex 2021-07-02 18:28:59 +02:00
parent aa7f82b399
commit 972e84c136
18 changed files with 271 additions and 150 deletions

View file

@ -1,11 +1,36 @@
import 'package:connectivity/connectivity.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:freezer/translations.i18n.dart';
class ErrorScreen extends StatelessWidget {
int counter = 0;
class ErrorScreen extends StatefulWidget {
final String message;
const ErrorScreen({this.message, Key key}) : super(key: key);
ErrorScreen({this.message});
@override
_ErrorScreenState createState() => _ErrorScreenState();
}
class _ErrorScreenState extends State<ErrorScreen> {
bool checkArl = false;
@override
void initState() {
Connectivity().checkConnectivity().then((connectivity) {
if (connectivity != ConnectivityResult.none && counter > 3) {
setState(() {
checkArl = true;
});
}
});
counter += 1;
super.initState();
}
@override
Widget build(BuildContext context) {
@ -19,7 +44,18 @@ class ErrorScreen extends StatelessWidget {
size: 64.0,
),
Container(height: 4.0,),
Text(message ?? 'Please check your connection and try again later...'.i18n)
Text(widget.message ?? 'Please check your connection and try again later...'.i18n),
if (checkArl)
Padding(
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 32.0),
child: Text(
"Your ARL might be expired, try logging out and logging back in using new ARL or browser.".i18n,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.0,
),
),
)
],
),
);