bonsoir 5.1.10 copy "bonsoir: ^5.1.10" to clipboard
bonsoir: ^5.1.10 copied to clipboard

A Zeroconf library that allows you to discover network services and to broadcast your own. Based on Apple Bonjour and Android NSD.

example/lib/main.dart

import 'package:bonsoir_example/models/app_service.dart';
import 'package:bonsoir_example/pages/current_page.dart';
import 'package:bonsoir_example/widgets/add_icon.dart';
import 'package:bonsoir_example/widgets/bottom_bar.dart';
import 'package:bonsoir_example/widgets/eager_initialization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

/// This file is the entry point of the Bonsoir example project.
/// The full source code is available here :
/// https://github.com/Skyost/Bonsoir/tree/master/packages/bonsoir/example.
///
/// Feel free to check the available code snippets as well :
/// https://bonsoir.skyost.eu/docs#getting-started.

/// Plugin's main method.
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await DefaultAppService.initialize();
  runApp(const ProviderScope(child: BonsoirExampleMainWidget()));
}

/// The main widget.
class BonsoirExampleMainWidget extends StatelessWidget {
  /// Creates a new main widget instance.
  const BonsoirExampleMainWidget({
    super.key,
  });

  @override
  Widget build(BuildContext context) => EagerInitialization(
        child: MaterialApp(
          home: Scaffold(
            appBar: AppBar(
              title: const Text('Bonsoir demo'),
              actions: const [AddIcon()],
              centerTitle: false,
            ),
            body: const CurrentPageWidget(),
            bottomNavigationBar: const BottomBar(),
          ),
        ),
      );
}
113
likes
160
points
12.5k
downloads
screenshot

Publisher

verified publisherskyost.eu

Weekly Downloads

A Zeroconf library that allows you to discover network services and to broadcast your own. Based on Apple Bonjour and Android NSD.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

Funding

Consider supporting this project:

ko-fi.com
paypal.me

License

MIT (license)

Dependencies

bonsoir_android, bonsoir_darwin, bonsoir_linux, bonsoir_platform_interface, bonsoir_windows, flutter

More

Packages that depend on bonsoir