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

PlatformAndroid

Flutter plugin that wraps the native SalesForce Chat SDKs.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_salesforce/flutter_salesforce.dart';

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: [
            TextButton(
              onPressed: () async {
                var s = FlutterSalesforce(
                  credentials: Credentials(
                    buttonId: '<button id>',
                    deploymentId: '<deployment Id>',
                    liveAgentPod: '<live Agent Pod>',
                    orgId: '<org Id>',
                  ),
                );
                var req = ChatRequest(
                  email: 'mr.nabinadhikari@gmail.com',
                  firstName: 'Nabin',
                  lastName: 'Adhikari',
                );
                s.initiateChat(req);
              },
              child: const Text('Salesforce chat'),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
120
pub points
57%
popularity

Publisher

unverified uploader

Flutter plugin that wraps the native SalesForce Chat SDKs.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_salesforce