Ahmadre / FlutterIconPicker

An adaptive comprehensive IconPicker for Flutter
MIT License
112 stars 76 forks source link

getBasePackagePath() function not working for spaces in package path #71

Closed skdevelopment closed 1 month ago

skdevelopment commented 1 month ago

Package path retrieves spaces as a %20 and doesn't allow the copy function to work.

I had to update the function to the following:

Future getBasePackagePath() async { final packageUri = Uri.parse('package:flutter_iconpicker/flutter_iconpicker.dart'); final packagePath = (await Isolate.resolvePackageUri(packageUri)); String resultPath = path.dirname(packagePath!.path.replaceAll('lib', '')); if (Platform.isWindows) { resultPath = resultPath .replaceAll(Platform.pathSeparator, '/') .replaceFirst('/', '') .replaceAll('%20', ' '); } return resultPath; }

Ahmadre commented 1 month ago

Thanks for the hint.

I could reproduce the issue on Windows.

But just an information for you: you should NEVER create empty strings in your paths (file or directory names). No matter if you work on Flutter projects or any other projects.

I will fix this in the next release.

Ahmadre commented 1 month ago

Published new version: 3.4.6