feat(ui): Overflow of the network graph card

pull/483/head
Inex Code 2024-03-13 19:22:56 +03:00
parent 4b08b96b38
commit b25e2f2d5f
1 changed files with 31 additions and 15 deletions

View File

@ -48,23 +48,38 @@ class _Chart extends StatelessWidget {
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Flexible(
'resource_chart.network_title'.tr(), child: Text(
style: Theme.of(context).textTheme.titleMedium?.copyWith( 'resource_chart.network_title'.tr(),
color: style:
Theme.of(context).colorScheme.onSurfaceVariant, Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant,
),
),
),
Flexible(
fit: FlexFit.loose,
child: Wrap(
spacing: 8.0,
runSpacing: 8.0,
alignment: WrapAlignment.end,
runAlignment: WrapAlignment.end,
children: [
Legend(
color: Theme.of(context).colorScheme.primary,
text: 'resource_chart.in'.tr(),
), ),
), Legend(
const Spacer(), color: Theme.of(context).colorScheme.tertiary,
Legend( text: 'resource_chart.out'.tr(),
color: Theme.of(context).colorScheme.primary, ),
text: 'resource_chart.in'.tr(), ],
), ),
const SizedBox(width: 5),
Legend(
color: Theme.of(context).colorScheme.tertiary,
text: 'resource_chart.out'.tr(),
), ),
], ],
), ),
@ -172,6 +187,7 @@ class Legend extends StatelessWidget {
@override @override
Widget build(final BuildContext context) => Row( Widget build(final BuildContext context) => Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [ children: [
_ColoredBox(color: color), _ColoredBox(color: color),
const SizedBox(width: 5), const SizedBox(width: 5),