cafebazaar_auth 0.0.1 copy "cafebazaar_auth: ^0.0.1" to clipboard
cafebazaar_auth: ^0.0.1 copied to clipboard

outdated

A new Flutter plugin.

example/lib/main.dart

import 'package:cafebazaar_auth/cafebazaar_auth.dart';
import 'package:cafebazaar_auth/cafebazaar_login_button.dart';

import 'package:flutter/material.dart';

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

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

class _MyAppState extends State<MyApp> {
  signIn() async {
    var account = await CafeBazaarAuth.signIn();
    print(account.accountID);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Directionality(
            textDirection: TextDirection.rtl,
            child: Container(
              width: 180,
              child: CafeBazaarLoginButton(
                text: "ورود با بازار",
                textStyle: TextStyle(color: Colors.white),
                iconSize: 28,
                onPressed: signIn,
              ),
            ),
          ),
        ),
      ),
    );
  }
}