Last updated:
0 purchases
platform metadata
platform_metadata #
A flutter plugin which will help you to get metadata values defined in AndroidManifest.xml (Android) or info.plist (iOS).
Created by Shivam Mishra @shivbo96
Usage #
Use this package as a library #
Depend on it Add this to your package's pubspec.yaml file:
dependencies:
platform_metadata: <VERSION>
copied to clipboard
Install it You can install packages from the command line:
with Flutter:
$ flutter packages get
copied to clipboard
Alternatively, your editor might support flutter packages get. Check the docs for your editor to
learn more.
Import it Now in your Dart code, you can use:
import 'package:platform_metadata/platform_metadata.dart';
copied to clipboard
Usage #
place inside your android manifest file
<meta-data android:name="meta_key" android:value=" meta_value from android " />
copied to clipboard
place inside your iOS info.plist
<key>meta_key</key>
<string> meta_value from ios </string>
copied to clipboard
Future<void> getMetaData() async {
String metaDataValue;
try {
metaDataValue = await PlatformMetadata.getMetaDataValue('meta_key') ?? '';
} on PlatformException {
metaDataValue = 'Failed to get metaDataValue.';
}
if (!mounted) return;
setState(() {
_metaDataValue = metaDataValue;
});
}
copied to clipboard
for example refer to example/lib/main.dart #
screenshots #
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.