Skip to content

Commit 67b5f24

Browse files
author
Md Shahed Uddin Emon
committed
fix: file picker is not neccesary anymore
1 parent f7d5b90 commit 67b5f24

File tree

5 files changed

+0
-43
lines changed

5 files changed

+0
-43
lines changed

example/lib/main.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'dart:io';
22

33
import 'package:chatwoot_sdk/chatwoot_sdk.dart';
4-
import 'package:file_picker/file_picker.dart';
54
import 'package:flutter/material.dart';
65
import 'package:flutter/services.dart';
76

@@ -60,7 +59,6 @@ class _MyHomePageState extends State<MyHomePage> {
6059
exit(0);
6160
}
6261
},
63-
onAttachFile: _pickFiles,
6462
onLoadStarted: () {
6563
print("loading widget");
6664
},
@@ -74,14 +72,5 @@ class _MyHomePageState extends State<MyHomePage> {
7472
);
7573
}
7674

77-
Future<List<String>> _pickFiles() async {
78-
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true);
7975

80-
if (result != null) {
81-
File file = File(result.files.single.path ?? '');
82-
return [file.uri.toString()];
83-
} else {
84-
return [];
85-
}
86-
}
8776
}

example/pubspec.lock

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@ packages:
4848
url: "https://pub.dev"
4949
source: hosted
5050
version: "1.18.0"
51-
cross_file:
52-
dependency: transitive
53-
description:
54-
name: cross_file
55-
sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670"
56-
url: "https://pub.dev"
57-
source: hosted
58-
version: "0.3.4+2"
5951
crypto:
6052
dependency: transitive
6153
description:
@@ -136,14 +128,6 @@ packages:
136128
url: "https://pub.dev"
137129
source: hosted
138130
version: "6.1.4"
139-
file_picker:
140-
dependency: "direct main"
141-
description:
142-
name: file_picker
143-
sha256: "16dc141db5a2ccc6520ebb6a2eb5945b1b09e95085c021d9f914f8ded7f1465c"
144-
url: "https://pub.dev"
145-
source: hosted
146-
version: "8.1.4"
147131
fixnum:
148132
dependency: transitive
149133
description:
@@ -261,14 +245,6 @@ packages:
261245
url: "https://pub.dev"
262246
source: hosted
263247
version: "2.2.1"
264-
flutter_plugin_android_lifecycle:
265-
dependency: transitive
266-
description:
267-
name: flutter_plugin_android_lifecycle
268-
sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398"
269-
url: "https://pub.dev"
270-
source: hosted
271-
version: "2.0.23"
272248
flutter_secure_storage:
273249
dependency: transitive
274250
description:

example/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ dependencies:
2929
# The following adds the Cupertino Icons font to your application.
3030
# Use with the CupertinoIcons class for iOS style icons.
3131
cupertino_icons: ^1.0.2
32-
file_picker: ^8.1.4
3332
win32: ^5.8.0
3433

3534
dev_dependencies:

lib/ui/webview_widget/chatwoot_widget.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class ChatwootWidget extends StatefulWidget {
2323
///Additional information about the customer
2424
final customAttributes;
2525

26-
///Widget Attachment event. Currently supported only on Android devices
27-
final Future<List<String>> Function()? onAttachFile;
2826

2927
///Widget Load started event
3028
final void Function()? onLoadStarted;
@@ -42,7 +40,6 @@ class ChatwootWidget extends StatefulWidget {
4240
this.locale = "en",
4341
this.customAttributes,
4442
this.closeWidget,
45-
this.onAttachFile,
4643
this.onLoadStarted,
4744
this.onLoadProgress,
4845
this.onLoadCompleted})
@@ -67,7 +64,6 @@ class _ChatwootWidgetState extends State<ChatwootWidget> {
6764
locale: widget.locale,
6865
customAttributes: widget.customAttributes,
6966
closeWidget: widget.closeWidget,
70-
onAttachFile: widget.onAttachFile,
7167
onLoadStarted: widget.onLoadStarted,
7268
onLoadCompleted: widget.onLoadCompleted,
7369
onLoadProgress: widget.onLoadProgress,

lib/ui/webview_widget/webview.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class Webview extends StatefulWidget {
1818
/// See [ChatwootWidget.closeWidget]
1919
final void Function()? closeWidget;
2020

21-
/// See [ChatwootWidget.onAttachFile]
22-
final Future<List<String>> Function()? onAttachFile;
2321

2422
/// See [ChatwootWidget.onLoadStarted]
2523
final void Function()? onLoadStarted;
@@ -38,7 +36,6 @@ class Webview extends StatefulWidget {
3836
String locale = "en",
3937
customAttributes,
4038
this.closeWidget,
41-
this.onAttachFile,
4239
this.onLoadStarted,
4340
this.onLoadProgress,
4441
this.onLoadCompleted,

0 commit comments

Comments
 (0)