bluetooth_low_energy_darwin 6.0.0 copy "bluetooth_low_energy_darwin: ^6.0.0" to clipboard
bluetooth_low_energy_darwin: ^6.0.0 copied to clipboard

PlatformiOSmacOS

iOS and macOS implementation of the bluetooth_low_energy plugin.

example/lib/main.dart

import 'dart:async';
import 'dart:developer';

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

import 'router_config.dart';

void main() {
  runZonedGuarded(onStartUp, onCrashed);
}

void onStartUp() async {
  Logger.root.onRecord.listen(onLogRecord);
  hierarchicalLoggingEnabled = true;
  runApp(const MyApp());
}

void onCrashed(Object error, StackTrace stackTrace) {
  Logger.root.shout('App crached.', error, stackTrace);
}

void onLogRecord(LogRecord record) {
  log(
    record.message,
    time: record.time,
    sequenceNumber: record.sequenceNumber,
    level: record.level.value,
    name: record.loggerName,
    zone: record.zone,
    error: record.error,
    stackTrace: record.stackTrace,
  );
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: routerConfig,
      theme: ThemeData.light().copyWith(
        materialTapTargetSize: MaterialTapTargetSize.padded,
      ),
      darkTheme: ThemeData.dark().copyWith(
        materialTapTargetSize: MaterialTapTargetSize.padded,
      ),
    );
  }
}
0
likes
140
points
4.22k
downloads

Publisher

verified publisherhebei.dev

Weekly Downloads

iOS and macOS implementation of the bluetooth_low_energy plugin.

Repository (GitHub)
View/report issues

Topics

#bluetooth #bluetooth-low-energy #ble

Documentation

API reference

Funding

Consider supporting this project:

paypal.me
afdian.net

License

MIT (license)

Dependencies

bluetooth_low_energy_platform_interface, flutter

More

Packages that depend on bluetooth_low_energy_darwin