소스 검색

导入了最新的photo_manager的包

cjl_macbook 6 년 전
부모
커밋
2a71109057
5개의 변경된 파일16개의 추가작업 그리고 67개의 파일을 삭제
  1. 1
    0
      example/.gitignore
  2. 7
    62
      example/lib/main.dart
  3. 1
    0
      lib/src/ui/page/photo_main_page.dart
  4. 3
    3
      pubspec.lock
  5. 4
    2
      pubspec.yaml

+ 1
- 0
example/.gitignore 파일 보기

@@ -62,6 +62,7 @@ build/
62 62
 **/ios/Flutter/flutter_assets/
63 63
 **/ios/ServiceDefinitions.json
64 64
 **/ios/Runner/GeneratedPluginRegistrant.*
65
+**/ios/Runner.xcworkspace/
65 66
 
66 67
 # Exceptions to above rules.
67 68
 !**/ios/**/default.mode1v3

+ 7
- 62
example/lib/main.dart 파일 보기

@@ -8,35 +8,17 @@ class MyApp extends StatelessWidget {
8 8
   @override
9 9
   Widget build(BuildContext context) {
10 10
     return new MaterialApp(
11
-      title: 'Flutter Demo',
11
+      title: 'Pick Image Demo',
12 12
       theme: new ThemeData(
13
-        // This is the theme of your application.
14
-        //
15
-        // Try running your application with "flutter run". You'll see the
16
-        // application has a blue toolbar. Then, without quitting the app, try
17
-        // changing the primarySwatch below to Colors.green and then invoke
18
-        // "hot reload" (press "r" in the console where you ran "flutter run",
19
-        // or press Run > Flutter Hot Reload in IntelliJ). Notice that the
20
-        // counter didn't reset back to zero; the application is not restarted.
21 13
         primarySwatch: Colors.blue,
22 14
       ),
23
-      home: new MyHomePage(title: 'Flutter Demo Home Page'),
15
+      home: new MyHomePage(title: 'Pick Image Demo'),
24 16
     );
25 17
   }
26 18
 }
27 19
 
28 20
 class MyHomePage extends StatefulWidget {
29 21
   MyHomePage({Key key, this.title}) : super(key: key);
30
-
31
-  // This widget is the home page of your application. It is stateful, meaning
32
-  // that it has a State object (defined below) that contains fields that affect
33
-  // how it looks.
34
-
35
-  // This class is the configuration for the state. It holds the values (in this
36
-  // case the title) provided by the parent (in this case the App widget) and
37
-  // used by the build method of the State. Fields in a Widget subclass are
38
-  // always marked "final".
39
-
40 22
   final String title;
41 23
 
42 24
   @override
@@ -44,9 +26,8 @@ class MyHomePage extends StatefulWidget {
44 26
 }
45 27
 
46 28
 class _MyHomePageState extends State<MyHomePage> {
47
-  int _counter = 0;
48 29
 
49
-  void _incrementCounter() async{
30
+  void _pickImage() async{
50 31
     var imgList = await PhotoPicker.pickImage(
51 32
       context: context,
52 33
       themeColor: Colors.green,
@@ -61,52 +42,16 @@ class _MyHomePageState extends State<MyHomePage> {
61 42
 
62 43
   @override
63 44
   Widget build(BuildContext context) {
64
-    // This method is rerun every time setState is called, for instance as done
65
-    // by the _incrementCounter method above.
66
-    //
67
-    // The Flutter framework has been optimized to make rerunning build methods
68
-    // fast, so that you can just rebuild anything that needs updating rather
69
-    // than having to individually change instances of widgets.
70 45
     return new Scaffold(
71 46
       appBar: new AppBar(
72
-        // Here we take the value from the MyHomePage object that was created by
73
-        // the App.build method, and use it to set our appbar title.
74 47
         title: new Text(widget.title),
75 48
       ),
76
-      body: new Center(
77
-        // Center is a layout widget. It takes a single child and positions it
78
-        // in the middle of the parent.
79
-        child: new Column(
80
-          // Column is also layout widget. It takes a list of children and
81
-          // arranges them vertically. By default, it sizes itself to fit its
82
-          // children horizontally, and tries to be as tall as its parent.
83
-          //
84
-          // Invoke "debug paint" (press "p" in the console where you ran
85
-          // "flutter run", or select "Toggle Debug Paint" from the Flutter tool
86
-          // window in IntelliJ) to see the wireframe for each widget.
87
-          //
88
-          // Column has various properties to control how it sizes itself and
89
-          // how it positions its children. Here we use mainAxisAlignment to
90
-          // center the children vertically; the main axis here is the vertical
91
-          // axis because Columns are vertical (the cross axis would be
92
-          // horizontal).
93
-          mainAxisAlignment: MainAxisAlignment.center,
94
-          children: <Widget>[
95
-            new Text(
96
-              'You have pushed the button this many times:',
97
-            ),
98
-            new Text(
99
-              '$_counter',
100
-              style: Theme.of(context).textTheme.display1,
101
-            ),
102
-          ],
103
-        ),
104
-      ),
49
+      body: Container(),
105 50
       floatingActionButton: new FloatingActionButton(
106
-        onPressed: _incrementCounter,
107
-        tooltip: 'Increment',
51
+        onPressed: _pickImage,
52
+        tooltip: 'pickImage',
108 53
         child: new Icon(Icons.add),
109
-      ), // This trailing comma makes auto-formatting nicer for build methods.
54
+      ),
110 55
     );
111 56
   }
112 57
 

+ 1
- 0
lib/src/ui/page/photo_main_page.dart 파일 보기

@@ -427,6 +427,7 @@ class ImageItem extends StatelessWidget {
427 427
     if (thumb != null) {
428 428
       return _buildImageItem(thumb);
429 429
     }
430
+
430 431
     return FutureBuilder<Uint8List>(
431 432
       future: entity.thumbData,
432 433
       builder: (BuildContext context, AsyncSnapshot<Uint8List> snapshot) {

+ 3
- 3
pubspec.lock 파일 보기

@@ -211,9 +211,9 @@ packages:
211 211
     dependency: "direct main"
212 212
     description:
213 213
       path: "."
214
-      ref: "2a7004e5de7a50f4a4178d3bb8599bdcfb4c6da4"
215
-      resolved-ref: "2a7004e5de7a50f4a4178d3bb8599bdcfb4c6da4"
216
-      url: "https://github.com/CaiJingLong/flutter_photo_manager"
214
+      ref: da04bdf1b629cf14322e795613d7e77fb933034c
215
+      resolved-ref: da04bdf1b629cf14322e795613d7e77fb933034c
216
+      url: "https://github.com/CaiJingLong/flutter_photo_manager.git"
217 217
     source: git
218 218
     version: "0.0.1"
219 219
   plugin:

+ 4
- 2
pubspec.yaml 파일 보기

@@ -12,8 +12,10 @@ dependencies:
12 12
     sdk: flutter
13 13
   photo_manager:
14 14
     git:
15
-      url: https://github.com/CaiJingLong/flutter_photo_manager
16
-      ref: 2a7004e5de7a50f4a4178d3bb8599bdcfb4c6da4
15
+      url: https://github.com/CaiJingLong/flutter_photo_manager.git
16
+      ref: da04bdf1b629cf14322e795613d7e77fb933034c
17
+#  photo_manager:
18
+#    path: /Users/caijinglong/code/flutter/plugin/flutter_photo_manager/
17 19
 
18 20
 dev_dependencies:
19 21
   flutter_test: