Update workspace_selector.dart

This commit is contained in:
Ashita Prasad
2024-12-09 04:21:48 +05:30
parent 8339c58e7e
commit b97810aff5

View File

@ -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),