native_resource 0.3.1 copy "native_resource: ^0.3.1" to clipboard
native_resource: ^0.3.1 copied to clipboard

Retrieve resource values stored in the native side of an iOS or Android App.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:native_resource/native_resource.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              Text('app_name / CFBundleIdentifier '),
              FutureBuilder<String>(
                future: NativeResource().read(
                  androidResourceName: 'app_name',
                  iosPlistKey: 'CFBundleIdentifier',
                ),
                initialData: '',
                builder: (context, snapshot) {
                  return Text('${snapshot.data}');
                },
              ),
              SizedBox(height: 8),
              Text('sample_key / SampleKey (via Test.plist)'),
              FutureBuilder<String>(
                future: NativeResource().read(
                  androidResourceName: 'sample_key',
                  iosPlistKey: 'SampleKey',
                  iosPlistFile: 'Test',
                ),
                initialData: '',
                builder: (context, snapshot) {
                  return Text('${snapshot.data}');
                },
              )
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
120
pub points
0%
popularity

Publisher

verified publisherivity.asia

Retrieve resource values stored in the native side of an iOS or Android App.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on native_resource