Desktop UI improvements

This commit is contained in:
Juan Gilsanz Polo 2023-10-24 20:59:54 +02:00
parent 5a13d52598
commit 639f583046
2 changed files with 27 additions and 81 deletions

View file

@ -176,65 +176,6 @@ class _HomeState extends State<Home> {
),
TopItemsLists(order: appConfigProvider.homeTopItemsOrder),
// if (width > 700) Column(
// children: [
// Wrap(
// alignment: WrapAlignment.center,
// children: appConfigProvider.homeTopItemsOrder.map((item) {
// switch (item) {
// case HomeTopItems.queriedDomains:
// return Padding(
// padding: const EdgeInsets.only(bottom: 16),
// child: ConstrainedBox(
// constraints: const BoxConstraints(
// maxWidth: 500
// ),
// child: TopItems(
// label: AppLocalizations.of(context)!.topQueriedDomains,
// data: statusProvider.serverStatus!.stats.topQueriedDomains,
// type: 'topQueriedDomains',
// ),
// ),
// );
// case HomeTopItems.blockedDomains:
// return Padding(
// padding: const EdgeInsets.only(bottom: 16),
// child: ConstrainedBox(
// constraints: const BoxConstraints(
// maxWidth: 500
// ),
// child: TopItems(
// label: AppLocalizations.of(context)!.topBlockedDomains,
// data: statusProvider.serverStatus!.stats.topBlockedDomains,
// type: 'topBlockedDomains',
// ),
// ),
// );
// case HomeTopItems.recurrentClients:
// return Padding(
// padding: const EdgeInsets.only(bottom: 16),
// child: ConstrainedBox(
// constraints: const BoxConstraints(
// maxWidth: 500
// ),
// child: TopItems(
// label: AppLocalizations.of(context)!.topClients,
// data: statusProvider.serverStatus!.stats.topClients,
// type: 'topClients',
// ),
// ),
// );
// default:
// return const SizedBox();
// }
// }).toList(),
// ),
// ],
// )
];
}

View file

@ -157,41 +157,46 @@ class _TopItemsState extends State<TopItems> {
const SizedBox(height: 24),
if (widget.data.isEmpty) noItems,
if (widget.data.isNotEmpty && width > 700) SizedBox(
height: 240,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
flex: 1,
if (widget.data.isNotEmpty && width > 700) Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
flex: 1,
child: ConstrainedBox(
constraints: const BoxConstraints(
maxHeight: 250
),
child: Padding(
padding: const EdgeInsets.all(16),
child: chart,
)
),
Expanded(
flex: 2,
child: Column(
children: [
...itemsList,
OthersRowItem(items: widget.data)
]
),
)
],
),
),
Expanded(
flex: 2,
child: Column(
children: [
...itemsList,
OthersRowItem(items: widget.data)
]
),
)
],
),
if (widget.data.isNotEmpty && width <= 700) ...[
if (_showChart) ...[
chart,
SizedBox(
height: 300,
child: chart
),
const SizedBox(height: 16),
],
...itemsList,
if (_showChart) OthersRowItem(items: widget.data)
if (_showChart) OthersRowItem(items: widget.data),
const SizedBox(height: 16),
],
if (widget.data.length > 5) ...[
const SizedBox(height: 20),
if (widget.data.length > 5) ...[
Padding(
padding: const EdgeInsets.only(right: 20),
child: Row(