at_client_mobile 3.2.19 copy "at_client_mobile: ^3.2.19" to clipboard
at_client_mobile: ^3.2.19 copied to clipboard

A Flutter extension to the at_client library which adds support for mobile, desktop and IoT devices.

example/lib/main.dart

import 'dart:async';
import 'package:at_client_mobile_example/src/screens/home.dart';
import 'package:at_client_mobile_example/src/screens/login.dart';
import 'package:flutter/material.dart';
import 'package:at_client_mobile/at_client_mobile.dart';
import 'package:path_provider/path_provider.dart'
    show getApplicationSupportDirectory;
import 'package:at_app_flutter/at_app_flutter.dart' show AtEnv;

Future<void> main() async {
  await AtEnv.load();
  runApp(const MyApp());
}

Future<AtClientPreference> loadAtClientPreference() async {
  var dir = await getApplicationSupportDirectory();
  return AtClientPreference()
    ..rootDomain = AtEnv.rootDomain
    ..namespace = AtEnv.appNamespace
    ..hiveStoragePath = dir.path
    ..commitLogPath = dir.path
    ..isLocalStoreRequired = true;
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // * load the AtClientPreference in the background
  Future<AtClientPreference> futurePreference = loadAtClientPreference();
  AtClientPreference? atClientPreference;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // * The onboarding screen (first screen)
      initialRoute: LoginScreen.id,
      routes: <String, Widget Function(BuildContext)>{
        LoginScreen.id: (BuildContext context) => const LoginScreen(),
        HomeScreen.id: (BuildContext context) => const HomeScreen(),
      },
    );
  }
}
222
likes
160
points
4.54k
downloads

Publisher

verified publisheratsign.org

Weekly Downloads

A Flutter extension to the at_client library which adds support for mobile, desktop and IoT devices.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

at_auth, at_chops, at_client, at_commons, at_file_saver, at_lookup, at_persistence_secondary_server, at_utils, biometric_storage, crypton, encrypt, flutter, flutter_keychain, hive, package_info_plus, path

More

Packages that depend on at_client_mobile