chore: Adjust appbar design

This commit is contained in:
Christian Pauly 2022-07-12 19:39:18 +02:00
parent b9e72225f9
commit f39213ca9b
5 changed files with 23 additions and 18 deletions

View File

@ -181,12 +181,10 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
radius: Avatar.defaultSize / 2, radius: Avatar.defaultSize / 2,
child: child:
const Icon(Icons.enhanced_encryption_outlined), const Icon(Icons.enhanced_encryption_outlined),
backgroundColor: Theme.of(context) backgroundColor:
.colorScheme Theme.of(context).colorScheme.surfaceVariant,
.secondaryContainer, foregroundColor:
foregroundColor: Theme.of(context) Theme.of(context).colorScheme.onSurfaceVariant,
.colorScheme
.onSecondaryContainer,
), ),
title: Text( title: Text(
(Matrix.of(context) (Matrix.of(context)

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:vrouter/vrouter.dart'; import 'package:vrouter/vrouter.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pages/chat_list/chat_list.dart'; import 'package:fluffychat/pages/chat_list/chat_list.dart';
import 'package:fluffychat/pages/chat_list/client_chooser_button.dart'; import 'package:fluffychat/pages/chat_list/client_chooser_button.dart';
import 'package:fluffychat/widgets/matrix.dart'; import 'package:fluffychat/widgets/matrix.dart';
@ -18,6 +19,7 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
return AppBar( return AppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
scrolledUnderElevation: selectMode == SelectMode.normal ? 0 : null,
leading: selectMode == SelectMode.normal leading: selectMode == SelectMode.normal
? null ? null
: IconButton( : IconButton(
@ -36,26 +38,31 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
controller.selectedRoomIds.length.toString(), controller.selectedRoomIds.length.toString(),
key: const ValueKey(SelectMode.select), key: const ValueKey(SelectMode.select),
) )
: SizedBox( : Material(
height: 44, color: Theme.of(context).brightness == Brightness.light
? Colors.white
: Colors.black,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(AppConfig.borderRadius),
topRight: Radius.circular(AppConfig.borderRadius),
),
elevation: 6,
shadowColor: Theme.of(context).dividerColor.withAlpha(100),
child: TextField( child: TextField(
controller: controller.searchController, controller: controller.searchController,
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
onChanged: controller.onSearchEnter, onChanged: controller.onSearchEnter,
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Theme.of(context).colorScheme.surfaceVariant, border: const UnderlineInputBorder(
contentPadding: EdgeInsets.zero, borderSide: BorderSide.none),
border: OutlineInputBorder( filled: false,
borderRadius: BorderRadius.circular(90),
borderSide: BorderSide.none,
),
hintText: controller.activeSpacesEntry.getName(context), hintText: controller.activeSpacesEntry.getName(context),
prefixIcon: controller.isSearchMode prefixIcon: controller.isSearchMode
? IconButton( ? IconButton(
tooltip: L10n.of(context)!.cancel, tooltip: L10n.of(context)!.cancel,
icon: const Icon(Icons.close_outlined), icon: const Icon(Icons.close_outlined),
onPressed: controller.cancelSearch, onPressed: controller.cancelSearch,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.onBackground,
) )
: IconButton( : IconButton(
onPressed: Scaffold.of(context).openDrawer, onPressed: Scaffold.of(context).openDrawer,

View File

@ -119,7 +119,7 @@ class StoriesHeader extends StatelessWidget {
...client.storiesRooms..remove(ownStoryRoom), ...client.storiesRooms..remove(ownStoryRoom),
]; ];
return SizedBox( return SizedBox(
height: 98, height: 96,
child: ListView.builder( child: ListView.builder(
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 12),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,

View File

@ -25,6 +25,6 @@ extension StringColor on String {
number += codeUnitAt(i); number += codeUnitAt(i);
} }
number = (number % 12) * 25.5; number = (number % 12) * 25.5;
return HSLColor.fromAHSL(1, number, 1, 0.8).toColor(); return HSLColor.fromAHSL(1, number, 1, 0.7).toColor();
} }
} }

View File

@ -48,7 +48,7 @@ class Avatar extends StatelessWidget {
child: Text( child: Text(
fallbackLetters, fallbackLetters,
style: TextStyle( style: TextStyle(
color: noPic ? name?.darkColor : null, color: noPic ? Colors.white : null,
fontSize: fontSize, fontSize: fontSize,
), ),
), ),