Skip to content

Commit 6d5ebf9

Browse files
committed
photo view loading
1 parent 0a31cd9 commit 6d5ebf9

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

‎lib/page/PhotoViewPage.dart‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_spinkit/flutter_spinkit.dart';
33
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
4+
import 'package:gsy_github_app_flutter/widget/GSYCommonOptionWidget.dart';
5+
import 'package:gsy_github_app_flutter/widget/GSYTitleBar.dart';
46
import 'package:photo_view/photo_view.dart';
57

68
/**
@@ -16,22 +18,25 @@ class PhotoViewPage extends StatelessWidget {
1618

1719
@override
1820
Widget build(BuildContext context) {
21+
OptionControl optionControl = new OptionControl();
22+
optionControl.url = url;
1923
return new Scaffold(
20-
appBar: new AppBar(),
21-
body: new Container(
22-
child: new PhotoView(
23-
imageProvider: new NetworkImage(url ?? GSYICons.DEFAULT_REMOTE_PIC),
24-
loadingChild: Container(
25-
child: new Stack(
26-
children: <Widget>[
27-
new Center(child: new Image.asset(GSYICons.DEFAULT_IMAGE)),
28-
new Center(child: new SpinKitDoubleBounce(color: Color(GSYColors.primaryValue))),
29-
],
24+
appBar: new AppBar(
25+
title: GSYTitleBar("", rightWidget: new GSYCommonOptionWidget(optionControl)),
26+
),
27+
body: new Container(
28+
color: Colors.black,
29+
child: new PhotoView(
30+
imageProvider: new NetworkImage(url ?? GSYICons.DEFAULT_REMOTE_PIC),
31+
loadingChild: Container(
32+
child: new Stack(
33+
children: <Widget>[
34+
new Center(child: new Image.asset(GSYICons.DEFAULT_IMAGE, height: 150.0, width: 150.0)),
35+
new Center(child: new SpinKitFoldingCube(color: Colors.white30, size: 60.0)),
36+
],
37+
),
3038
),
3139
),
32-
),
33-
)
34-
);
35-
40+
));
3641
}
3742
}

0 commit comments

Comments
 (0)