env_native 1.0.0 copy "env_native: ^1.0.0" to clipboard
env_native: ^1.0.0 copied to clipboard

A plugin to get native variables from Android resources and iOS configs

env_native #

A plugin to get native variables from Android resources and iOS configs. The plugin provides static methods for getting resources variables on Android and xcconfig variables on iOS.

How to use #

Android #

Add variables to your resource file

<resources>
    <string name="test_string">From Russia with love</string>
    <integer name="test_int">42</integer>
</resources>

iOS #

Add variables to your .xcconfig file

#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

test_string = From Russia with love
test_int = 42

Add variables to Info.plist file

<key>test_string</key>
<string>$(test_string)</string>
<key>test_int</key>
<string>$(test_int)</string>

Flutter #

To get variables from Flutter you need to call static methods

final s = await EnvNative.getString('test_string');
final i = await EnvNative.getInt('test_int');
2
likes
120
pub points
56%
popularity

Publisher

unverified uploader

A plugin to get native variables from Android resources and iOS configs

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on env_native