chico_flutter_sdk 0.1.0 copy "chico_flutter_sdk: ^0.1.0" to clipboard
chico_flutter_sdk: ^0.1.0 copied to clipboard

Chico conta a história dos seus clientes por meio das suas transações financeiras.

chico_flutter_sdk #

pub package

Flutter Widget to connect you company to Open Banking using Chico SDK.

Usage #

To use this SDK, add chico_flutter_sdk as a dependency in your pubspec.yaml file.

Example #

Import

import "package:chico_flutter_sdk/chico_flutter_sdk.dart";

Implement

class ChicoOnboarding extends StatefulWidget {
  const ChicoOnboarding({Key? key}) : super(key: key);

  @override
  State<ChicoOnboarding> createState() => _ChicoOnboardingState();
}

class _ChicoOnboardingState extends State<ChicoOnboarding> {
  final chicoClient = "demo";
  final cpf = "000.111.222-33";
  late Future<JWTResponse> chicoToken;

  @override
  Widget build(BuildContext context) {
    // create function to sign your JWT
    chicoToken = signCpf(cpf, chicoClient);

    return Scaffold(
        backgroundColor: Colors.white,
        body: Center(
            child: ChicoConnector(
                client: chicoClient,
                token: chicoToken,
                height: 72,
                width: 320,
                environment: ChicoEnvironmentType.development,
            );));
  }
}

class App extends StatelessWidget {
  const App({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        appBarTheme: const AppBarTheme(
          backgroundColor: Colors.white,
          foregroundColor: Colors.black,
          shadowColor: Colors.white,
        ),
      ),
      home: const SizedBox(
        height: 64,
        width: 256,
        child: ChicoOnboarding(),
      ),
    );
  }
}

Creating JWTs #

You can use any package to implement the signCpf function, it should return an JWT token containing the user's CPF as chicoToken and your customer id as client. Similar to eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaGljb1Rva2VuIjoiPENQRj4iLCJjbGllbnQiOiJkZW1vIn0.AZ8bbjN8yDLd1Fv283FxkXACSL6IbkCZilGG6726qz4

We recommend using dart_jsonwebtoken for the simplicity of it:

final jwt = JWT(
  // Payload
  {
    'cpf': "000.111.222-33",
    'client': "decom"
  },
);

// Sign it (default with HS256 algorithm)
token = jwt.sign(SecretKey('secret passphrase'));

print('Signed token: $token\n');

License #

Proprietary Software

About Chico #

Chico is a financial intelligence API for LatAm. The company leverages alternative consumer financial data so banks and fintechs can properly build, deploy and underwrite financial solutions at scale.

1
likes
80
pub points
17%
popularity

Publisher

verified publisherchico.ai

Chico conta a história dos seus clientes por meio das suas transações financeiras.

Homepage

Documentation

API reference

License

unknown (LICENSE)

Dependencies

chico_harvest_plugin, flutter, mixpanel_flutter, webview_flutter

More

Packages that depend on chico_flutter_sdk