bottomDetailBuilder method

  1. @override
Widget bottomDetailBuilder(
  1. BuildContext context
)
override

Detail widget aligned to bottom. 底部信息部件

Implementation

@override
Widget bottomDetailBuilder(BuildContext context) {
  final backgroundColor = themeData.bottomAppBarTheme.color?.withOpacity(
    themeData.bottomAppBarTheme.color!.opacity *
        (isAppleOS(context) ? .9 : 1),
  );
  return ValueListenableBuilder(
    valueListenable: isDisplayingDetail,
    builder: (_, v, child) => AnimatedPositionedDirectional(
      duration: kThemeAnimationDuration,
      curve: Curves.easeInOut,
      bottom: v ? 0.0 : -(context.bottomPadding + bottomDetailHeight),
      start: 0.0,
      end: 0.0,
      height: context.bottomPadding + bottomDetailHeight,
      child: child!,
    ),
    child: CNP<AssetPickerViewerProvider<AssetEntity>?>.value(
      value: provider,
      child: Column(
        mainAxisSize: MainAxisSize.min,
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
          if (provider != null)
            ValueListenableBuilder<int>(
              valueListenable: selectedNotifier,
              builder: (_, int count, __) => Container(
                width: count > 0 ? double.maxFinite : 0,
                height: bottomPreviewHeight,
                color: backgroundColor,
                child: ListView.builder(
                  controller: previewingListController,
                  scrollDirection: Axis.horizontal,
                  padding: const EdgeInsets.symmetric(horizontal: 5.0),
                  physics: const ClampingScrollPhysics(),
                  itemCount: count,
                  itemBuilder: bottomDetailItemBuilder,
                ),
              ),
            ),
          Container(
            height: bottomBarHeight + context.bottomPadding,
            padding: const EdgeInsets.symmetric(horizontal: 20.0)
                .copyWith(bottom: context.bottomPadding),
            decoration: BoxDecoration(
              border: Border(top: BorderSide(color: themeData.canvasColor)),
              color: backgroundColor,
            ),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: <Widget>[
                if (provider != null || isWeChatMoment)
                  confirmButton(context),
              ],
            ),
          ),
        ],
      ),
    ),
  );
}