incrediblezayed / file_saver

A simple flutter plugin for saving files in all platforms
https://pub.dev/packages/file_saver
BSD 3-Clause "New" or "Revised" License
75 stars 92 forks source link

type 'String' is not a subtype of type 'Uint8List' #105

Closed ninjagaru closed 4 months ago

ninjagaru commented 4 months ago

Before upgrading to Flutter 3.19.2 and Dart 3.3.0, everything ran perfectly. However, after the upgrade, I encountered the error: type 'String' is not a subtype of type 'Uint8List'.

file_saver: ^0.2.11

[✓] Flutter (Channel stable, 3.19.2, on macOS 14.2.1 23C71 darwin-x64, locale en-US) • Flutter version 3.19.2 on channel stable at /Users/hsDev/fvm/versions/3.19.2 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 7482962148 (5 days ago), 2024-02-27 16:51:22 -0500 • Engine revision 04817c99c9 • Dart version 3.3.0 • DevTools version 2.31.1

Am3ra commented 4 months ago

Running into the same issue on my end

NishadAvnish commented 4 months ago

use this parameter:

transformDioResponse: (path) { print(path);

      List<int> list = utf8.encode(path);
      Uint8List bytes = Uint8List.fromList(list);
      return bytes;
    },
Am3ra commented 4 months ago

yeah, that would fix it, sadly I was pressed for time so just downgraded the version

incrediblezayed commented 4 months ago

I'll upgrade within this week, apologies for such trivial issues

incrediblezayed commented 4 months ago

Hey, fixed this issue in the lates version, closing now

ninjagaru commented 3 months ago

Hey, fixed this issue in the lates version, closing now

THANK A LOT

Am3ra commented 3 months ago

@incrediblezayed no problem :) thanks for the quick fix!