bottomDetailBuilder method

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

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

Implementation

@override
Widget bottomDetailBuilder(BuildContext context) {
  final Color _backgroundColor = themeData.canvasColor.withOpacity(0.85);
  return ValueListenableBuilder2<bool, int>(
    firstNotifier: isDisplayingDetail,
    secondNotifier: selectedNotifier,
    builder: (_, bool v, __, Widget? child) => AnimatedPositionedDirectional(
      duration: kThemeAnimationDuration,
      curve: Curves.easeInOut,
      bottom: v ? 0 : -(Screens.bottomSafeHeight + bottomDetailHeight),
      start: 0,
      end: 0,
      height: Screens.bottomSafeHeight + bottomDetailHeight,
      child: child!,
    ),
    child: Padding(
      padding: EdgeInsetsDirectional.only(bottom: Screens.bottomSafeHeight),
      child: ChangeNotifierProvider<
          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: 90,
                  color: _backgroundColor,
                  child: ListView.builder(
                    scrollDirection: Axis.horizontal,
                    padding: const EdgeInsets.symmetric(horizontal: 5.0),
                    itemCount: count,
                    itemBuilder: bottomDetailItemBuilder,
                  ),
                ),
              ),
            Container(
              height: 50,
              padding: const EdgeInsets.symmetric(horizontal: 20.0),
              decoration: BoxDecoration(
                border: Border(
                  top: BorderSide(
                    width: 1.0,
                    color: themeData.dividerColor,
                  ),
                ),
                color: _backgroundColor,
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  const Spacer(),
                  if (isAppleOS && (provider != null || isWeChatMoment))
                    confirmButton(context)
                  else
                    selectButton(context),
                ],
              ),
            ),
          ],
        ),
      ),
    ),
  );
}