at_contacts_flutter 0.0.4 copy "at_contacts_flutter: ^0.0.4" to clipboard
at_contacts_flutter: ^0.0.4 copied to clipboard

outdated

A flutter plugin project to provide ease of managing contacts for an atsign using atprotocol.

example/lib/main.dart

import 'package:at_contacts_flutter_example/client_sdk_service.dart';
import 'package:flutter/material.dart';
import 'package:atsign_authentication_helper/atsign_authentication_helper.dart';
import 'package:at_contacts_flutter_example/second_screen.dart';

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  ClientSdkService clientSdkService = ClientSdkService.getInstance();
  @override
  void initState() {
    clientSdkService.onboard();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.light(),
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Builder(
            builder: (context) => Column(
              children: [
                Container(
                    padding: EdgeInsets.all(10.0),
                    child: Center(
                      child: Text(
                          'A client service should create an atClient instance and call onboard method before navigating to QR scanner screen',
                          textAlign: TextAlign.center),
                    )),
                Center(
                    child: FlatButton(
                        color: Colors.black12,
                        onPressed: () async {
                          await Navigator.pushReplacement(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => ScanQrScreen(
                                      atClientServiceInstance: clientSdkService
                                          .atClientServiceInstance,
                                      atClientPreference: clientSdkService
                                          .atClientPreference,
                                      nextScreen: SecondScreen())));
                        },
                        child: Text('Show QR scanner screen'))),
                SizedBox(
                  height: 25,
                ),
                Center(
                    child: FlatButton(
                        color: Colors.black12,
                        onPressed: () async {
                          await Navigator.pushReplacement(
                              context,
                              MaterialPageRoute(
                                  builder: (context) => SecondScreen()));
                        },
                        child: Text('Already authenticated'))),
              ],
            ),
          )),
    );
  }
}
302
likes
40
pub points
63%
popularity

Publisher

verified publisheratsign.org

A flutter plugin project to provide ease of managing contacts for an atsign using atprotocol.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (LICENSE)

Dependencies

at_client_mobile, at_common_flutter, at_commons, at_contact, at_lookup, flutter, flutter_slidable

More

Packages that depend on at_contacts_flutter