flutter_zendesk 1.0.3 copy "flutter_zendesk: ^1.0.3" to clipboard
flutter_zendesk: ^1.0.3 copied to clipboard

A Zendesk Flutter plugin.

example/lib/main.dart

import 'package:flutter/material.dart';

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "Zendesk Support",
      home: Home(),
    );
  }
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  initPlugin() async {
    Map<String, String> param = {
      "appId": "YOUR_APP_ID",
      "clientId": "CLIENT_ID",
      "url": "YOUR_URL",
    };
    try {
      String result =
          await FlutterZendesk.initiateZendesk(params: Map.from(param));
      if (result != null) {
        print("Platform Result $result");
      }
    } on PlatformException {
      print('Failed to initiate zendesk.');
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Zendesk App'),
      ),
      body: Center(
        child: Text('ZENDESK'),
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.headset_mic),
        onPressed: initPlugin,
      ),
    );
  }
}
0
likes
30
pub points
33%
popularity

Publisher

unverified uploader

A Zendesk Flutter plugin.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_zendesk