Skip to content

Commit

Permalink
TW-2088 used TwakeAppBar in Group information
Browse files Browse the repository at this point in the history
  • Loading branch information
KhaledNjim authored and hoangdat committed Nov 20, 2024
1 parent 1aedc20 commit e252537
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 40 deletions.
56 changes: 17 additions & 39 deletions lib/pages/chat_details/chat_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,23 @@ class ChatDetailsView extends StatelessWidget {
return Scaffold(
floatingActionButton: _AddMembersButton(controller: controller),
backgroundColor: LinagoraSysColors.material().onPrimary,
appBar: AppBar(
backgroundColor: LinagoraSysColors.material().onPrimary,
automaticallyImplyLeading: false,
bottom: PreferredSize(
preferredSize: const Size(double.infinity, 1),
child: Container(
color: LinagoraStateLayer(
LinagoraSysColors.material().surfaceTint,
).opacityLayer1,
height: 1,
),
),
title: Padding(
padding: ChatDetailViewStyle.navigationAppBarPadding,
child: Row(
children: [
Padding(
padding: ChatDetailViewStyle.backIconPadding,
child: IconButton(
splashColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onPressed: controller.widget.closeRightColumn,
icon: controller.widget.isInStack
? const Icon(
Icons.chevron_left_outlined,
)
: const Icon(Icons.close),
),
),
Flexible(
child: Text(
L10n.of(context)!.groupInformation,
style: Theme.of(context).textTheme.titleLarge,
overflow: TextOverflow.ellipsis,
),
),
],
),
appBar: TwakeAppBar(
backgroundColor: controller.responsive.isMobile(context)
? LinagoraSysColors.material().surface
: LinagoraSysColors.material().onPrimary,
title: L10n.of(context)!.groupInformation,
leading: TwakeIconButton(
paddingAll: 8,
splashColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: controller.widget.closeRightColumn,
icon: controller.widget.isInStack
? Icons.arrow_back_ios
: Icons.close,
),
centerTitle: true,
withDivider: true,
actions: [
IconButton(
splashColor: Colors.transparent,
Expand All @@ -85,6 +62,7 @@ class ChatDetailsView extends StatelessWidget {
icon: const Icon(Icons.edit_outlined),
),
],
context: context,
),
body: NestedScrollView(
physics: const ClampingScrollPhysics(),
Expand Down
5 changes: 4 additions & 1 deletion lib/widgets/app_bars/twake_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TwakeAppBar extends StatelessWidget implements PreferredSizeWidget {
final Widget? leading;
final bool? centerTitle;
final List<Widget>? actions;
final Color? backgroundColor;

const TwakeAppBar({
super.key,
Expand All @@ -22,12 +23,14 @@ class TwakeAppBar extends StatelessWidget implements PreferredSizeWidget {
this.leading,
this.centerTitle,
this.actions,
this.backgroundColor,
});

@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: TwakeAppBarStyle.appBarBackgroundColor(context),
backgroundColor:
backgroundColor ?? TwakeAppBarStyle.appBarBackgroundColor(context),
toolbarHeight: TwakeAppBarStyle.toolBarHeight(context),
centerTitle:
centerTitle ?? TwakeAppBarStyle.responsiveUtils.isMobile(context),
Expand Down

0 comments on commit e252537

Please sign in to comment.