askonu_flutter 1.0.0 copy "askonu_flutter: ^1.0.0" to clipboard
askonu_flutter: ^1.0.0 copied to clipboard

Install the complete AskOnu administrator application securely in Flutter Web, Android, iOS, and macOS dashboards.

example/lib/main.dart

import 'dart:convert';

import 'package:askonu_flutter/askonu_flutter.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;

void main() => runApp(const AskOnuExample());

class AskOnuExample extends StatelessWidget {
  const AskOnuExample({super.key});

  Future<String> _getContext() async {
    final response = await http.post(
      // Replace this host with the dashboard's authenticated backend.
      Uri.parse('https://your-dashboard.example.com/api/askonu/context'),
      headers: const <String, String>{'content-type': 'application/json'},
    );
    if (response.statusCode != 200) {
      throw StateError('AskOnu context request failed.');
    }
    final body = jsonDecode(response.body) as Map<String, dynamic>;
    return body['token'] as String;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'AskOnu Flutter example',
      theme: ThemeData(colorSchemeSeed: const Color(0xff246bfd)),
      darkTheme: ThemeData.dark(useMaterial3: true),
      themeMode: ThemeMode.system,
      home: Scaffold(
        appBar: AppBar(title: const Text('AskOnu')),
        body: AskOnuModule(
          agentToken: 'YOUR_LIVE_AGENT_TOKEN',
          getContext: _getContext,
        ),
      ),
    );
  }
}
0
likes
150
points
--
downloads

Documentation

Documentation
API reference

Publisher

verified publisheraskonu.com

Install the complete AskOnu administrator application securely in Flutter Web, Android, iOS, and macOS dashboards.

Homepage
Repository (GitHub)
View/report issues

Topics

#administration #dashboard #product-intelligence #webview

License

MIT (license)

Dependencies

flutter, webview_flutter

More

Packages that depend on askonu_flutter