Merge branch 'beta'

This commit is contained in:
Juan Gilsanz Polo 2023-10-24 21:30:43 +02:00
commit 6e01ace7b6
4 changed files with 240 additions and 267 deletions

View file

@ -176,65 +176,6 @@ class _HomeState extends State<Home> {
), ),
TopItemsLists(order: appConfigProvider.homeTopItemsOrder), 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

@ -31,6 +31,8 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
late Animation<double> animation; late Animation<double> animation;
final ExpandableController expandableController = ExpandableController(); final ExpandableController expandableController = ExpandableController();
final _chipsScrollController = ScrollController();
@override @override
void initState() { void initState() {
expandableController.addListener(() async { expandableController.addListener(() async {
@ -155,9 +157,19 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
Widget bottomRow() { Widget bottomRow() {
return Container( return Container(
height: 40, height: Platform.isMacOS || Platform.isLinux || Platform.isWindows ? 50 : 40,
margin: const EdgeInsets.only(top: 8), margin: const EdgeInsets.only(top: 8),
child: Scrollbar(
controller: _chipsScrollController,
thumbVisibility: Platform.isMacOS || Platform.isLinux || Platform.isWindows,
interactive: Platform.isMacOS || Platform.isLinux || Platform.isWindows,
thickness: Platform.isMacOS || Platform.isLinux || Platform.isWindows ? 8 : 0,
child: Padding(
padding: EdgeInsets.only(
bottom: Platform.isMacOS || Platform.isLinux || Platform.isWindows ? 16 : 0
),
child: ListView( child: ListView(
controller: _chipsScrollController,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
ActionChip( ActionChip(
@ -196,6 +208,8 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
), ),
], ],
), ),
),
),
); );
} }

View file

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

View file

@ -129,7 +129,16 @@ class SettingsWidget extends StatelessWidget {
) )
) )
], ],
body: ListView( body: SafeArea(
top: false,
bottom: false,
child: Builder(
builder: (context) => CustomScrollView(
slivers: [
SliverOverlapInjector(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
),
SliverList.list(
children: [ children: [
if ( if (
serversProvider.selectedServer != null && serversProvider.selectedServer != null &&
@ -281,6 +290,10 @@ class SettingsWidget extends StatelessWidget {
), ),
) )
], ],
)
],
)
),
), ),
) )
); );