I'd like to retrieve and use commit hash that's stored in a .git folder (inside ORIG_HEAD file). To do this I registered my asset in pubspec.yaml file:
flutter:
uses-material-design: true
assets:
- assets/strings/
- assets/images/
- .git/ORIG_HEAD
and used
await rootBundle.loadString('.git/ORIG_HEAD');
to get the value from that file.
The iOS app works fine, but the android one throws an "Unable to load asset" error
I tried to duplicate the .git folder and remove a dot from the beginning. And it seems to be working (git file has been added as an asset - flutter_assets in android apk). But this solution isn't a suitable one, because I'd like to have the relevant commit hash in place without any additional manipulations. Are there any workaround of such issue? Or it can be solved by adding pre-build scripts only?