[ui] responsive
This commit is contained in:
parent
f5b7323e71
commit
5a951403cd
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
|
|
@ -12,8 +12,24 @@ class DlForm extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChangeNotifierProvider(
|
return ChangeNotifierProvider(
|
||||||
create: (context) => DlFormState(),
|
create: (context) => DlFormState(),
|
||||||
child: Form(
|
child: Form(child: LayoutBuilder(
|
||||||
child: Column(
|
builder: (BuildContext context, BoxConstraints constraints) {
|
||||||
|
debugPrint('Max width: ${constraints.maxWidth}');
|
||||||
|
if (constraints.maxWidth < 720) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Row(children: <Widget>[
|
||||||
|
UrlTextField(),
|
||||||
|
]),
|
||||||
|
Row(children: <Widget>[
|
||||||
|
Expanded(flex: 1, child: DropdownFormat()),
|
||||||
|
Expanded(flex: 1, child: SubmitButton()),
|
||||||
|
]),
|
||||||
|
DebugDlFormState(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Row(children: <Widget>[
|
Row(children: <Widget>[
|
||||||
UrlTextField(),
|
UrlTextField(),
|
||||||
|
|
@ -22,7 +38,9 @@ class DlForm extends StatelessWidget {
|
||||||
]),
|
]),
|
||||||
DebugDlFormState(),
|
DebugDlFormState(),
|
||||||
],
|
],
|
||||||
)));
|
);
|
||||||
|
}
|
||||||
|
})));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@ class Home extends StatelessWidget {
|
||||||
Text('home_intro').tr(),
|
Text('home_intro').tr(),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20), child: DlForm())
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
child: DlForm())
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue