Quellcode durchsuchen

fix bug and update version

Caijinglong vor 5 Jahren
Ursprung
Commit
9724ac2a76
4 geänderte Dateien mit 14 neuen und 15 gelöschten Zeilen
  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 Datei anzeigen

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

+ 1
- 1
README.md Datei anzeigen

@@ -30,7 +30,7 @@ so PhotoPicker.pickImage return type will change to `List<AssetEntity>`
30 30
 
31 31
 ```yaml
32 32
 dependencies:
33
-  photo: ^0.1.9
33
+  photo: ^0.2.0
34 34
 ```
35 35
 
36 36
 ## import

+ 8
- 13
lib/src/ui/page/photo_main_page.dart Datei anzeigen

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

+ 1
- 1
pubspec.yaml Datei anzeigen

@@ -1,6 +1,6 @@
1 1
 name: photo
2 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 4
 author: caijinglong<cjl_spy@163.com>
5 5
 homepage: https://github.com/CaiJingLong/flutter_photo
6 6