rayconnect_client 0.0.1-aplha copy "rayconnect_client: ^0.0.1-aplha" to clipboard
rayconnect_client: ^0.0.1-aplha copied to clipboard

outdated

Rayconnect client on dart

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:rayconnect_client/main.dart';

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

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

class _MyAppState extends State<MyApp> {
  RayconnectClient rayconnectClient = new RayconnectClient(appId: 'test');

  @override
  void initState() {
    super.initState();
    this.init();
  }

  void init() async {
    if (await this.rayconnectClient.auth.hasToken() == false) {
      await this.rayconnectClient.auth.asGuest();
    }
    String token = await this.rayconnectClient.auth.getToken();
    print(token);
    String uid = await this.rayconnectClient.auth.getUserId();
    print(uid);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(),
      ),
    );
  }
}
2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Rayconnect client on dart

Homepage

License

unknown (license)

Dependencies

flutter, flutter_secure_storage, http

More

Packages that depend on rayconnect_client