Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/pages/my_reports_pages/detail/shared_report_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ class ReportDetailWidgets {
);
}

static Widget buildPhotoCarousel({
static Widget? buildPhotoCarousel({
required dynamic report,
}) {
if (report.photos.isEmpty) {
return null;
}

return CarouselView(
scrollDirection: Axis.horizontal,
itemExtent: double.infinity,
Expand Down
9 changes: 5 additions & 4 deletions lib/pages/my_reports_pages/widgets/report_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ReportDetailPage extends StatelessWidget {
final Text title;
final Future<void> Function(dynamic report) onTapDelete;
final Map<IconData, String>? extraListTileMap;
final Widget Function(dynamic report)? topBarBackgroundBuilder;
final Widget? Function(dynamic report)? topBarBackgroundBuilder;
final Widget Function()? cardBuilder;

const ReportDetailPage({
Expand Down Expand Up @@ -84,13 +84,14 @@ class ReportDetailPage extends StatelessWidget {
report.location.point.latitude,
report.location.point.longitude,
);
final topBarBackground = topBarBackgroundBuilder?.call(report);
return Scaffold(
body: SafeArea(
top: false,
child: CustomScrollView(slivers: [
SliverAppBar(
titleSpacing: 0,
expandedHeight: topBarBackgroundBuilder != null ? 250.0 : 0.0,
expandedHeight: topBarBackground != null ? 250.0 : 0.0,
floating: true,
pinned: true,
snap: true,
Expand Down Expand Up @@ -131,10 +132,10 @@ class ReportDetailPage extends StatelessWidget {
color: Colors.white,
) ??
const TextStyle(color: Colors.white)),
background: topBarBackgroundBuilder == null
background: topBarBackground == null
? null
: Stack(fit: StackFit.expand, children: [
topBarBackgroundBuilder!.call(report),
topBarBackground,
Positioned(
bottom: 0,
left: 0,
Expand Down
Loading