Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TesteurManiak committed Oct 13, 2023
1 parent a79653d commit f5d6282
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/photo_view_gallery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:photo_view/photo_view.dart'
PhotoViewImageTapUpCallback,
PhotoViewImageScaleEndCallback,
ScaleStateCycle;

import 'package:photo_view/src/controller/photo_view_controller.dart';
import 'package:photo_view/src/controller/photo_view_scalestate_controller.dart';
import 'package:photo_view/src/core/photo_view_gesture_detector.dart';
Expand Down Expand Up @@ -126,8 +125,8 @@ class PhotoViewGallery extends StatefulWidget {
/// The builder must return a [PhotoViewGalleryPageOptions].
const PhotoViewGallery.builder({
Key? key,
required this.itemCount,
required this.builder,
required PhotoViewGalleryBuilder this.builder,
this.itemCount,
this.loadingBuilder,
this.backgroundDecoration,
this.wantKeepAlive = false,
Expand All @@ -142,8 +141,6 @@ class PhotoViewGallery extends StatefulWidget {
this.customSize,
this.allowImplicitScrolling = false,
}) : pageOptions = null,
assert(itemCount != null),
assert(builder != null),
super(key: key);

/// A list of options to describe the items in the gallery
Expand Down Expand Up @@ -216,11 +213,11 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
return _controller.hasClients ? _controller.page!.floor() : 0;
}

int get itemCount {
int? get itemCount {
if (widget._isBuilder) {
return widget.itemCount!;
return widget.itemCount;
}
return widget.pageOptions!.length;
return widget.pageOptions?.length;
}

@override
Expand Down

0 comments on commit f5d6282

Please sign in to comment.