app_preferences_flutter 1.3.2 copy "app_preferences_flutter: ^1.3.2" to clipboard
app_preferences_flutter: ^1.3.2 copied to clipboard

discontinued

Plugin for open and save native preferences on Android and iOS.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:app_preferences_flutter/app_preferences_flutter.dart';

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  String a = "";
  bool b = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Preferences screen plugin'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Center(child: Text(a.toString())),
            Center(child: Text(b.toString())),
            // Center(child: Text(c.toString())),
            Padding(
              padding: EdgeInsets.all(10),
            ),
            RaisedButton(
              child: Text("Open preferences screen"),
              onPressed: () async =>
                  await AppPreferencesFlutter.openPreferences(),
            ),
            RaisedButton(
              child: Text("Get values"),
              onPressed: () async {
                a = await AppPreferencesFlutter.getValue("name_preference");
                b = await AppPreferencesFlutter.getValue("enabled_preference");
                print(a);
                print(b);
                setState(() {});
              },
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Plugin for open and save native preferences on Android and iOS.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on app_preferences_flutter