avioli / info_plist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Flutter plugin to read the data from iOS or macOS's bundled Info.plist

Sometimes hard-conding the bundle name, identifier, the version or the build can be forgotten, so this tiny plugin is meant to help in that department.

Example usage

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await InfoPlist.getInfoPlistContents();
  if (Platform.isIOS || Platform.isMacOS) {
    print(InfoPlist.bundleIdentifier); // "com.my.fancy.app"
    print(InfoPlist.bundleName); // "My fancy app"
    print(InfoPlist.version); // "1.0.0"
    print(InfoPlist.build); // "123"
  } else {
    print(InfoPlist.bundleIdentifier); // null
    print(InfoPlist.bundleName); // null
    print(InfoPlist.version); // null
    print(InfoPlist.build); // null
  }
}

About

License:MIT License


Languages

Language:Dart 44.4%Language:Ruby 25.9%Language:Swift 17.0%Language:Kotlin 8.5%Language:Objective-C 4.1%