File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import 'package:pubspec_lock_parse/pubspec_lock_parse.dart';
13
13
14
14
void main() {
15
15
final lockStr = File('path/to/pubspec.lock').readAsStringSync();
16
- final lockfile = PubspecLock.parse(lockStr)
16
+ final lockfile = PubspecLock.parse(lockStr);
17
17
}
18
18
```
19
19
Original file line number Diff line number Diff line change
1
+ import 'dart:io' ;
2
+
3
+ import 'package:pubspec_lock_parse/pubspec_lock_parse.dart' ;
4
+
5
+ void main () {
6
+ // read the pubspec lock of this package (might require calling pub get to generate)
7
+ final lockStr = File ('../pubspec.lock' ).readAsStringSync ();
8
+ final lockfile = PubspecLock .parse (lockStr);
9
+
10
+ print ('Dependencies found in lockfile:' );
11
+ for (final packageName in lockfile.packages.keys) {
12
+ print (' $packageName : ${lockfile .packages [packageName ]!.version .toString ()}' );
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments