File tree Expand file tree Collapse file tree 2 files changed +1
-21
lines changed
Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ class _AlbumPageState extends State<AlbumPage> implements AlbumPageContract {
2424 RefreshController (initialRefresh: false );
2525 int _perPageItemSize = 8 ;
2626 int _currentPage = 0 ;
27- int _count = 0 ; //列表总数
2827
2928 _AlbumPageState () {
3029 _presenter = AlbumPagePresenter (this );
@@ -33,16 +32,14 @@ class _AlbumPageState extends State<AlbumPage> implements AlbumPageContract {
3332 @override
3433 void initState () {
3534 super .initState ();
36- _presenter.doGetItemCount ();
3735 _onRefresh ();
3836 }
3937
4038 @override
4139 Widget build (BuildContext context) {
4240 return Scaffold (
4341 appBar: AppBar (
44- title: Text (
45- '相册 - ${_uploadeds ?.length ?? 0 }${_count == _uploadeds .length ? '' : " - $_count " }' ),
42+ title: Text ('相册 - ${_uploadeds ?.length ?? 0 }' ),
4643 centerTitle: true ,
4744 ),
4845 floatingActionButton: FloatingActionButton (
@@ -268,11 +265,4 @@ class _AlbumPageState extends State<AlbumPage> implements AlbumPageContract {
268265 this ._uploadeds.remove (uploaded);
269266 });
270267 }
271-
272- @override
273- void loadItemCount (int count) {
274- setState (() {
275- this ._count = count;
276- });
277- }
278268}
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ abstract class AlbumPageContract {
88 void loadUploadedImages (List <Uploaded > uploadeds);
99 void loadError ();
1010
11- void loadItemCount (int count);
12-
1311 void deleteSuccess (Uploaded uploaded);
1412 void deleteError (String msg);
1513}
@@ -34,14 +32,6 @@ class AlbumPagePresenter {
3432 }
3533 }
3634
37- doGetItemCount () async {
38- try {
39- var sql = Sql .setTable (TABLE_NAME_UPLOADED );
40- var result = await sql.get ();
41- _view.loadItemCount (result.length ?? 0 );
42- } catch (e) {}
43- }
44-
4535 doDeleteImage (Uploaded uploaded) async {
4636 try {
4737 ImageUploadUtils uploader = ImageUploadUtils (
You can’t perform that action at this time.
0 commit comments