diff --git a/lib/widgets/twake_components/twake_header.dart b/lib/widgets/twake_components/twake_header.dart index c459cd94ab..6968b5d3cb 100644 --- a/lib/widgets/twake_components/twake_header.dart +++ b/lib/widgets/twake_components/twake_header.dart @@ -37,41 +37,49 @@ class TwakeHeader extends StatelessWidget padding: TwakeHeaderStyle.padding, child: Row( children: [ - if (selectMode == SelectMode.select) - Row( + Expanded( + flex: 3, + child: Row( children: [ InkWell( onTap: onClearSelection, - child: Padding( - padding: TwakeHeaderStyle.closeIconPadding, - child: Icon( - Icons.close, - size: TwakeHeaderStyle.closeIconSize, - color: Theme.of(context) - .colorScheme - .onSurfaceVariant, - ), + borderRadius: BorderRadius.circular( + TwakeHeaderStyle.closeIconSize, + ), + child: Icon( + Icons.close, + size: TwakeHeaderStyle.closeIconSize, + color: selectMode == SelectMode.select + ? Theme.of(context).colorScheme.onSurfaceVariant + : Colors.transparent, ), ), ValueListenableBuilder( valueListenable: conversationSelectionNotifier, builder: (context, conversationSelection, _) { - return Text( - conversationSelection.length.toString(), - style: Theme.of(context) - .textTheme - .bodyLarge - ?.copyWith( - color: Theme.of(context) - .colorScheme - .onSurfaceVariant, - ), + return Padding( + padding: TwakeHeaderStyle.counterSelectionPadding, + child: Text( + conversationSelection.length.toString(), + style: Theme.of(context) + .textTheme + .bodyLarge + ?.copyWith( + color: selectMode == SelectMode.select + ? Theme.of(context) + .colorScheme + .onSurfaceVariant + : Colors.transparent, + ), + ), ); }, ), ], ), + ), Expanded( + flex: 6, child: Align( alignment: Alignment.center, child: Text( @@ -83,25 +91,29 @@ class TwakeHeader extends StatelessWidget ), ), if (!TwakeHeaderStyle.isDesktop(context)) - InkWell( - borderRadius: BorderRadius.circular( - TwakeHeaderStyle.textBorderRadius, - ), - onTap: openSelectMode, + Expanded( + flex: 3, child: Align( alignment: Alignment.centerRight, - child: Padding( - padding: TwakeHeaderStyle.textButtonPadding, - child: Text( - selectMode == SelectMode.normal - ? L10n.of(context)!.edit - : L10n.of(context)!.done, - style: Theme.of(context) - .textTheme - .labelLarge - ?.copyWith( - color: Theme.of(context).colorScheme.primary, - ), + child: InkWell( + borderRadius: BorderRadius.circular( + TwakeHeaderStyle.textBorderRadius, + ), + onTap: openSelectMode, + child: Padding( + padding: TwakeHeaderStyle.textButtonPadding, + child: Text( + selectMode == SelectMode.normal + ? L10n.of(context)!.edit + : L10n.of(context)!.done, + style: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith( + color: + Theme.of(context).colorScheme.primary, + ), + ), ), ), ), diff --git a/lib/widgets/twake_components/twake_header_style.dart b/lib/widgets/twake_components/twake_header_style.dart index 2c64f751b0..eba2530b39 100644 --- a/lib/widgets/twake_components/twake_header_style.dart +++ b/lib/widgets/twake_components/twake_header_style.dart @@ -20,13 +20,13 @@ class TwakeHeaderStyle { } static const EdgeInsetsDirectional padding = EdgeInsetsDirectional.only( - end: 16, - start: 16, + end: 4, + start: 4, ); static const EdgeInsetsDirectional textButtonPadding = EdgeInsetsDirectional.all(8); - static const EdgeInsetsDirectional closeIconPadding = - EdgeInsetsDirectional.only(end: 4); + static const EdgeInsetsDirectional counterSelectionPadding = + EdgeInsetsDirectional.only(start: 4); }