Skip to content

Commit f213cf8

Browse files
author
Raghav Rawat
committed
formatted code
1 parent 2ab0319 commit f213cf8

File tree

5 files changed

+49
-44
lines changed

5 files changed

+49
-44
lines changed

example/test/widget_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ void main() {
1818
// Verify that platform version is retrieved.
1919
expect(
2020
find.byWidgetPredicate(
21-
(Widget widget) => widget is Text &&
22-
widget.data!.startsWith('Running on:'),
21+
(Widget widget) =>
22+
widget is Text && widget.data!.startsWith('Running on:'),
2323
),
2424
findsOneWidget,
2525
);

lib/verloop_flutter_sdk.dart

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'url_click_values.dart';
88
import 'verloop_flutter_sdk_platform_interface.dart';
99

1010
class VerloopWidget extends StatefulWidget {
11-
1211
final String clientId;
1312
final String? userId;
1413
final String? recipeId;
@@ -25,20 +24,21 @@ class VerloopWidget extends StatefulWidget {
2524
final Map<String, String>? userVariables;
2625
final Map<String, String>? roomVariables;
2726

28-
const VerloopWidget({Key? key,
29-
required this.clientId,
30-
this.child,
31-
this.userId,
32-
this.recipeId,
33-
this.fcmToken,
34-
this.userName,
35-
this.userEmail,
36-
this.userPhone,
37-
this.userVariables,
38-
this.roomVariables,
39-
this.onButtonClicked,
40-
this.onUrlClicked,
41-
this.overrideUrlOnClick = false})
27+
const VerloopWidget(
28+
{Key? key,
29+
required this.clientId,
30+
this.child,
31+
this.userId,
32+
this.recipeId,
33+
this.fcmToken,
34+
this.userName,
35+
this.userEmail,
36+
this.userPhone,
37+
this.userVariables,
38+
this.roomVariables,
39+
this.onButtonClicked,
40+
this.onUrlClicked,
41+
this.overrideUrlOnClick = false})
4242
: super(key: key);
4343

4444
@override
@@ -114,17 +114,16 @@ class _VerloopWidgetState extends State<VerloopWidget> {
114114
}
115115

116116
class VerloopSdk {
117-
118-
Future<void> setConfig({
119-
required String clientId,
120-
String? userId,
121-
String? recipeId,
122-
String? fcmToken,
123-
String? userName,
124-
String? userEmail,
125-
String? userPhone,
126-
Map<String, String>? userVariables,
127-
Map<String, String>? roomVariables}) async {
117+
Future<void> setConfig(
118+
{required String clientId,
119+
String? userId,
120+
String? recipeId,
121+
String? fcmToken,
122+
String? userName,
123+
String? userEmail,
124+
String? userPhone,
125+
Map<String, String>? userVariables,
126+
Map<String, String>? roomVariables}) async {
128127
return await VerloopFlutterSdkPlatform.instance.setConfig(
129128
clientId: clientId,
130129
userId: userId,
@@ -143,8 +142,8 @@ class VerloopSdk {
143142
}
144143

145144
Future<void> setUrlClickListener({bool overrideUrlOnClick = false}) async {
146-
return await VerloopFlutterSdkPlatform.instance.setUrlClickListener(
147-
overrideUrlOnClick: overrideUrlOnClick);
145+
return await VerloopFlutterSdkPlatform.instance
146+
.setUrlClickListener(overrideUrlOnClick: overrideUrlOnClick);
148147
}
149148

150149
Future<void> buildVerloop() async {

lib/verloop_flutter_sdk_method_channel.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ import 'verloop_flutter_sdk_platform_interface.dart';
1212
class MethodChannelVerloopFlutterSdk extends VerloopFlutterSdkPlatform {
1313
/// The method channel used to interact with the native platform.
1414
@visibleForTesting
15-
final verloopMethods =
16-
const MethodChannel('verloop.flutter.dev/method-call');
15+
final verloopMethods = const MethodChannel('verloop.flutter.dev/method-call');
1716

1817
@visibleForTesting
1918
final EventChannel verloopButtonClickEvents =
20-
const EventChannel('verloop.flutter.dev/events/button-click');
19+
const EventChannel('verloop.flutter.dev/events/button-click');
2120

2221
@visibleForTesting
2322
final EventChannel verloopUrlClickEvents =
24-
const EventChannel('verloop.flutter.dev/events/url-click');
23+
const EventChannel('verloop.flutter.dev/events/url-click');
2524

2625
@override
27-
Future<void> setConfig({required String clientId,
26+
Future<void> setConfig({
27+
required String clientId,
2828
String? userId,
2929
String? recipeId,
3030
String? fcmToken,
@@ -35,8 +35,7 @@ class MethodChannelVerloopFlutterSdk extends VerloopFlutterSdkPlatform {
3535
Map<String, String>? roomVariables,
3636
}) async {
3737
try {
38-
await verloopMethods
39-
.invokeMethod('setConfig', <String, dynamic>{
38+
await verloopMethods.invokeMethod('setConfig', <String, dynamic>{
4039
'USER_ID': userId,
4140
'CLIENT_ID': clientId,
4241
'RECIPE_ID': recipeId,

pubspec.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: verloop_flutter_sdk
2-
description: Verloop SDK wrapper for Android and iOS.
3-
This would help the existing clients of verloop in adding chat functionalitites to their existing flutter app.
4-
This widget doesn't have UI of its own but can be added to any other widget to open the verloop chat.
2+
description: Verloop SDK wrapper for Android and iOS.This would help the existing clients of verloop in adding chat functionalities to their flutter app.
53
version: 0.0.2
64
repository: https://github.com/verloop/flutter-sdk
75

test/verloop_flutter_sdk_test.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import 'package:verloop_flutter_sdk/url_click_values.dart';
55
import 'package:verloop_flutter_sdk/verloop_flutter_sdk_method_channel.dart';
66
import 'package:verloop_flutter_sdk/verloop_flutter_sdk_platform_interface.dart';
77

8-
class MockVerloopFlutterSdkPlatform
8+
class MockVerloopFlutterSdkPlatform
99
with MockPlatformInterfaceMixin
1010
implements VerloopFlutterSdkPlatform {
11-
1211
@override
1312
Future<void> buildVerloop() {
1413
// TODO: implement buildVerloop
@@ -36,7 +35,16 @@ class MockVerloopFlutterSdkPlatform
3635
}
3736

3837
@override
39-
Future<void> setConfig({required String clientId, String? userId, String? recipeId, String? fcmToken, String? userName, String? userEmail, String? userPhone, Map<String, String>? userVariables, Map<String, String>? roomVariables}) {
38+
Future<void> setConfig(
39+
{required String clientId,
40+
String? userId,
41+
String? recipeId,
42+
String? fcmToken,
43+
String? userName,
44+
String? userEmail,
45+
String? userPhone,
46+
Map<String, String>? userVariables,
47+
Map<String, String>? roomVariables}) {
4048
// TODO: implement setConfig
4149
throw UnimplementedError();
4250
}
@@ -55,7 +63,8 @@ class MockVerloopFlutterSdkPlatform
5563
}
5664

5765
void main() {
58-
final VerloopFlutterSdkPlatform initialPlatform = VerloopFlutterSdkPlatform.instance;
66+
final VerloopFlutterSdkPlatform initialPlatform =
67+
VerloopFlutterSdkPlatform.instance;
5968

6069
test('$MethodChannelVerloopFlutterSdk is the default instance', () {
6170
expect(initialPlatform, isInstanceOf<MethodChannelVerloopFlutterSdk>());

0 commit comments

Comments
 (0)