Flutterando / slidy

CLI package manager and template for Flutter
https://pub.dev/packages/slidy
Apache License 2.0
806 stars 101 forks source link

Pass exclusive parameter in create and createAsync method override #282

Closed m4rc0s closed 1 year ago

m4rc0s commented 1 year ago

Theres an error caused by Breaking change https://github.com/dart-lang/sdk/issues/49647:

File.create now takes new optional exclusive bool parameter, and when it is true the operation will fail if target file already exists.

that was introduced in version 2.19 of Dart.

This change comes from this issue:

https://github.com/dart-lang/sdk/issues/49647

I'm working on a local version of slidy that fixes this problem. If the mainteners want, I can open a PR later with the correction for us to work on and release a new version with the fix;

Basically the solution start with the create and createAsync methods of File class that must be override like this:

  Future<File> create({bool exclusive = false, bool recursive = false}) {
    return _file.create(recursive: recursive);
  }

  @override
  void createSync({bool exclusive = false, bool recursive = false}) {
    _file.createSync(recursive: recursive);
  }