mirror of
https://github.com/dancojocaru2000/logic-circuits-simulator.git
synced 2025-02-22 17:19:36 +02:00
Made new project dialog scrollable
This is useful in case of small screens
This commit is contained in:
parent
012de37b4a
commit
aea18c3262
1 changed files with 73 additions and 71 deletions
|
@ -21,88 +21,90 @@ class NewProjectDialog extends HookWidget {
|
||||||
}, [newDialogNameController.text]);
|
}, [newDialogNameController.text]);
|
||||||
|
|
||||||
return Dialog(
|
return Dialog(
|
||||||
child: Padding(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(8.0),
|
child: Padding(
|
||||||
child: IntrinsicWidth(
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: IntrinsicWidth(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
Align(
|
children: [
|
||||||
alignment: Alignment.centerRight,
|
Align(
|
||||||
child: IconButton(
|
alignment: Alignment.centerRight,
|
||||||
icon: const Icon(Icons.close),
|
child: IconButton(
|
||||||
tooltip: 'Close',
|
icon: const Icon(Icons.close),
|
||||||
onPressed: () {
|
tooltip: 'Close',
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: OutlinedButton.icon(
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// TODO: Implement project importing
|
Navigator.of(context).pop();
|
||||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
|
||||||
content: Text('Import coming soon...'),
|
|
||||||
));
|
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.download),
|
|
||||||
label: const Text('Import Project'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Center(
|
||||||
Row(
|
child: Padding(
|
||||||
children: [
|
padding: const EdgeInsets.all(8.0),
|
||||||
const Expanded(
|
child: OutlinedButton.icon(
|
||||||
child: Padding(
|
onPressed: () {
|
||||||
padding: EdgeInsets.all(8.0),
|
// TODO: Implement project importing
|
||||||
child: Divider(),
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||||
|
content: Text('Import coming soon...'),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.download),
|
||||||
|
label: const Text('Import Project'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
|
||||||
child: Text(
|
|
||||||
'OR',
|
|
||||||
style: Theme.of(context).textTheme.caption,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: Divider(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
'New Project',
|
|
||||||
style: Theme.of(context).textTheme.headline6,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.all(8.0),
|
const Expanded(
|
||||||
child: Container(
|
child: Padding(
|
||||||
constraints: const BoxConstraints(minWidth: 300),
|
padding: EdgeInsets.all(8.0),
|
||||||
child: TextField(
|
child: Divider(),
|
||||||
controller: newDialogNameController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
border: const OutlineInputBorder(),
|
|
||||||
labelText: 'Project name',
|
|
||||||
suffixIcon: IconButton(
|
|
||||||
icon: const Icon(Icons.done),
|
|
||||||
onPressed: newProjectAction,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onSubmitted: newProjectAction == null ? null : (_) => newProjectAction(),
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
|
child: Text(
|
||||||
|
'OR',
|
||||||
|
style: Theme.of(context).textTheme.caption,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Divider(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'New Project',
|
||||||
|
style: Theme.of(context).textTheme.headline6,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
],
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
constraints: const BoxConstraints(minWidth: 300),
|
||||||
|
child: TextField(
|
||||||
|
controller: newDialogNameController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: const OutlineInputBorder(),
|
||||||
|
labelText: 'Project name',
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: const Icon(Icons.done),
|
||||||
|
onPressed: newProjectAction,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onSubmitted: newProjectAction == null ? null : (_) => newProjectAction(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Reference in a new issue