Skip to content

Commit cc11636

Browse files
committed
fix(lint): linting
1 parent 3aadc3d commit cc11636

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

example/lib/screens/ui_call_screen.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'ui_permissions_screen.dart';
77
import 'widgets/call_actions.dart';
88
import 'widgets/call_features.dart';
99
import 'widgets/call_status.dart';
10-
import 'widgets/permissions_block.dart';
1110
import 'widgets/twilio_log.dart';
1211

1312
typedef PerformCall = Future<void> Function(String clientIdentifier);
@@ -100,9 +99,9 @@ class _UICallScreenState extends State<UICallScreen> {
10099
),
101100
),
102101
ListTile(
103-
title: Text("Permissions"),
104-
subtitle: Text("Please allow all permissions to use the app"),
105-
trailing: Icon(Icons.arrow_forward_ios),
102+
title: const Text("Permissions"),
103+
subtitle: const Text("Please allow all permissions to use the app"),
104+
trailing: const Icon(Icons.arrow_forward_ios),
106105
onTap: () {
107106
Navigator.push(
108107
context,
@@ -129,7 +128,7 @@ class _UICallScreenState extends State<UICallScreen> {
129128
}
130129

131130
class _RingSound extends StatefulWidget {
132-
const _RingSound({super.key});
131+
const _RingSound({Key? key}) : super(key: key);
133132

134133
@override
135134
State<_RingSound> createState() => _RingSoundState();
@@ -165,6 +164,7 @@ class _RingSoundState extends State<_RingSound> {
165164
onPressed: () async {
166165
final url = _controller.text.isEmpty ? null : _controller.text;
167166
await _tv.updateSound(SoundName.Incoming, url);
167+
// ignore: use_build_context_synchronously
168168
ScaffoldMessenger.of(context).showSnackBar(
169169
SnackBar(content: Text("Updated incoming sound to ${_controller.text}")),
170170
);
@@ -175,8 +175,9 @@ class _RingSoundState extends State<_RingSound> {
175175
ElevatedButton(
176176
onPressed: () async {
177177
await _tv.updateSound(SoundName.Incoming, null);
178+
// ignore: use_build_context_synchronously
178179
ScaffoldMessenger.of(context).showSnackBar(
179-
SnackBar(content: Text("Reset incoming sound")),
180+
const SnackBar(content: Text("Reset incoming sound")),
180181
);
181182
},
182183
child: const Text("Reset"),

example/lib/screens/widgets/call_features.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:async';
22

33
import 'package:flutter/material.dart';
44
import 'package:twilio_voice/twilio_voice.dart';
5+
import 'package:twilio_voice_example/utils.dart';
56

67
import 'state_toggle.dart';
78

@@ -59,7 +60,7 @@ class _CallControlsState extends State<CallControls> {
5960
void initState() {
6061
super.initState();
6162
_subscription = _tv.callEventsListener.listen((event) {
62-
print("CallFeatures TV event: $event");
63+
printDebug("CallFeatures TV event: $event");
6364
_events.add(event);
6465
switch (event) {
6566
case CallEvent.unhold:
@@ -110,7 +111,7 @@ class _CallControlsState extends State<CallControls> {
110111
});
111112
});
112113
if((_tv.call.activeCall != null) != activeCall) {
113-
print("Call state changed: $activeCall");
114+
printDebug("Call state changed: $activeCall");
114115
}
115116
}
116117

example/lib/screens/widgets/permissions_block.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'dart:async';
21
import 'dart:io';
32

43
import 'package:firebase_core/firebase_core.dart';

lib/_internal/js/core/enums/device_sound_name.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore_for_file: constant_identifier_names
12
enum SoundName {
23
Incoming,
34
Outgoing,

lib/_internal/twilio_voice_web.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ class Call extends MethodChannelTwilioCall {
716716
Future<bool?> hangUp() async {
717717
if (_jsCall != null) {
718718
// notify SW to cancel notification
719-
final callSid = await getSid();
719+
final _ = await getSid();
720720

721721
CallStatus callStatus = getCallStatus(_jsCall!);
722722
// reject incoming call that is both outbound ringing or inbound pending
@@ -872,9 +872,9 @@ class Call extends MethodChannelTwilioCall {
872872
}
873873
}
874874

875-
print("Twilio Call Status: ${status}");
875+
printDebug("Twilio Call Status: $status");
876876
final params = getCallParams(_jsCall!);
877-
final callSid = params["CallSid"] as String;
877+
final _ = params["CallSid"] as String;
878878
switch (callStatus) {
879879
case CallStatus.open:
880880
case CallStatus.pending:

test/twilio_voice_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/services.dart';
22
import 'package:flutter_test/flutter_test.dart';
3-
import 'package:matcher/matcher.dart' as matcher;
43

54
void main() {
65
const MethodChannel channel = MethodChannel('twilio_voice');
@@ -16,6 +15,6 @@ void main() {
1615

1716
test("Mock Test", () async {
1817
final result = await channel.invokeMethod("42");
19-
expect(result, matcher.equals("42"));
18+
expect(result, equals("42"));
2019
});
2120
}

0 commit comments

Comments
 (0)