tp_appwrite_auth_kit version: 10.0.10

Published 2024-03-27

n/a

sdk | dart flutter
repository | svn
platform | n/a
status | deprecated
  • Readme
  • Changelog
  • Versions

FlAppwrite Account Kit

A Flutter wrapper for Appwrite's Accounts service, makes it easy to use manage authentication and account features.

Getting Started

This is really very easy to use

  1. Add dependency
dependencies:
    appwrite_auth_kit: <version>
  1. Wrap your MaterialApp FlAppwriteAccountKit passing a properly initialized Appwrite Client. Example below:
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late Client client;
  @override
  void initState() {
    super.initState();
    //initialize your client
    client = Client();
    client
        .setEndpoint('https://localhost/v1')
        .setProject('60793ca4ce59e')
        .setSelfSigned();
  }

  @override
  Widget build(BuildContext context) {
    return FlAppwriteAccountKit(
      client: client,
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MainScreen(),
      ),
    );
  }
}
  1. Access authNotifier from context. authNotifier is an instance of AuthNotifier that provides all the functions of Appwrite's Account service and some easy way to handle authentication.
  2. Get context.authNotifier.status gets the authentication status which can be one of the AuthStatus.uninitialized, AuthStatus.unauthenticated, AuthStatus.authenticating and AuthStatus.authenticated. You can check the status and display the appropriate UI, for example
class MainScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final authNotifier = context.authNotifier;

    Widget widget;
    switch (authNotifier.status) {
      case AuthStatus.authenticated:
        widget = AdminPage();
        break;
      case AuthStatus.unauthenticated:
      case AuthStatus.authenticating:
        widget = LoginPage();
        break;
      case AuthStatus.uninitialized:
      default:
        widget = LoadingPage();
        break;
    }
    return widget;
  }
}
  1. You must use the functions from the context.authNotifier instead default Account service from Appwrite SDK to create user, create session (login), delete session (logout), so that the context.authNotifier?.status is properly updated and your UI updates accordingly.

Changelog

10.0.10 - 2024-03-27

Changed

  • Version bump from 10.0.9 to 10.0.10 (Deprecated this package).

10.0.9 - 2023-02-09

Changed

  • Version bump from 10.0.8 to 10.0.9 (Version confusion after compiler bug chaos).

10.0.8 - 2023-01-31

Changed

  • Version bump from 10.0.7 to 10.0.8.

10.0.7 - 2023-01-31

Changed

  • Version bump from 10.0.6 to 10.0.7.

10.0.6 - 2022-12-22

Changed

  • Version bump from 10.0.5 to 10.0.6.

10.0.5 - 2022-12-22

Changed

  • Version bump from 10.0.4 to 10.0.5 (Recompile due to installer optimizations).

10.0.4 - 2022-10-11

Changed

  • Version bump from 10.0.3 to 10.0.4 (Recompile due to wrong GetIt.instance syntax.).

10.0.3 - 2022-10-05

Changed

  • Version bump from 10.0.2 to 10.0.3 (fixed pdflib searchpath macos crash).

10.0.2 - 2022-10-01

Changed

  • Version bump from 10.0.1 to 10.0.2 (pkg_pdflib bundle macos dylib).

10.0.1 - 2022-09-29

Changed

  • Version bump from 10.0.0 to 10.0.1 (dependencies upgraded).

10.0.0 - 2022-08-15

Changed

  • @ruud copied from 0.3.0. Made local so tp_appwrite can use this specific verion.

[0.1.0] - 23 April, 2022

  • First release

[0.2.0]

[0.2.1]

  • Fix export issues

[0.3.0]

10.0.10

2024-03-27 download

10.0.9

2023-02-09 download

10.0.8

2023-01-31 download

10.0.6

2022-12-22 download

10.0.5

2022-12-22 download

10.0.4

2022-10-11 download

10.0.3

2022-10-05 download

10.0.2

2022-10-01 download

10.0.1

2022-09-29 download

10.0.0

2022-08-15 download

0.3.0

-- download