Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Aug 4, 2024
1 parent d075d31 commit 48d03a8
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions lib/ui/shared/dialogs/load_model_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class _LoadModelDialogState extends State<LoadModelDialog> {
style: Theme.of(context).textTheme.labelLarge,
),
),
if (selected != null) ...importedOptions,
FilledButton(
onPressed: () {
Navigator.of(context).pop();
Expand Down Expand Up @@ -134,22 +133,31 @@ class _LoadModelDialogState extends State<LoadModelDialog> {
}

Widget buildDropdown() {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
return Column(
children: [
Text(selected ?? "Select Model"),
PopupMenuButton(
tooltip: "Select Model",
icon: Icon(
dropdownOpen ? Icons.arrow_drop_up : Icons.arrow_drop_down,
color: Theme.of(context).colorScheme.onSurface,
size: 24,
),
offset: const Offset(0, 40),
itemBuilder: itemBuilder,
onOpened: () => setState(() => dropdownOpen = true),
onCanceled: () => setState(() => dropdownOpen = false),
onSelected: (_) => setState(() => dropdownOpen = false),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(selected ?? "Select Model"),
PopupMenuButton(
tooltip: "Select Model",
icon: Icon(
dropdownOpen ? Icons.arrow_drop_up : Icons.arrow_drop_down,
color: Theme.of(context).colorScheme.onSurface,
size: 24,
),
offset: const Offset(0, 40),
itemBuilder: itemBuilder,
onOpened: () => setState(() => dropdownOpen = true),
onCanceled: () => setState(() => dropdownOpen = false),
onSelected: (_) => setState(() => dropdownOpen = false),
),
],
),
if (selected != null)
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: importedOptions,
),
],
);
Expand Down

0 comments on commit 48d03a8

Please sign in to comment.