[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,17 +12,35 @@ 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) {
|
||||||
children: [
|
debugPrint('Max width: ${constraints.maxWidth}');
|
||||||
Row(children: <Widget>[
|
if (constraints.maxWidth < 720) {
|
||||||
UrlTextField(),
|
return Column(
|
||||||
DropdownFormat(),
|
children: [
|
||||||
SubmitButton(),
|
Row(children: <Widget>[
|
||||||
]),
|
UrlTextField(),
|
||||||
DebugDlFormState(),
|
]),
|
||||||
],
|
Row(children: <Widget>[
|
||||||
)));
|
Expanded(flex: 1, child: DropdownFormat()),
|
||||||
|
Expanded(flex: 1, child: SubmitButton()),
|
||||||
|
]),
|
||||||
|
DebugDlFormState(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Row(children: <Widget>[
|
||||||
|
UrlTextField(),
|
||||||
|
DropdownFormat(),
|
||||||
|
SubmitButton(),
|
||||||
|
]),
|
||||||
|
DebugDlFormState(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,20 +9,20 @@ class Home extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('home').tr(),
|
title: Text('home').tr(),
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(height: 10),
|
|
||||||
Text('home_intro').tr(),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20), child: DlForm())
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
body: Center(
|
||||||
);
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(height: 10),
|
||||||
|
Text('home_intro').tr(),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
child: DlForm())
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue