From 0bbac3b11c52dc04814128eb92e0a81de3d41e92 Mon Sep 17 00:00:00 2001 From: mikeill Date: Thu, 24 Jun 2021 12:24:22 -0500 Subject: [PATCH] Update to new Flutter version method/syntax fixes #131. --- .../lib/device_details/devices_details_bloc_provider.dart | 6 +++--- example/lib/devices_list/devices_bloc_provider.dart | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/example/lib/device_details/devices_details_bloc_provider.dart b/example/lib/device_details/devices_details_bloc_provider.dart index ba26fffb..fb292dd6 100644 --- a/example/lib/device_details/devices_details_bloc_provider.dart +++ b/example/lib/device_details/devices_details_bloc_provider.dart @@ -4,7 +4,6 @@ import 'package:flutter_ble_lib/flutter_ble_lib.dart'; import 'device_details_bloc.dart'; - class DeviceDetailsBlocProvider extends InheritedWidget { final DeviceDetailsBloc deviceDetailsBloc; @@ -12,14 +11,15 @@ class DeviceDetailsBlocProvider extends InheritedWidget { Key key, DeviceDetailsBloc deviceDetailsBloc, Widget child, - }) : deviceDetailsBloc = deviceDetailsBloc ?? DeviceDetailsBloc(DeviceRepository(), BleManager()), + }) : deviceDetailsBloc = deviceDetailsBloc ?? + DeviceDetailsBloc(DeviceRepository(), BleManager()), super(key: key, child: child); @override bool updateShouldNotify(InheritedWidget oldWidget) => true; static DeviceDetailsBloc of(BuildContext context) => - (context.inheritFromWidgetOfExactType(DeviceDetailsBlocProvider) + (context.dependOnInheritedWidgetOfExactType() as DeviceDetailsBlocProvider) .deviceDetailsBloc; } diff --git a/example/lib/devices_list/devices_bloc_provider.dart b/example/lib/devices_list/devices_bloc_provider.dart index c73e8216..fd0f854b 100644 --- a/example/lib/devices_list/devices_bloc_provider.dart +++ b/example/lib/devices_list/devices_bloc_provider.dart @@ -10,15 +10,14 @@ class DevicesBlocProvider extends InheritedWidget { Key key, DevicesBloc devicesBloc, Widget child, - }) : devicesBloc = devicesBloc ?? - DevicesBloc(DeviceRepository(), BleManager()), + }) : devicesBloc = + devicesBloc ?? DevicesBloc(DeviceRepository(), BleManager()), super(key: key, child: child); @override bool updateShouldNotify(InheritedWidget oldWidget) => true; static DevicesBloc of(BuildContext context) => - (context.inheritFromWidgetOfExactType(DevicesBlocProvider) - as DevicesBlocProvider) + (context.dependOnInheritedWidgetOfExactType() as DevicesBlocProvider) .devicesBloc; }