@@ -12,7 +12,7 @@ class ReportDetailPage extends StatelessWidget {
1212 final Text title;
1313 final Future <void > Function (dynamic report) onTapDelete;
1414 final Map <IconData , String >? extraListTileMap;
15- final Widget Function (dynamic report)? topBarBackgroundBuilder;
15+ final Widget ? Function (dynamic report)? topBarBackgroundBuilder;
1616 final Widget Function ()? cardBuilder;
1717
1818 const ReportDetailPage ({
@@ -84,13 +84,14 @@ class ReportDetailPage extends StatelessWidget {
8484 report.location.point.latitude,
8585 report.location.point.longitude,
8686 );
87+ final topBarBackground = topBarBackgroundBuilder? .call (report);
8788 return Scaffold (
8889 body: SafeArea (
8990 top: false ,
9091 child: CustomScrollView (slivers: [
9192 SliverAppBar (
9293 titleSpacing: 0 ,
93- expandedHeight: topBarBackgroundBuilder != null ? 250.0 : 0.0 ,
94+ expandedHeight: topBarBackground != null ? 250.0 : 0.0 ,
9495 floating: true ,
9596 pinned: true ,
9697 snap: true ,
@@ -131,10 +132,10 @@ class ReportDetailPage extends StatelessWidget {
131132 color: Colors .white,
132133 ) ??
133134 const TextStyle (color: Colors .white)),
134- background: topBarBackgroundBuilder == null
135+ background: topBarBackground == null
135136 ? null
136137 : Stack (fit: StackFit .expand, children: [
137- topBarBackgroundBuilder ! . call (report) ,
138+ topBarBackground ,
138139 Positioned (
139140 bottom: 0 ,
140141 left: 0 ,
0 commit comments