appBar method
AppBar widget. 顶栏部件
Implementation
Widget appBar(BuildContext context) {
return AssetPickerAppBar(
leading: Semantics(
sortKey: ordinalSortKey(0),
child: IconButton(
onPressed: Navigator.of(context).maybePop,
tooltip: MaterialLocalizations.of(context).closeButtonTooltip,
icon: Icon(
Icons.close,
semanticLabel: MaterialLocalizations.of(context).closeButtonTooltip,
),
),
),
centerTitle: true,
title: specialPickerType == null
? Semantics(
sortKey: ordinalSortKey(0.1),
child: StreamBuilder<int>(
initialData: currentIndex,
stream: pageStreamController.stream,
builder: (_, AsyncSnapshot<int> snapshot) => ScaleText(
'${snapshot.requireData + 1}/${previewAssets.length}',
style: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w500,
),
),
),
)
: null,
actions: [
if (provider != null)
Semantics(
sortKey: ordinalSortKey(0.2),
child: selectButton(context),
),
const SizedBox(width: 14),
],
);
}