Skip to content

Commit

Permalink
dartfmt and add pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
VNAPNIC committed Sep 11, 2020
1 parent aff60ed commit 3f57184
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
15 changes: 8 additions & 7 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ class _DevicesListScreenState extends State<DevicesListScreen> {
void initState() {
super.initState();

subscription = nearbyService.stateChangedSubscription(callback: (devicesList) {
subscription =
nearbyService.stateChangedSubscription(callback: (devicesList) {
setState(() {
devices.clear();
devices.addAll(devicesList);
Expand All @@ -111,7 +112,8 @@ class _DevicesListScreenState extends State<DevicesListScreen> {
});
});

receivedDataSubscription = nearbyService.dataReceivedSubscription(callback: (data) {
receivedDataSubscription =
nearbyService.dataReceivedSubscription(callback: (data) {
Fluttertoast.showToast(
msg: "Device ID: ${data.deviceID} , message: ${data.message}");
});
Expand All @@ -122,8 +124,7 @@ class _DevicesListScreenState extends State<DevicesListScreen> {
nearbyService.startAdvertisingPeer();
nearbyService.startBrowsingForPeers();
}
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {});
}

@override
Expand Down Expand Up @@ -156,7 +157,7 @@ class _DevicesListScreenState extends State<DevicesListScreen> {
children: [
Expanded(
child: GestureDetector(
onTap: ()=> _onTabItemListener(device),
onTap: () => _onTabItemListener(device),
child: Column(
children: [
Text(device.displayName),
Expand All @@ -170,7 +171,7 @@ class _DevicesListScreenState extends State<DevicesListScreen> {
),
)),
GestureDetector(
onTap: ()=> _onButtonClicked(device),
onTap: () => _onButtonClicked(device),
child: Container(
margin: EdgeInsets.symmetric(horizontal: 8.0),
padding: EdgeInsets.all(8.0),
Expand Down Expand Up @@ -246,7 +247,7 @@ class _DevicesListScreenState extends State<DevicesListScreen> {
}

_onTabItemListener(Device device) {
if(device.state == SessionState.connected) {
if (device.state == SessionState.connected) {
showDialog(
context: context,
builder: (BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data.startsWith('Running on:'),
(Widget widget) =>
widget is Text && widget.data.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/flutter_nearby_connections.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ import 'package:flutter/services.dart';

part 'src/device.dart';
part 'src/message.dart';
part 'src/nearby_service.dart';
part 'src/nearby_service.dart';
3 changes: 1 addition & 2 deletions lib/src/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ part of flutter_nearby_connections;
/// The class [Message] data transmitted between two peers.
/// it will contain [Message.deviceID] and [Message.message]
class Message {

/// Sender's ID
final String deviceID;

Expand All @@ -15,4 +14,4 @@ class Message {
factory Message.fromJson(json) {
return Message(json["deviceID"], json["message"]);
}
}
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ environment:
dependencies:
flutter:
sdk: flutter
pedantic: ^1.9.0

dev_dependencies:
flutter_test:
Expand Down
3 changes: 1 addition & 2 deletions test/flutter_nearby_connections_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ void main() {
channel.setMockMethodCallHandler(null);
});

test('getPlatformVersion', () async {
});
test('getPlatformVersion', () async {});
}

0 comments on commit 3f57184

Please sign in to comment.