Skip to content

Commit

Permalink
Fixing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed May 29, 2024
1 parent e99bb8d commit 70852a2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/view/screens/overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class HDSOverlay extends HookWidget {
final urlConfig = parameters['config'];
if (urlConfig != null) {
_logger.d('Importing config from url');
importConfig(urlConfig);
importConfig(context, urlConfig);
}
}
});
Expand Down Expand Up @@ -169,7 +169,7 @@ class HDSOverlay extends HookWidget {
IconButton(
icon: const Icon(Icons.download),
tooltip: 'Import configuration',
onPressed: showImportDialog,
onPressed: () => showImportDialog(context),
),
Builder(
builder: (context) => PopupMenuButton(
Expand Down Expand Up @@ -378,7 +378,7 @@ class HDSOverlay extends HookWidget {
);
}

void showImportDialog() {
void showImportDialog(BuildContext context) {
var import = '';

Get.dialog(
Expand Down Expand Up @@ -406,7 +406,7 @@ class HDSOverlay extends HookWidget {
),
const SizedBox(height: 20),
TextButton(
onPressed: () => importConfig(import),
onPressed: () => importConfig(context, import),
child: const Text('Import'),
),
const SizedBox(height: 20),
Expand All @@ -422,11 +422,10 @@ class HDSOverlay extends HookWidget {
);
}

void importConfig(String import) {
void importConfig(BuildContext context, String import) {
// Create a temporary profile to load
final profile = OverlayProfile.fromJson(jsonDecode(import));
overlayController.loadProfile(profile);

Get.back();
Navigator.of(context).pop();
}
}

0 comments on commit 70852a2

Please sign in to comment.