Skip to content

Commit 28ab263

Browse files
authored
remove loading child (#307)
1 parent c9d5885 commit 28ab263

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

lib/photo_view.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ class PhotoView extends StatefulWidget {
238238
PhotoView({
239239
Key key,
240240
@required this.imageProvider,
241-
@Deprecated("Use loadingBuilder instead") this.loadingChild,
242241
this.loadingBuilder,
243242
this.loadFailedChild,
244243
this.backgroundDecoration,
@@ -294,16 +293,12 @@ class PhotoView extends StatefulWidget {
294293
imageProvider = null,
295294
gaplessPlayback = false,
296295
loadingBuilder = null,
297-
loadingChild = null,
298296
super(key: key);
299297

300298
/// Given a [imageProvider] it resolves into an zoomable image widget using. It
301299
/// is required
302300
final ImageProvider imageProvider;
303301

304-
/// You should now use loadingBuilder(context, progress) => widget
305-
final Widget loadingChild;
306-
307302
/// While [imageProvider] is not resolved, [loadingBuilder] is called by [PhotoView]
308303
/// into the screen, by default it is a centered [CircularProgressIndicator]
309304
final LoadingBuilder loadingBuilder;
@@ -622,10 +617,6 @@ class _PhotoViewState extends State<PhotoView> {
622617
return widget.loadingBuilder(context, _imageChunkEvent);
623618
}
624619

625-
if (widget.loadingChild != null) {
626-
return widget.loadingChild;
627-
}
628-
629620
return PhotoViewDefaultLoading(
630621
event: _imageChunkEvent,
631622
);

lib/photo_view_gallery.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ class PhotoViewGallery extends StatefulWidget {
102102
const PhotoViewGallery({
103103
Key key,
104104
@required this.pageOptions,
105-
@Deprecated("Use loadingBuilder instead") this.loadingChild,
106105
this.loadingBuilder,
107106
this.loadFailedChild,
108107
this.backgroundDecoration,
@@ -115,8 +114,7 @@ class PhotoViewGallery extends StatefulWidget {
115114
this.scrollPhysics,
116115
this.scrollDirection = Axis.horizontal,
117116
this.customSize,
118-
}) : _isBuilder = false,
119-
itemCount = null,
117+
}) : itemCount = null,
120118
builder = null,
121119
assert(pageOptions != null),
122120
super(key: key);
@@ -128,7 +126,6 @@ class PhotoViewGallery extends StatefulWidget {
128126
Key key,
129127
@required this.itemCount,
130128
@required this.builder,
131-
@Deprecated("Use loadingBuilder instead") this.loadingChild,
132129
this.loadingBuilder,
133130
this.loadFailedChild,
134131
this.backgroundDecoration,
@@ -141,8 +138,7 @@ class PhotoViewGallery extends StatefulWidget {
141138
this.scrollPhysics,
142139
this.scrollDirection = Axis.horizontal,
143140
this.customSize,
144-
}) : _isBuilder = true,
145-
pageOptions = null,
141+
}) : pageOptions = null,
146142
assert(itemCount != null),
147143
assert(builder != null),
148144
super(key: key);
@@ -162,9 +158,6 @@ class PhotoViewGallery extends StatefulWidget {
162158
/// Mirror to [PhotoView.loadingBuilder]
163159
final LoadingBuilder loadingBuilder;
164160

165-
/// Mirror to [PhotoView.loadingchild]
166-
final Widget loadingChild;
167-
168161
/// Mirror to [PhotoView.loadFailedChild]
169162
final Widget loadFailedChild;
170163

@@ -195,7 +188,7 @@ class PhotoViewGallery extends StatefulWidget {
195188
/// The axis along which the [PageView] scrolls. Mirror to [PageView.scrollDirection]
196189
final Axis scrollDirection;
197190

198-
final bool _isBuilder;
191+
bool get _isBuilder => builder != null;
199192

200193
@override
201194
State<StatefulWidget> createState() {
@@ -277,7 +270,6 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
277270
key: ObjectKey(index),
278271
imageProvider: pageOption.imageProvider,
279272
loadingBuilder: widget.loadingBuilder,
280-
loadingChild: widget.loadingChild,
281273
loadFailedChild: widget.loadFailedChild,
282274
backgroundDecoration: widget.backgroundDecoration,
283275
controller: pageOption.controller,

0 commit comments

Comments
 (0)