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

PlatformAndroid

AMQP Plugin for Android.

example/lib/main.dart

import 'dart:developer';

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

import 'package:amqp_service/amqp_service.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  initPlatformState();
  runApp(const MyApp());
  AMQPService();
  AMQPService.streamSubscription.onData((data) {
    log(data);
  });
}

// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
  return await AMQPService.startService(
      host: 'your_host',
      port: 5672,
      username: 'your_user_name',
      password: 'your_passs',
      exchange: 'T-direct',
      key: '5210015');
}

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

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
1
likes
140
pub points
0%
popularity

Publisher

unverified uploader

AMQP Plugin for Android.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on amqp_service