at_client_mobile 3.2.11 copy "at_client_mobile: ^3.2.11" to clipboard
at_client_mobile: ^3.2.11 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;
import 'package:at_client/src/preference/at_client_preference.dart';

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
0
pub points
62%
popularity

Publisher

verified publisheratsign.org

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

at_chops, at_client, at_commons, at_lookup, at_utils, biometric_storage, crypton, flutter, flutter_keychain, hive, package_info_plus, path

More

Packages that depend on at_client_mobile