Browse Source

fix bug and update version

Caijinglong 5 years ago
parent
commit
9724ac2a76
4 changed files with 14 additions and 15 deletions
  1. 4
    0
      CHANGELOG.md
  2. 1
    1
      README.md
  3. 8
    13
      lib/src/ui/page/photo_main_page.dart
  4. 1
    1
      pubspec.yaml

+ 4
- 0
CHANGELOG.md View File

1
 # CHANGELOG
1
 # CHANGELOG
2
 
2
 
3
+## [0.1.10] fix bug
4
+
5
+fix a error widget bug.
6
+
3
 ## [0.1.9]
7
 ## [0.1.9]
4
 
8
 
5
 fix all assets i18n provider
9
 fix all assets i18n provider

+ 1
- 1
README.md View File

30
 
30
 
31
 ```yaml
31
 ```yaml
32
 dependencies:
32
 dependencies:
33
-  photo: ^0.1.9
33
+  photo: ^0.2.0
34
 ```
34
 ```
35
 
35
 
36
 ## import
36
 ## import

+ 8
- 13
lib/src/ui/page/photo_main_page.dart View File

1
+import 'dart:async';
1
 import 'dart:typed_data';
2
 import 'dart:typed_data';
2
 
3
 
3
 import 'package:flutter/material.dart';
4
 import 'package:flutter/material.dart';
25
   _PhotoMainPageState createState() => _PhotoMainPageState();
26
   _PhotoMainPageState createState() => _PhotoMainPageState();
26
 }
27
 }
27
 
28
 
28
-class _PhotoMainPageState extends State<PhotoMainPage>
29
-    with SelectedProvider, GalleryListProvider {
29
+class _PhotoMainPageState extends State<PhotoMainPage> with SelectedProvider, GalleryListProvider {
30
   Options get options => ConfigProvider.of(context).options;
30
   Options get options => ConfigProvider.of(context).options;
31
 
31
 
32
   I18nProvider get i18nProvider => ConfigProvider.of(context).provider;
32
   I18nProvider get i18nProvider => ConfigProvider.of(context).provider;
58
   @override
58
   @override
59
   void initState() {
59
   void initState() {
60
     super.initState();
60
     super.initState();
61
-    AssetPathEntity.all.name = i18nProvider.getAllGalleryText(options);
62
     _refreshList();
61
     _refreshList();
63
     scaffoldKey = GlobalKey();
62
     scaffoldKey = GlobalKey();
64
     scrollController = ScrollController();
63
     scrollController = ScrollController();
94
                 splashColor: Colors.transparent,
93
                 splashColor: Colors.transparent,
95
                 child: Text(
94
                 child: Text(
96
                   i18nProvider.getSureText(options, selectedCount),
95
                   i18nProvider.getSureText(options, selectedCount),
97
-                  style: selectedCount == 0
98
-                      ? textStyle.copyWith(color: options.disableColor)
99
-                      : textStyle,
96
+                  style: selectedCount == 0 ? textStyle.copyWith(color: options.disableColor) : textStyle,
100
                 ),
97
                 ),
101
                 onPressed: selectedCount == 0 ? null : sure,
98
                 onPressed: selectedCount == 0 ? null : sure,
102
               ),
99
               ),
153
     );
150
     );
154
   }
151
   }
155
 
152
 
156
-  void _refreshList() async {
153
+  Future<void> _refreshList() async {
157
     var pathList = await PhotoManager.getAssetPathList();
154
     var pathList = await PhotoManager.getAssetPathList();
158
 
155
 
159
     options.sortDelegate.sort(pathList);
156
     options.sortDelegate.sort(pathList);
162
     galleryPathList.addAll(pathList);
159
     galleryPathList.addAll(pathList);
163
 
160
 
164
     var imageList = await currentPath.assetList;
161
     var imageList = await currentPath.assetList;
162
+    AssetPathEntity.all.name = i18nProvider.getAllGalleryText(options);
165
     this.list.clear();
163
     this.list.clear();
166
     this.list.addAll(imageList);
164
     this.list.addAll(imageList);
167
     setState(() {
165
     setState(() {
461
                   height: 44.0,
459
                   height: 44.0,
462
                   alignment: Alignment.center,
460
                   alignment: Alignment.center,
463
                   child: Text(
461
                   child: Text(
464
-                    i18nProvider.getPreviewText(
465
-                        options, widget.selectedProvider),
462
+                    i18nProvider.getPreviewText(options, widget.selectedProvider),
466
                     style: textStyle,
463
                     style: textStyle,
467
                   ),
464
                   ),
468
                   padding: textPadding,
465
                   padding: textPadding,
518
       future: entity.thumbDataWithSize(size, size),
515
       future: entity.thumbDataWithSize(size, size),
519
       builder: (BuildContext context, AsyncSnapshot<Uint8List> snapshot) {
516
       builder: (BuildContext context, AsyncSnapshot<Uint8List> snapshot) {
520
         var futureData = snapshot.data;
517
         var futureData = snapshot.data;
521
-        if (snapshot.connectionState == ConnectionState.done &&
522
-            futureData != null) {
518
+        if (snapshot.connectionState == ConnectionState.done && futureData != null) {
523
           ImageLruCache.setData(entity, size, futureData);
519
           ImageLruCache.setData(entity, size, futureData);
524
           return _buildImageItem(context, futureData);
520
           return _buildImageItem(context, futureData);
525
         }
521
         }
546
       future: entity.videoDuration,
542
       future: entity.videoDuration,
547
       builder: (ctx, snapshot) {
543
       builder: (ctx, snapshot) {
548
         if (snapshot.hasData && snapshot != null) {
544
         if (snapshot.hasData && snapshot != null) {
549
-          var buildBadge =
550
-              badgeDelegate?.buildBadge(context, entity.type, snapshot.data);
545
+          var buildBadge = badgeDelegate?.buildBadge(context, entity.type, snapshot.data);
551
           if (buildBadge == null) {
546
           if (buildBadge == null) {
552
             return Container();
547
             return Container();
553
           } else {
548
           } else {

+ 1
- 1
pubspec.yaml View File

1
 name: photo
1
 name: photo
2
 description: image picker, multi picker support video / icloud asset ,use flutter as ui, if you want to build custom ui,you just use photo_manager.
2
 description: image picker, multi picker support video / icloud asset ,use flutter as ui, if you want to build custom ui,you just use photo_manager.
3
-version: 0.1.9
3
+version: 0.1.10
4
 author: caijinglong<cjl_spy@163.com>
4
 author: caijinglong<cjl_spy@163.com>
5
 homepage: https://github.com/CaiJingLong/flutter_photo
5
 homepage: https://github.com/CaiJingLong/flutter_photo
6
 
6