Skip to content
This repository was archived by the owner on Dec 17, 2023. It is now read-only.

Commit 9392bb2

Browse files
committed
Fixed alerts
1 parent cc3661b commit 9392bb2

File tree

5 files changed

+137
-191
lines changed

5 files changed

+137
-191
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Trip planner
3737
- add actual position use ✔
3838
- favourites in list ✔
3939
- gmaps copyright ✔
40-
- loading when fetching
41-
- offline alert
40+
- loading when fetching
41+
- offline alert
4242
- favourites
4343
- multiple APIs
4444

lib/Actual.dart

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class _ActualPageState extends State<ActualPage> {
1818
var url;
1919

2020
_getPrefs() async {
21-
SharedPreferences prefs = await SharedPreferences.getInstance();
21+
SharedPreferences prefs = await SharedPreferences.getInstance();
2222
setState(() {
2323
tableThemeInt = prefs.getInt('tableThemeInt');
24-
url = baseUrl+tableThemeInt.toString();
24+
url = baseUrl + tableThemeInt.toString();
2525
print(url);
2626
_isLoading = false;
2727
});
@@ -51,34 +51,31 @@ class _ActualPageState extends State<ActualPage> {
5151
@override
5252
Widget build(BuildContext context) {
5353
return Scaffold(
54-
appBar: PreferredSize(
55-
preferredSize: Size.fromHeight(0.0),
56-
child: AppBar(backgroundColor: Colors.black)),
54+
appBar: PreferredSize(preferredSize: Size.fromHeight(0.0), child: AppBar(backgroundColor: Colors.black)),
5755
body: _networkStatus
58-
? _isLoading ? CircularProgressIndicator() :WebviewScaffold(
59-
url:url,
60-
geolocationEnabled: true,
61-
)
56+
? _isLoading
57+
? CircularProgressIndicator()
58+
: WebviewScaffold(
59+
url: url,
60+
geolocationEnabled: true,
61+
)
6262
: Center(
63-
child: Padding(
64-
padding: EdgeInsets.only(top: 300.0),
65-
child: Column(children: <Widget>[
66-
Icon(
67-
Icons.signal_cellular_off,
68-
size: 200.0,
69-
color: Colors.grey[300],
70-
),
71-
Text(
72-
AppLocalizations.of(context).noConnectionNearMe,
73-
style: TextStyle(color: Colors.grey[500]),
74-
),
75-
RaisedButton(
76-
child: Text(AppLocalizations.of(context).retryBtn),
77-
onPressed: () {
78-
_checkNetworkStatus();
79-
}),
80-
]),
81-
),
63+
child: Column(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[
64+
Icon(
65+
Icons.signal_cellular_off,
66+
size: 150.0,
67+
color: Colors.grey[300],
68+
),
69+
Text(
70+
AppLocalizations.of(context).noConnectionNearMe,
71+
style: TextStyle(color: Colors.grey[500]),
72+
),
73+
RaisedButton(
74+
child: Text(AppLocalizations.of(context).retryBtn),
75+
onPressed: () {
76+
_checkNetworkStatus();
77+
}),
78+
]),
8279
),
8380
);
8481
}

0 commit comments

Comments
 (0)