Skip to content

Commit e00c749

Browse files
authored
Fix rendering (#7)
1 parent 57ee3fd commit e00c749

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

lib/pages/main/location_widget.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class LocationWidget extends StatelessWidget {
99

1010
@override
1111
Widget build(BuildContext context) {
12-
//final String locationName = selectedServer?['text'] ?? '...';
12+
final String locationName = selectedServer?['text'] ?? '...';
1313
final String iconPath =
1414
selectedServer?['icon'] ?? 'assets/images/flags/auto.svg';
1515

@@ -35,9 +35,7 @@ class LocationWidget extends StatelessWidget {
3535
),
3636
),
3737
Text(
38-
AppLocalizations.of(
39-
context,
40-
)!.auto_select, // <-- I change to localized test but you can still use your variable
38+
locationName,
4139
style: TextStyle(
4240
fontSize: 17,
4341
fontWeight: FontWeight.w400,

lib/pages/servers/servers_list.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ class ServersListState extends State<ServersList> {
2929
if (widget.onServersLoaded != null) {
3030
widget.onServersLoaded!(_servers);
3131
}
32-
} else {
32+
}
33+
}
34+
35+
@override
36+
void didChangeDependencies() {
37+
super.didChangeDependencies();
38+
39+
if (_servers.isEmpty) {
3340
_loadServers();
3441
}
3542
}
@@ -136,7 +143,6 @@ class ServersListState extends State<ServersList> {
136143
});
137144

138145
_saveSelectedServers();
139-
140146
if (widget.onServersLoaded != null) {
141147
widget.onServersLoaded!(_servers);
142148
}

0 commit comments

Comments
 (0)