help_scout_flutter 0.0.2 copy "help_scout_flutter: ^0.0.2" to clipboard
help_scout_flutter: ^0.0.2 copied to clipboard

A new Flutter plugin for the implementation of HelpScout Beacon.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:help_scout_flutter/help_scout_flutter.dart';
import 'package:help_scout_flutter/model.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  late final HelpScoutFlutter _helpScoutFlutterPlugin;

  void initBeacon() {
    // Initialize with beacon ID and user info
    final user = HSBeaconUser(
      email: 'john@example.com',
      name: 'John Doe',
      company: 'Example Corp',
      jobTitle: 'Developer',
      avatar: 'https://example.com/avatar.png',
    );

    _helpScoutFlutterPlugin = HelpScoutFlutter(
      beaconId: '*******beacon-id******',
      user: user,
    );
  }

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Help Scout Example App')),
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              // Initialize and open the beacon
              final initResult = await _helpScoutFlutterPlugin.initialize();
              debugPrint('Initialize result: $initResult');

              final openResult = await _helpScoutFlutterPlugin.open();
              debugPrint('Open result: $openResult');
            },
            style: ButtonStyle(
              backgroundColor: WidgetStateProperty.resolveWith(
                (states) => Colors.blue[700]!,
              ),
            ),
            child: const Text('HelpScout Button'),
          ),
        ),
      ),
    );
  }
}
3
likes
160
points
103
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter plugin for the implementation of HelpScout Beacon.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on help_scout_flutter

Packages that implement help_scout_flutter