platform_metadata 0.0.1 copy "platform_metadata: ^0.0.1" to clipboard
platform_metadata: ^0.0.1 copied to clipboard

A flutter plugin which will help you to get metadata values defined in AndroidManifest.xml (Android) or info.plist (iOS).

Pub

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 #

  1. Depend on it Add this to your package's pubspec.yaml file:
dependencies:
  platform_metadata: <VERSION>
  1. Install it You can install packages from the command line: with Flutter:
$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

  1. Import it Now in your Dart code, you can use:
import 'package:platform_metadata/platform_metadata.dart';

Usage #

place inside your android manifest file


<meta-data android:name="meta_key" android:value=" meta_value from android " />

place inside your iOS info.plist

<key>meta_key</key>
<string> meta_value from ios </string>

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;
  });
}

for example refer to example/lib/main.dart #

screenshots #

9
likes
140
pub points
71%
popularity

Publisher

unverified uploader

A flutter plugin which will help you to get metadata values defined in AndroidManifest.xml (Android) or info.plist (iOS).

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on platform_metadata