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

A secure version of get_storage, which was a fast, extra light and synchronous key-value storage written entirely in Dart

example/lib/main.dart

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

void main() async {
  await GetSecureStorage.init(password: 'password');
  runApp(const App());
}

class App extends StatefulWidget {
  const App({Key? key}) : super(key: key);

  @override
  State<App> createState() => _AppState();
}

class _AppState extends State<App> {
  final box = GetSecureStorage();
  bool get isDark => box.read('darkmode') ?? false;
  void changeTheme(bool val) {
    box.write('darkmode', val);
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: isDark ? ThemeData.dark() : ThemeData.light(),
      home: Scaffold(
        appBar: AppBar(title: const Text("GetSecureStorage")),
        body: Center(
          child: SwitchListTile(
            value: isDark,
            title: const Text("Touch to change ThemeMode"),
            onChanged: changeTheme,
          ),
        ),
      ),
    );
  }
}
21
likes
0
pub points
89%
popularity

Publisher

verified publisherhubivue.com

A secure version of get_storage, which was a fast, extra light and synchronous key-value storage written entirely in Dart

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

cryptography, flutter, get, path_provider

More

Packages that depend on get_secure_storage