appBar method
AppBar widget. 顶栏部件
Implementation
Widget appBar(BuildContext context) {
return ValueListenableBuilder<bool>(
valueListenable: isDisplayingDetail,
builder: (_, bool value, Widget? child) => AnimatedPositionedDirectional(
duration: kThemeAnimationDuration,
curve: Curves.easeInOut,
top: value ? 0.0 : -(Screens.topSafeHeight + kToolbarHeight),
start: 0.0,
end: 0.0,
height: Screens.topSafeHeight + kToolbarHeight,
child: child!,
),
child: Container(
padding: EdgeInsetsDirectional.only(
top: Screens.topSafeHeight,
end: 12.0,
),
color: themeData.canvasColor.withOpacity(0.85),
child: Row(
children: <Widget>[
const BackButton(),
if (!isAppleOS && specialPickerType == null)
StreamBuilder<int>(
initialData: currentIndex,
stream: pageStreamController.stream,
builder: (BuildContext _, AsyncSnapshot<int> snapshot) {
return Text(
'${snapshot.data! + 1}/${previewAssets.length}',
style: const TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
);
},
),
const Spacer(),
if (isAppleOS && provider != null) selectButton(context),
if (!isAppleOS && (provider != null || isWeChatMoment))
confirmButton(context),
],
),
),
);
}