[ui] responsive

This commit is contained in:
jscampucci 2024-06-11 13:04:47 +02:00
parent f5b7323e71
commit 5a951403cd
4 changed files with 43 additions and 25 deletions

BIN
assets/images/logo.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -12,17 +12,35 @@ class DlForm extends StatelessWidget {
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (context) => DlFormState(),
child: Form(
child: Column(
children: [
Row(children: <Widget>[
UrlTextField(),
DropdownFormat(),
SubmitButton(),
]),
DebugDlFormState(),
],
)));
child: Form(child: LayoutBuilder(
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: [
Row(children: <Widget>[
UrlTextField(),
DropdownFormat(),
SubmitButton(),
]),
DebugDlFormState(),
],
);
}
})));
}
}

View File

@ -9,20 +9,20 @@ class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
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())
],
appBar: AppBar(
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())
],
),
));
}
}