collapsing toolbar behaviour changed as like barq

pull/174/head
Sikander Saleem 2 months ago
parent 45b013a048
commit 0b9df1f22b

@ -61,62 +61,66 @@ class CollapsingListView extends StatelessWidget {
controller: _controller, controller: _controller,
slivers: [ slivers: [
SliverAppBar( SliverAppBar(
automaticallyImplyLeading: isLeading, automaticallyImplyLeading: isLeading,
pinned: true, pinned: true,
toolbarHeight: isLeading ? 40.h : kToolbarHeight, toolbarHeight: 40,
leadingWidth: isLeading ? null : double.infinity, leadingWidth: isLeading ? null : double.infinity,
systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light), systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light),
surfaceTintColor: Colors.transparent, surfaceTintColor: Colors.transparent,
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
bottom: isLeading bottom:
? ScrollAnimatedTitle( // isLeading
title: title, // ?
showBack: true, ScrollAnimatedTitle(
controller: _controller, title: title,
search: search, showBack: true,
report: report, controller: _controller,
logout: logout, search: search,
history: history, report: report,
instructions: instructions, logout: logout,
requests: requests, history: history,
sendEmail: sendEmail, instructions: instructions,
bottomChild: bottomChild, requests: requests,
trailing: trailing, sendEmail: sendEmail,
) bottomChild: bottomChild,
: null, trailing: trailing,
leading: isLeading ),
? Transform.flip( // : null,
flipX: appState.isArabic(), leading: Visibility(
child: IconButton( visible: isLeading,
icon: Utils.buildSvgWithAssets(icon: isClose ? AppAssets.close_bottom_nav_trans : AppAssets.arrow_back_new, width: 24.h, height: 24.h), child: Transform.flip(
padding: EdgeInsets.zero, flipX: appState.isArabic(),
constraints: BoxConstraints(), child: IconButton(
style: const ButtonStyle(tapTargetSize: MaterialTapTargetSize.shrinkWrap), icon: Utils.buildSvgWithAssets(icon: isClose ? AppAssets.close_bottom_nav_trans : AppAssets.arrow_back_new, width: 24.h, height: 24.h),
onPressed: () { padding: EdgeInsets.zero,
if (leadingCallback != null) { constraints: BoxConstraints(),
leadingCallback!(); style: const ButtonStyle(tapTargetSize: MaterialTapTargetSize.shrinkWrap),
} else { onPressed: () {
context.pop(); if (leadingCallback != null) {
} leadingCallback!();
}, } else {
highlightColor: Colors.transparent, context.pop();
), }
) },
: ScrollAnimatedTitle( highlightColor: Colors.transparent,
title: title,
showBack: false,
controller: _controller,
search: search,
report: report,
logout: logout,
history: history,
instructions: instructions,
requests: requests,
sendEmail: sendEmail,
bottomChild: bottomChild,
trailing: trailing,
), ),
), ),
)
// : ScrollAnimatedTitle(
// title: title,
// showBack: false,
// controller: _controller,
// search: search,
// report: report,
// logout: logout,
// history: history,
// instructions: instructions,
// requests: requests,
// sendEmail: sendEmail,
// bottomChild: bottomChild,
// trailing: trailing,
// ),
),
SliverList( SliverList(
delegate: SliverChildBuilderDelegate( delegate: SliverChildBuilderDelegate(
(context, index) => child, (context, index) => child,
@ -267,7 +271,7 @@ class _ScrollAnimatedTitleState extends State<ScrollAnimatedTitle> {
style: TextStyle( style: TextStyle(
fontSize: _fontSize, fontSize: _fontSize,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: -1.0, letterSpacing: -0.5,
), ),
).expanded, ).expanded,
...[ ...[

Loading…
Cancel
Save