Skip to content

Commit

Permalink
v1.0 null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
chavesgu committed Mar 4, 2021
1 parent 1b06b61 commit a870428
Show file tree
Hide file tree
Showing 13 changed files with 125 additions and 141 deletions.
29 changes: 14 additions & 15 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.0.0
merge to null-safety
fix ios PickType.all bug

## 0.0.9
update ZLPhoto for more languages

## 0.0.8
support custom album name
fix some android bug
Expand Down
14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ PODS:
- Flutter (1.0.0)
- images_picker (0.0.1):
- Flutter
- ZLPhotoBrowser (= 4.0.7)
- ZLPhotoBrowser (4.0.7):
- ZLPhotoBrowser/Core (= 4.0.7)
- ZLPhotoBrowser/Core (4.0.7)
- ZLPhotoBrowser (= 4.1.3)
- ZLPhotoBrowser (4.1.3):
- ZLPhotoBrowser/Core (= 4.1.3)
- ZLPhotoBrowser/Core (4.1.3)

DEPENDENCIES:
- Flutter (from `Flutter`)
Expand All @@ -22,9 +22,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/images_picker/ios"

SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
images_picker: 5166ad88297acad3b6bb2b64924da8ad029f2174
ZLPhotoBrowser: f85662753ea4cfebff08b3512b17467467634fb2
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
images_picker: eb05ebd660218fba40842f7d26bc75d946c682e5
ZLPhotoBrowser: 559062abac47b41ef140cff6ea2370e73623b05f

PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 14 additions & 15 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:images_picker/images_picker.dart';

void main() {
Expand All @@ -17,7 +16,7 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
String path;
String? path;

@override
void initState() {
Expand All @@ -33,49 +32,49 @@ class _MyAppState extends State<MyApp> {
),
body: Column(
children: [
RaisedButton(
ElevatedButton(
child: Text('pick'),
onPressed: () async {
List<Media> res = await ImagesPicker.pick(
List<Media>? res = await ImagesPicker.pick(
count: 3,
// pickType: PickType.video,
pickType: PickType.all,
cropOpt: CropOption(
// aspectRatio: CropAspectRatio.wh16x9
),
);
if (res != null) {
print(res.map((e) => e.path).toList());
setState(() {
path = res[0]?.thumbPath;
path = res[0].thumbPath;
});
// bool status = await ImagesPicker.saveImageToAlbum(File(res[0]?.path));
// print(status);
}
},
),
RaisedButton(
ElevatedButton(
child: Text('openCamera'),
onPressed: () async {
List<Media> res = await ImagesPicker.openCamera(
// pickType: PickType.video,
);
List<Media>? res = await ImagesPicker.openCamera(
pickType: PickType.all,
);
if (res != null) {
print(res[0]?.path);
print(res[0].path);
setState(() {
path = res[0]?.path;
path = res[0].thumbPath;
});
}
},
),
RaisedButton(
ElevatedButton(
onPressed: () async {
File file = await downloadFile('https://cdn.chavesgu.com/logo.png');
bool res = await ImagesPicker.saveImageToAlbum(file, albumName: "chaves");
print(res);
},
child: Text('saveNetworkImageToAlbum'),
),
RaisedButton(
ElevatedButton(
onPressed: () async {
File file = await downloadFile('https://cdn.chavesgu.com/SampleVideo.mp4');
bool res = await ImagesPicker.saveVideoToAlbum(file, albumName: "chaves");
Expand All @@ -87,7 +86,7 @@ class _MyAppState extends State<MyApp> {
? Container(
height: 200,
child: Image.file(
File(path),
File(path!),
fit: BoxFit.contain,
),
)
Expand Down
48 changes: 24 additions & 24 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,63 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.0-nullsafety.1"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0-nullsafety.3"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
version: "1.0.2"
dio:
dependency: "direct main"
description:
name: dio
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.10"
version: "4.0.0-beta4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -80,35 +80,35 @@ packages:
name: http_parser
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.4"
version: "4.0.0"
images_picker:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.7"
version: "1.0.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.10-nullsafety.1"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0-nullsafety.1"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -120,56 +120,56 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0-nullsafety.2"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.19-nullsafety.2"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.20.0 <2.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
7 changes: 4 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ description: Demonstrates how to use the images_picker plugin.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"

dependencies:
flutter:
sdk: flutter

dio: ^3.0.10
dio: ^4.0.0-beta4
images_picker:
# When depending on this package from a real application you should use:
# images_picker: ^x.y.z
Expand All @@ -22,7 +23,7 @@ dependencies:
path: ../
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
cupertino_icons: ^1.0.2


dev_dependencies:
Expand Down
3 changes: 1 addition & 2 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data.startsWith('Running on:'),
(Widget widget) => widget is Text && widget.data!.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
Loading

0 comments on commit a870428

Please sign in to comment.