mirror of
https://github.com/foss42/apidash.git
synced 2025-06-05 19:14:25 +08:00
Update workspace_selector.dart
This commit is contained in:
@ -18,6 +18,7 @@ class WorkspaceSelector extends HookWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var selectedDirectory = useState<String?>(null);
|
var selectedDirectory = useState<String?>(null);
|
||||||
|
var selectedDirectoryTextController = useTextEditingController();
|
||||||
var workspaceName = useState<String?>(null);
|
var workspaceName = useState<String?>(null);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: Center(
|
||||||
@ -45,27 +46,21 @@ class WorkspaceSelector extends HookWidget {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: ADOutlinedTextField(
|
||||||
decoration: BoxDecoration(
|
keyId: "workspace-path",
|
||||||
border: Border.all(
|
controller: selectedDirectoryTextController,
|
||||||
width: 1,
|
textStyle: kTextStyleButtonSmall,
|
||||||
color: Theme.of(context).colorScheme.primaryContainer,
|
readOnly: true,
|
||||||
),
|
isDense: true,
|
||||||
borderRadius: kBorderRadius6,
|
maxLines: null,
|
||||||
),
|
|
||||||
padding: kP4,
|
|
||||||
child: Text(
|
|
||||||
style: kTextStyleButtonSmall,
|
|
||||||
selectedDirectory.value ?? "",
|
|
||||||
maxLines: 4,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
kHSpacer10,
|
kHSpacer10,
|
||||||
FilledButton.tonalIcon(
|
FilledButton.tonalIcon(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
selectedDirectory.value = await getDirectoryPath();
|
selectedDirectory.value = await getDirectoryPath();
|
||||||
|
selectedDirectoryTextController.text =
|
||||||
|
selectedDirectory.value ?? "";
|
||||||
},
|
},
|
||||||
label: const Text(kLabelSelect),
|
label: const Text(kLabelSelect),
|
||||||
icon: const Icon(Icons.folder_rounded),
|
icon: const Icon(Icons.folder_rounded),
|
||||||
|
Reference in New Issue
Block a user