Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.19.6"
}
49 changes: 44 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,59 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.idea
.buildlog/
.history
.svn/
.gradle/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
*.g.dart

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
/ios/Flutter/.last_build_id
/ios/build/


# FVM Version Cache
.fvm/

# Previously included from original FlutterBleLib
build/
ios/.generated/
packages
pubspec.lock
*.iml
example/android/res/values/strings_en.arb
res/values/strings_en.arb
lib/generated/
example/lib/generated/
example/.flutter-plugins-dependencies
.dart_tool/
example/ios/Podfile.lock
.vscode/settings.json
org.eclipse.buildship.core.prefs
.project
Expand Down
10 changes: 4 additions & 6 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
include: package:pedantic/analysis_options.yaml
include: package:flutter_lints/flutter.yaml

analyzer:
exclude: [test/**]

exclude:
- "**.mocks.dart"
linter:
rules:
prefer_single_quotes: false
omit_local_variable_types: false
unawaited_futures: false
constant_identifier_names: false
13 changes: 6 additions & 7 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
*.iml
.gradle
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
GeneratedPluginRegistrant.java
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ android {

dependencies {
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.github.Polidea:MultiPlatformBleAdapter:0.1.8'
implementation 'com.github.dotintent:MultiPlatformBleAdapter:0.1.8'
}
12 changes: 5 additions & 7 deletions example/lib/device_details/device_detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ class DeviceDetailsViewState extends State<DeviceDetailsView> {
@override
Widget build(BuildContext context) {
final deviceDetailsBloc = _deviceDetailsBloc;
return WillPopScope(
onWillPop: () {
if (deviceDetailsBloc == null) {
return Future<bool>.value(true);
return PopScope(
canPop: deviceDetailsBloc == null,
onPopInvoked: (didPop) {
if (deviceDetailsBloc != null) {
deviceDetailsBloc.disconnect();
}
return deviceDetailsBloc.disconnect().then((_) {
return false;
});
},
child: DefaultTabController(
length: 2,
Expand Down
5 changes: 1 addition & 4 deletions example/lib/device_details/device_details_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import 'package:flutter_ble_lib_example/repository/device_repository.dart';
import 'package:flutter_ble_lib_example/test_scenarios/test_scenarios.dart';
import 'package:rxdart/rxdart.dart';

import '../model/ble_device.dart';
import '../repository/device_repository.dart';

class DeviceDetailsBloc {
final BleManager _bleManager;
final DeviceRepository _deviceRepository;
Expand All @@ -25,7 +22,7 @@ class DeviceDetailsBloc {

Stream<List<DebugLog>> get logs => _logsController.stream;

Stream<Null?> get disconnectedDevice => _deviceRepository.pickedDevice
Stream<Null> get disconnectedDevice => _deviceRepository.pickedDevice
.skipWhile((bleDevice) => bleDevice != null).cast<Null>();

List<DebugLog> _logs = [];
Expand Down
8 changes: 5 additions & 3 deletions example/lib/device_details/view/button_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ class ButtonView extends StatelessWidget {
return Expanded(
child: Padding(
padding: const EdgeInsets.all(2.0),
child: RaisedButton(
color: Colors.blue,
textColor: Colors.white,
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.blue),
foregroundColor: MaterialStateProperty.all(Colors.white),
),
child: Text(_text),
onPressed: action,
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/devices_list/devices_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class DevicesList extends ListView {
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/ti_logo.png'),
),
backgroundColor: Theme.of(context).accentColor);
backgroundColor: Theme.of(context).colorScheme.secondary);
case DeviceCategory.hex:
return CircleAvatar(
child: CustomPaint(painter: HexPainter(), size: Size(20, 24)),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MyApp extends StatelessWidget {
title: 'FlutterBleLib example',
theme: new ThemeData(
primaryColor: new Color(0xFF0A3D91),
accentColor: new Color(0xFFCC0000),
colorScheme: ColorScheme.fromSwatch().copyWith(secondary: new Color(0xFFCC0000)),
),
initialRoute: "/",
routes: <String, WidgetBuilder>{
Expand Down
Loading