buildTopWidget method

  1. @override
Widget buildTopWidget(
  1. {required BuildContext context,
  2. required WidgetRef ref,
  3. required AppModel appModel,
  4. required CreatorModel creatorModel,
  5. required Orientation orientation}
)
override

Media fields are special and have a Widget that is shown at the top of the Card Creator.

Implementation

@override
Widget buildTopWidget({
  required BuildContext context,
  required WidgetRef ref,
  required AppModel appModel,
  required CreatorModel creatorModel,
  required Orientation orientation,
}) {
  if (isSearching) {
    return buildDisabledPlayer(context);
  }

  if (!showWidget) {
    if (orientation == Orientation.landscape) {
      return const SizedBox(height: 24);
    } else {
      return const SizedBox.shrink();
    }
  }

  return buildAudioPlayer();
}