bla_chat_sdk 0.0.19

  • Readme
  • Changelog
  • Example
  • Installing
  • 61

bla_chat_sdk #

A new Flutter plugin.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

0.0.1 #

  • TODO: Describe initial release.

0.0.2 #

TODO: Bridge android

0.0.3 #

TODO: Change kotlin version

0.0.4 #

TODO: Fix bug

0.0.5 #

TODO: Fix bug

0.0.6 #

TODO: Fix bug

0.0.7 #

TODO: Fix bug

0.0.8 #

TODO: Fix bug

0.0.9 #

TODO: Fix bug

0.0.10 #

TODO: Fix bug

0.0.11 #

TODO: Fix bug

0.0.12 #

TODO: Fix bug

0.0.13 #

TODO: Fix bug

0.0.14 #

TODO: Fix bug

0.0.15 #

TODO: Fix bug

0.0.16 #

TODO: Fix bug

0.0.17 #

TODO: Fix bug

0.0.18 #

TODO: Fix bug

0.0.19 #

TODO: Fix bug

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import './screens/ChannelScreen.dart';
import 'package:flutter/services.dart';
import 'package:bla_chat_sdk/bla_chat_sdk.dart';

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

class TestClass extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      title: "Demo",
      home: MyApp(),
    );
  }
}

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

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

  void loginUser1(BuildContext context) async {
    String userId = "817540b0-b471-429d-a6bb-ad5fa755b837";
    String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaGFubmVsIjoiJGNoYXQ6ODE3NTQwYjAtYjQ3MS00MjlkLWE2YmItYWQ1ZmE3NTViODM3IiwiY2xpZW50IjoiODE3NTQwYjAtYjQ3MS00MjlkLWE2YmItYWQ1ZmE3NTViODM3IiwiZXhwIjoxNTk0OTczOTUyLCJzdWIiOiI4MTc1NDBiMC1iNDcxLTQyOWQtYTZiYi1hZDVmYTc1NWI4MzciLCJ1c2VySWQiOiI4MTc1NDBiMC1iNDcxLTQyOWQtYTZiYi1hZDVmYTc1NWI4MzcifQ.vp_j5VPaRwnBEa37k3LJYpc8ZgRBrCyYV3LV0ZoY4rU";
    var test = await BlaChatSdk.instance.initBlaChatSDK(userId, token);
    Navigator.of(context).push(MaterialPageRoute(
        builder: (context) => ChannelScreen(userId)));
  }

  void loginUser2(BuildContext context) async {
    String userId = "fb36cadb-5f6c-4dec-9e8e-4b1dd7940e11";
    String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaGFubmVsIjoiJGNoYXQ6ZmIzNmNhZGItNWY2Yy00ZGVjLTllOGUtNGIxZGQ3OTQwZTExIiwiY2xpZW50IjoiZmIzNmNhZGItNWY2Yy00ZGVjLTllOGUtNGIxZGQ3OTQwZTExIiwiZXhwIjoxNTk0OTc0MDcwLCJzdWIiOiJmYjM2Y2FkYi01ZjZjLTRkZWMtOWU4ZS00YjFkZDc5NDBlMTEiLCJ1c2VySWQiOiJmYjM2Y2FkYi01ZjZjLTRkZWMtOWU4ZS00YjFkZDc5NDBlMTEifQ.Fr7hKpbRr5lFzF6FdApI5V-Eht-JO1omx7Gxx9_Tn8Q";
    await BlaChatSdk.instance.initBlaChatSDK(userId, token);
    Navigator.of(context).push(MaterialPageRoute(
        builder: (context) => ChannelScreen(userId)));
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Login'),
        ),
        body: Center(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              RaisedButton(onPressed: () async {
                loginUser1(context);
              }, child: Text("User 1", style: TextStyle(fontWeight: FontWeight.bold),)),
              RaisedButton(onPressed: () {
                loginUser2(context);
              }, child: Text("User 2",  style: TextStyle(fontWeight: FontWeight.bold),)),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  bla_chat_sdk: ^0.0.19

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bla_chat_sdk/bla_chat_sdk.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
46
Health:
Code health derived from static analysis. [more]
80
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
61
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:bla_chat_sdk/bla_chat_sdk.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:bla_chat_sdk/bla_chat_sdk.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:bla_chat_sdk/bla_chat_sdk.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:bla_chat_sdk/bla_chat_sdk.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • bla_chat_sdk that is a package requiring null.

Health issues and suggestions

Document public APIs. (-0.63 points)

238 out of 241 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/BlaConstants.dart. (-18.98 points)

Analysis of lib/BlaConstants.dart reported 42 hints, including:

line 5 col 17: Name non-constant identifiers using lowerCamelCase.

line 6 col 17: Name non-constant identifiers using lowerCamelCase.

line 7 col 17: Name non-constant identifiers using lowerCamelCase.

line 8 col 17: Name non-constant identifiers using lowerCamelCase.

line 9 col 17: Name non-constant identifiers using lowerCamelCase.

Fix lib/BlaChannel.dart. (-0.50 points)

Analysis of lib/BlaChannel.dart reported 1 hint:

line 3 col 8: Unused import: 'dart:convert'.

Fix lib/bla_chat_sdk.dart. (-0.50 points)

Analysis of lib/bla_chat_sdk.dart reported 1 hint:

line 73 col 15: The value of the local variable 'data' isn't used.

Fix additional 6 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/BlaChannelType.dart (Run flutter format to format lib/BlaChannelType.dart.)
  • lib/BlaMessage.dart (Run flutter format to format lib/BlaMessage.dart.)
  • lib/BlaMessageType.dart (Run flutter format to format lib/BlaMessageType.dart.)
  • lib/BlaUser.dart (Run flutter format to format lib/BlaUser.dart.)
  • lib/BlaUtils.dart (Run flutter format to format lib/BlaUtils.dart.)
  • lib/EventType.dart (Run flutter format to format lib/EventType.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test