feat(lib, android, ios): permissions clean up, add id to files pack
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
# Nearby Service
|
# Nearby Service
|
||||||
|
|
||||||
|
Nearby Service Flutter Plugin for creating connections in a P2P network. With this plugin you can easily create any
|
||||||
|
application for sharing information **without the Internet connection**.
|
||||||
|
|
||||||
<h3>Connecting phones in a P2P network</h3>
|
### Connecting phones in a P2P network
|
||||||
|
|
||||||
[](https://xenikii.one)
|
[](https://xenikii.one)
|
||||||
[](https://github.com/ksenia312/nearby_service/blob/main/LICENSE)
|
[](https://github.com/ksenia312/nearby_service/blob/main/LICENSE)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.xenikii.nearby_service">
|
package="com.xenikii.nearby_service">
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<!-- required to use Wi-fi Direct on Android 13+ -->
|
||||||
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" />
|
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" />
|
||||||
|
<!-- required to use Wi-fi Direct -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<!-- to check if Wi-fi is enabled -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
|
<!-- to work with Wi-fi Direct API -->
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.wifi.direct"
|
android:name="android.hardware.wifi.direct"
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
<!-- to write files to storage after receiving them -->
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"
|
|
||||||
android:usesPermissionFlags="neverForLocation" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
|
||||||
<application
|
<application
|
||||||
android:label="nearby_service_example"
|
android:label="nearby_service_example"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
|
|||||||
@@ -1,38 +1,28 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
<!-- to write files to storage after receiving them -->
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"
|
|
||||||
android:usesPermissionFlags="neverForLocation" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
|
||||||
<application
|
<application
|
||||||
android:label="nearby_service_example_full"
|
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="nearby_service_example_full">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
android:hardwareAccelerated="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
||||||
android:hardwareAccelerated="true"
|
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize">
|
||||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||||
the Android process has started. This theme is visible to the user
|
the Android process has started. This theme is visible to the user
|
||||||
while the Flutter UI initializes. After that, this theme continues
|
while the Flutter UI initializes. After that, this theme continues
|
||||||
to determine the Window background behind the Flutter UI. -->
|
to determine the Window background behind the Flutter UI. -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="io.flutter.embedding.android.NormalTheme"
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:resource="@style/NormalTheme"
|
android:resource="@style/NormalTheme" />
|
||||||
/>
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
|
|||||||
@@ -22,12 +22,16 @@
|
|||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
|
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>LSSupportsOpeningDocumentsInPlace</key>
|
<key>LSSupportsOpeningDocumentsInPlace</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UIFileSharingEnabled</key>
|
<key>UIFileSharingEnabled</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
<string>Permission to use the photo library is required to send the photos</string>
|
||||||
|
|
||||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ class AppService extends ChangeNotifier {
|
|||||||
StreamSubscription? _connectedDeviceSubscription;
|
StreamSubscription? _connectedDeviceSubscription;
|
||||||
StreamSubscription? _connectionInfoSubscription;
|
StreamSubscription? _connectionInfoSubscription;
|
||||||
|
|
||||||
|
final filesLoadings = <String, int>{};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
stopListeningAll();
|
stopListeningAll();
|
||||||
@@ -85,7 +87,6 @@ class AppService extends ChangeNotifier {
|
|||||||
if (result ?? false) {
|
if (result ?? false) {
|
||||||
updateState(AppState.readyToDiscover);
|
updateState(AppState.readyToDiscover);
|
||||||
startListeningConnectionInfo();
|
startListeningConnectionInfo();
|
||||||
await getCurrentDeviceInfo();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -102,6 +103,7 @@ class AppService extends ChangeNotifier {
|
|||||||
|
|
||||||
Future<void> discover() async {
|
Future<void> discover() async {
|
||||||
try {
|
try {
|
||||||
|
await getCurrentDeviceInfo();
|
||||||
final result = await _nearbyService.discover();
|
final result = await _nearbyService.discover();
|
||||||
if (result) {
|
if (result) {
|
||||||
updateState(AppState.discoveringPeers);
|
updateState(AppState.discoveringPeers);
|
||||||
@@ -287,7 +289,11 @@ extension CommunicationChannelExtension on AppService {
|
|||||||
onData: (event) async {
|
onData: (event) async {
|
||||||
final files = await FilesSaver.savePack(event);
|
final files = await FilesSaver.savePack(event);
|
||||||
onFilesSaved?.call(
|
onFilesSaved?.call(
|
||||||
ReceivedNearbyFilesPack(sender: event.sender, files: files),
|
ReceivedNearbyFilesPack(
|
||||||
|
id: event.id,
|
||||||
|
sender: event.sender,
|
||||||
|
files: files,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -349,16 +355,32 @@ extension MessagingExtension on AppService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendFilesResponse(String requestId, {required bool isAccepted}) {
|
void sendFilesResponse(
|
||||||
|
NearbyMessageFilesRequest request, {
|
||||||
|
required bool isAccepted,
|
||||||
|
}) {
|
||||||
if (connectedDevice == null) return;
|
if (connectedDevice == null) return;
|
||||||
_nearbyService.send(
|
_nearbyService.send(
|
||||||
OutgoingNearbyMessage(
|
OutgoingNearbyMessage(
|
||||||
receiver: connectedDevice!.info,
|
receiver: connectedDevice!.info,
|
||||||
content: NearbyMessageFilesResponse(
|
content: NearbyMessageFilesResponse(
|
||||||
id: requestId,
|
id: request.id,
|
||||||
isAccepted: isAccepted,
|
isAccepted: isAccepted,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (isAccepted) {
|
||||||
|
setFilesLoading(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setFilesLoading(NearbyMessageFilesRequest request) {
|
||||||
|
filesLoadings[request.id] = request.files.length;
|
||||||
|
_notify();
|
||||||
|
}
|
||||||
|
|
||||||
|
void endFilesLoading(ReceivedNearbyFilesPack pack) {
|
||||||
|
filesLoadings.remove(pack.id);
|
||||||
|
_notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Future<void> main() async {
|
|||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
final service = AppService();
|
final service = AppService();
|
||||||
await service.getPlatformInfo();
|
await service.getPlatformInfo();
|
||||||
|
|
||||||
runApp(
|
runApp(
|
||||||
App(service: service),
|
App(service: service),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,20 +12,28 @@ const kWhiteColor = Color(0xFFFFFFFF);
|
|||||||
const kGreyColor = Color(0xFF607D8B);
|
const kGreyColor = Color(0xFF607D8B);
|
||||||
const kGreenColor = Color(0xFF07B988);
|
const kGreenColor = Color(0xFF07B988);
|
||||||
|
|
||||||
class App extends StatelessWidget {
|
class App extends StatefulWidget {
|
||||||
const App({super.key, required this.service});
|
const App({super.key, required this.service});
|
||||||
|
|
||||||
final AppService service;
|
final AppService service;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<App> createState() => _AppState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AppState extends State<App> {
|
||||||
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChangeNotifierProvider.value(
|
return ChangeNotifierProvider.value(
|
||||||
value: service,
|
value: widget.service,
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: kBlueColor),
|
colorScheme: ColorScheme.fromSeed(seedColor: kBlueColor),
|
||||||
),
|
),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
|
key: scaffoldKey,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Nearby service example app'),
|
title: const Text('Nearby service example app'),
|
||||||
actions: [
|
actions: [
|
||||||
@@ -37,7 +45,7 @@ class App extends StatelessWidget {
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: const _AppBody(),
|
body: _AppBody(scaffoldKey),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -45,7 +53,9 @@ class App extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AppBody extends StatelessWidget {
|
class _AppBody extends StatelessWidget {
|
||||||
const _AppBody();
|
const _AppBody(this.scaffoldKey);
|
||||||
|
|
||||||
|
final GlobalKey<ScaffoldState> scaffoldKey;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -72,15 +82,17 @@ class _AppBody extends StatelessWidget {
|
|||||||
final builder = AppStepViewBuilder(state: e);
|
final builder = AppStepViewBuilder(state: e);
|
||||||
final isActive = e == state;
|
final isActive = e == state;
|
||||||
return Step(
|
return Step(
|
||||||
|
isActive: isActive,
|
||||||
|
title: builder.buildTitle(),
|
||||||
|
subtitle: builder.buildSubtitle(),
|
||||||
|
content: builder.buildContent(
|
||||||
|
scaffoldKey: scaffoldKey,
|
||||||
|
),
|
||||||
state: isActive
|
state: isActive
|
||||||
? StepState.indexed
|
? StepState.indexed
|
||||||
: e.step < state.step
|
: e.step < state.step
|
||||||
? StepState.complete
|
? StepState.complete
|
||||||
: StepState.disabled,
|
: StepState.disabled,
|
||||||
title: builder.buildTitle(),
|
|
||||||
subtitle: builder.buildSubtitle(),
|
|
||||||
content: builder.buildContent(),
|
|
||||||
isActive: isActive,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ class AppStepViewBuilder {
|
|||||||
|
|
||||||
final AppState state;
|
final AppState state;
|
||||||
|
|
||||||
Widget buildContent() {
|
Widget buildContent({
|
||||||
|
required GlobalKey<ScaffoldState> scaffoldKey,
|
||||||
|
}) {
|
||||||
return switch (state) {
|
return switch (state) {
|
||||||
(AppState.idle) => const IdleView(),
|
(AppState.idle) => const IdleView(),
|
||||||
(AppState.permissions) => const PermissionsView(),
|
(AppState.permissions) => const PermissionsView(),
|
||||||
@@ -19,7 +21,9 @@ class AppStepViewBuilder {
|
|||||||
(AppState.loadingConnection) => const Center(
|
(AppState.loadingConnection) => const Center(
|
||||||
child: CircularProgressIndicator.adaptive(),
|
child: CircularProgressIndicator.adaptive(),
|
||||||
),
|
),
|
||||||
(AppState.connected) => const ConnectedView(),
|
(AppState.connected) => ConnectedView(
|
||||||
|
scaffoldKey: scaffoldKey,
|
||||||
|
),
|
||||||
(AppState.communicationChannelCreated) => const CommunicationView(),
|
(AppState.communicationChannelCreated) => const CommunicationView(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:nearby_service_example_full/presentation/app.dart';
|
||||||
|
import 'package:nearby_service_example_full/utils/files_saver.dart';
|
||||||
|
|
||||||
|
class FilePreview extends StatelessWidget {
|
||||||
|
const FilePreview({super.key, required this.file});
|
||||||
|
|
||||||
|
final PlatformFile file;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: kGreenColor,
|
||||||
|
width: 2,
|
||||||
|
strokeAlign: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
child: FilesSaver.isImage(file.extension)
|
||||||
|
? Image.file(
|
||||||
|
File(file.path!),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
file.name,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 8,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: kGreenColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,21 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:nearby_service/nearby_service.dart';
|
import 'package:nearby_service/nearby_service.dart';
|
||||||
|
import 'package:nearby_service_example_full/domain/app_service.dart';
|
||||||
import 'package:nearby_service_example_full/uikit/uikit.dart';
|
import 'package:nearby_service_example_full/uikit/uikit.dart';
|
||||||
|
|
||||||
class FilesListener {
|
class FilesListener {
|
||||||
FilesListener._();
|
FilesListener._();
|
||||||
|
|
||||||
static void call(BuildContext context, ReceivedNearbyFilesPack pack) {
|
static void call(
|
||||||
|
BuildContext context, {
|
||||||
|
required AppService service,
|
||||||
|
required ReceivedNearbyFilesPack pack,
|
||||||
|
}) {
|
||||||
|
service.endFilesLoading(pack);
|
||||||
final senderSubtitle = 'From ${pack.sender.displayName} '
|
final senderSubtitle = 'From ${pack.sender.displayName} '
|
||||||
'(ID: ${pack.sender.id})';
|
'(ID: ${pack.sender.id})';
|
||||||
AppShackBar.show(
|
AppShackBar.show(
|
||||||
Scaffold.of(context).context,
|
context,
|
||||||
'${pack.files.length} files saved! \n${pack.files.map((e) => e.name).join('\n')}',
|
'${pack.files.length} files saved! \n${pack.files.map((e) => e.name).join('\n')}',
|
||||||
subtitle: senderSubtitle,
|
subtitle: senderSubtitle,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,28 +2,31 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:nearby_service/nearby_service.dart';
|
import 'package:nearby_service/nearby_service.dart';
|
||||||
import 'package:nearby_service_example_full/domain/app_service.dart';
|
import 'package:nearby_service_example_full/domain/app_service.dart';
|
||||||
import 'package:nearby_service_example_full/uikit/uikit.dart';
|
import 'package:nearby_service_example_full/uikit/uikit.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class MessagesListener {
|
class MessagesListener {
|
||||||
MessagesListener._();
|
MessagesListener._();
|
||||||
|
|
||||||
static void call(BuildContext context, ReceivedNearbyMessage message) {
|
static void call(
|
||||||
|
BuildContext context, {
|
||||||
|
required AppService service,
|
||||||
|
required ReceivedNearbyMessage message,
|
||||||
|
}) {
|
||||||
final senderSubtitle = 'From ${message.sender.displayName} '
|
final senderSubtitle = 'From ${message.sender.displayName} '
|
||||||
'(ID: ${message.sender.id})';
|
'(ID: ${message.sender.id})';
|
||||||
message.content.byType(
|
message.content.byType(
|
||||||
onTextRequest: (textRequest) {
|
onTextRequest: (textRequest) {
|
||||||
AppShackBar.show(
|
AppShackBar.show(
|
||||||
Scaffold.of(context).context,
|
context,
|
||||||
'${textRequest.value} (Message ID=${textRequest.id})',
|
'${textRequest.value} (Message ID=${textRequest.id})',
|
||||||
subtitle: senderSubtitle,
|
subtitle: senderSubtitle,
|
||||||
)?.closed.whenComplete(() {
|
)?.closed.whenComplete(() {
|
||||||
// mark as read
|
// mark as read
|
||||||
context.read<AppService>().sendTextResponse(textRequest.id);
|
service.sendTextResponse(textRequest.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onTextResponse: (textResponse) {
|
onTextResponse: (textResponse) {
|
||||||
AppShackBar.show(
|
AppShackBar.show(
|
||||||
Scaffold.of(context).context,
|
context,
|
||||||
'Your message with ID=${textResponse.id} was delivered to ${message.sender.displayName}',
|
'Your message with ID=${textResponse.id} was delivered to ${message.sender.displayName}',
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -34,15 +37,15 @@ class MessagesListener {
|
|||||||
subtitle: senderSubtitle,
|
subtitle: senderSubtitle,
|
||||||
).then(
|
).then(
|
||||||
// accept or dismiss the files request
|
// accept or dismiss the files request
|
||||||
(isAccepted) => context.read<AppService>().sendFilesResponse(
|
(isAccepted) => service.sendFilesResponse(
|
||||||
filesRequest.id,
|
filesRequest,
|
||||||
isAccepted: isAccepted ?? false,
|
isAccepted: isAccepted ?? false,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
onFilesResponse: (filesResponse) {
|
onFilesResponse: (filesResponse) {
|
||||||
AppShackBar.show(
|
AppShackBar.show(
|
||||||
Scaffold.of(context).context,
|
context,
|
||||||
filesResponse.isAccepted
|
filesResponse.isAccepted
|
||||||
? 'Request is accepted!'
|
? 'Request is accepted!'
|
||||||
: 'Request was denied :(',
|
: 'Request was denied :(',
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:nearby_service/nearby_service.dart';
|
|
||||||
import 'package:nearby_service_example_full/domain/app_service.dart';
|
import 'package:nearby_service_example_full/domain/app_service.dart';
|
||||||
import 'package:nearby_service_example_full/presentation/app.dart';
|
import 'package:nearby_service_example_full/presentation/app.dart';
|
||||||
|
import 'package:nearby_service_example_full/presentation/components/file_preview.dart';
|
||||||
import 'package:nearby_service_example_full/uikit/uikit.dart';
|
import 'package:nearby_service_example_full/uikit/uikit.dart';
|
||||||
import 'package:nearby_service_example_full/utils/files_saver.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../components/device_preview.dart';
|
import '../components/device_preview.dart';
|
||||||
@@ -24,143 +21,126 @@ class _CommunicationViewState extends State<CommunicationView> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Selector<AppService, NearbyDevice?>(
|
final service = context.watch<AppService>();
|
||||||
selector: (context, service) => service.connectedDevice,
|
final filesLoadings = service.filesLoadings;
|
||||||
builder: (context, device, _) {
|
final device = service.connectedDevice;
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
return Center(
|
return Center(
|
||||||
child: ActionButton(
|
child: ActionButton(
|
||||||
onTap: context.read<AppService>().stopListeningAll,
|
onTap: context.read<AppService>().stopListeningAll,
|
||||||
title: 'Restart',
|
title: 'Restart',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final inputBorder = OutlineInputBorder(
|
final inputBorder = OutlineInputBorder(
|
||||||
borderSide: const BorderSide(color: kGreenColor),
|
borderSide: const BorderSide(color: kGreenColor),
|
||||||
borderRadius: BorderRadius.circular(32),
|
borderRadius: BorderRadius.circular(32),
|
||||||
);
|
);
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
DevicePreview(device: device, largeView: true),
|
DevicePreview(device: device, largeView: true),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
onChanged: (value) => setState(() {
|
onChanged: (value) => setState(() {
|
||||||
message = value;
|
message = value;
|
||||||
}),
|
}),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
horizontal: 24,
|
horizontal: 24,
|
||||||
vertical: 12,
|
vertical: 12,
|
||||||
),
|
),
|
||||||
enabledBorder: inputBorder,
|
enabledBorder: inputBorder,
|
||||||
border: inputBorder,
|
border: inputBorder,
|
||||||
focusedBorder: inputBorder,
|
focusedBorder: inputBorder,
|
||||||
hintStyle: const TextStyle(color: kGreenColor),
|
hintStyle: const TextStyle(color: kGreenColor),
|
||||||
hintText: 'Enter a message',
|
hintText: 'Enter a message',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: ActionButton(
|
||||||
|
title: 'Send',
|
||||||
|
onTap: () => context.read<AppService>().sendTextRequest(
|
||||||
|
message,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: ActionButton(
|
|
||||||
title: 'Send',
|
|
||||||
onTap: () => context.read<AppService>().sendTextRequest(
|
|
||||||
message,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
const SizedBox(height: 10),
|
),
|
||||||
const Text('OR'),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Flexible(
|
const Text('OR'),
|
||||||
child: Row(
|
const SizedBox(height: 10),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Flexible(
|
||||||
children: [
|
child: Row(
|
||||||
Expanded(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
flex: 2,
|
children: [
|
||||||
child: ActionButton(
|
Expanded(
|
||||||
type: ActionType.success,
|
flex: 2,
|
||||||
title: 'Choose files',
|
child: ActionButton(
|
||||||
onTap: () async {
|
type: ActionType.success,
|
||||||
final result = await FilePicker.platform.pickFiles(
|
title: 'Choose files',
|
||||||
allowMultiple: true,
|
onTap: () async {
|
||||||
);
|
final result = await FilePicker.platform.pickFiles(
|
||||||
setState(() {
|
allowMultiple: true,
|
||||||
files = [...?result?.files];
|
);
|
||||||
});
|
setState(() {
|
||||||
},
|
files = [...?result?.files];
|
||||||
),
|
});
|
||||||
),
|
},
|
||||||
Flexible(
|
),
|
||||||
child: ActionButton(
|
|
||||||
title: 'Send',
|
|
||||||
onTap: () => context.read<AppService>().sendFilesRequest([
|
|
||||||
...files
|
|
||||||
.map((e) => e.path)
|
|
||||||
.where((element) => element != null)
|
|
||||||
.cast<String>(),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
Flexible(
|
||||||
const SizedBox(height: 10),
|
child: ActionButton(
|
||||||
const Text('Selected files:', style: TextStyle(fontSize: 18)),
|
title: 'Send',
|
||||||
Flexible(
|
onTap: () => context.read<AppService>().sendFilesRequest([
|
||||||
child: GridView.count(
|
...files
|
||||||
shrinkWrap: true,
|
.map((e) => e.path)
|
||||||
crossAxisCount: 2,
|
.where((element) => element != null)
|
||||||
mainAxisSpacing: 12,
|
.cast<String>(),
|
||||||
crossAxisSpacing: 12,
|
]),
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
),
|
||||||
children: [
|
|
||||||
...files.where((element) => element.path != null).map(
|
|
||||||
(e) {
|
|
||||||
return Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(color: kGreenColor),
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(11),
|
|
||||||
child: FilesSaver.isImage(e.extension)
|
|
||||||
? Image.file(
|
|
||||||
File(e.path!),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
)
|
|
||||||
: Container(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
e.name,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 8,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: kGreenColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
...filesLoadings.entries.map((entry) {
|
||||||
|
return Text(
|
||||||
|
'Files pack ${entry.key} with ${entry.value} files is loading.',
|
||||||
|
);
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
},
|
const SizedBox(height: 10),
|
||||||
|
const Text('Selected files:', style: TextStyle(fontSize: 18)),
|
||||||
|
Flexible(
|
||||||
|
child: GridView.count(
|
||||||
|
shrinkWrap: true,
|
||||||
|
crossAxisCount: 2,
|
||||||
|
mainAxisSpacing: 12,
|
||||||
|
crossAxisSpacing: 12,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
children: [
|
||||||
|
...files.where((element) => element.path != null).map(
|
||||||
|
(e) {
|
||||||
|
return FilePreview(file: e);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ import 'package:provider/provider.dart';
|
|||||||
import '../components/device_preview.dart';
|
import '../components/device_preview.dart';
|
||||||
|
|
||||||
class ConnectedView extends StatelessWidget {
|
class ConnectedView extends StatelessWidget {
|
||||||
const ConnectedView({super.key});
|
const ConnectedView({super.key, required this.scaffoldKey});
|
||||||
|
|
||||||
|
final GlobalKey<ScaffoldState> scaffoldKey;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -23,6 +25,8 @@ class ConnectedView extends StatelessWidget {
|
|||||||
context.select<AppService, CommunicationChannelState>(
|
context.select<AppService, CommunicationChannelState>(
|
||||||
(service) => service.communicationChannelState,
|
(service) => service.communicationChannelState,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final service = context.read<AppService>();
|
||||||
return device != null
|
return device != null
|
||||||
? Center(
|
? Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -43,7 +47,7 @@ class ConnectedView extends StatelessWidget {
|
|||||||
const Text('Connection lost'),
|
const Text('Connection lost'),
|
||||||
ActionButton(
|
ActionButton(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<AppService>().connect(device);
|
service.connect(device);
|
||||||
},
|
},
|
||||||
title: 'Reconnect',
|
title: 'Reconnect',
|
||||||
),
|
),
|
||||||
@@ -55,17 +59,24 @@ class ConnectedView extends StatelessWidget {
|
|||||||
if (!communicationChannelState.isLoading)
|
if (!communicationChannelState.isLoading)
|
||||||
ActionButton(
|
ActionButton(
|
||||||
title: 'Start communicate',
|
title: 'Start communicate',
|
||||||
onTap: () =>
|
onTap: () {
|
||||||
context.read<AppService>().startCommunicationChannel(
|
service.startCommunicationChannel(
|
||||||
listener: (event) => MessagesListener.call(
|
listener: (event) {
|
||||||
context,
|
MessagesListener.call(
|
||||||
event,
|
scaffoldKey.currentState!.context,
|
||||||
),
|
service: service,
|
||||||
onFilesSaved: (files) => FilesListener.call(
|
message: event,
|
||||||
context,
|
);
|
||||||
files,
|
},
|
||||||
),
|
onFilesSaved: (pack) {
|
||||||
),
|
FilesListener.call(
|
||||||
|
scaffoldKey.currentState!.context,
|
||||||
|
service: service,
|
||||||
|
pack: pack,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -11,24 +11,27 @@ import MultipeerConnectivity
|
|||||||
|
|
||||||
class NearbyStartCommand {
|
class NearbyStartCommand {
|
||||||
|
|
||||||
init(senderName: String, filesCount: Int) {
|
init(id: String, senderName: String, filesCount: Int) {
|
||||||
|
self.id = id
|
||||||
self.senderName = senderName
|
self.senderName = senderName
|
||||||
self.filesCount = filesCount
|
self.filesCount = filesCount
|
||||||
}
|
}
|
||||||
|
|
||||||
static func fromUserInfo(userInfo: NearbyUserInfo)-> NearbyStartCommand? {
|
static func fromUserInfo(userInfo: NearbyUserInfo)-> NearbyStartCommand? {
|
||||||
if let name = userInfo.dictionary["name"] as? String,
|
if let name = userInfo.dictionary["name"] as? String,
|
||||||
let filesCount = userInfo.dictionary["filesCount"] as? Int
|
let filesCount = userInfo.dictionary["filesCount"] as? Int,
|
||||||
|
let id = userInfo.dictionary["id"] as? String
|
||||||
{
|
{
|
||||||
return NearbyStartCommand(senderName: name, filesCount: filesCount)
|
return NearbyStartCommand(id: id, senderName: name, filesCount: filesCount)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func toDictionary() -> [String: Any] {
|
func toDictionary() -> [String: Any] {
|
||||||
return ["name": senderName, "filesCount": filesCount]
|
return ["name": senderName, "filesCount": filesCount, "id": id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let id: String
|
||||||
let senderName: String
|
let senderName: String
|
||||||
let filesCount: Int
|
let filesCount: Int
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ class NearbyManager: NSObject {
|
|||||||
let device = NearbyDevicesStore.instance.find(for: receiverId)
|
let device = NearbyDevicesStore.instance.find(for: receiverId)
|
||||||
if let requireDevice = device {
|
if let requireDevice = device {
|
||||||
let command = NearbyStartCommand(
|
let command = NearbyStartCommand(
|
||||||
|
id: id,
|
||||||
senderName: self.device.name,
|
senderName: self.device.name,
|
||||||
filesCount: paths.count
|
filesCount: paths.count
|
||||||
).toDictionary()
|
).toDictionary()
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ class NearbyFilesStore {
|
|||||||
private var senderName: String? = nil
|
private var senderName: String? = nil
|
||||||
private var maxCount: Int = 0
|
private var maxCount: Int = 0
|
||||||
private var count: Int = 0
|
private var count: Int = 0
|
||||||
|
private var id: String? = nil
|
||||||
|
|
||||||
func startReceiving(command: NearbyStartCommand) {
|
func startReceiving(command: NearbyStartCommand) {
|
||||||
self.paths.removeAll()
|
self.paths.removeAll()
|
||||||
|
self.id = command.id
|
||||||
self.senderName = command.senderName
|
self.senderName = command.senderName
|
||||||
self.maxCount = command.filesCount
|
self.maxCount = command.filesCount
|
||||||
self.count = 0
|
self.count = 0
|
||||||
@@ -33,6 +35,7 @@ class NearbyFilesStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func clear() {
|
func clear() {
|
||||||
|
self.id = nil
|
||||||
self.paths.removeAll()
|
self.paths.removeAll()
|
||||||
self.senderName = nil
|
self.senderName = nil
|
||||||
self.maxCount = 0
|
self.maxCount = 0
|
||||||
@@ -40,8 +43,9 @@ class NearbyFilesStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func toDartFormat(peerID: MCPeerID) -> String? {
|
func toDartFormat(peerID: MCPeerID) -> String? {
|
||||||
if (senderName != nil) {
|
if (senderName != nil && id != nil) {
|
||||||
let object = [
|
let object = [
|
||||||
|
"id": id!,
|
||||||
"files": paths.map { ["path": $0]},
|
"files": paths.map { ["path": $0]},
|
||||||
"sender": ["id": peerID.displayName, "displayName": senderName!]
|
"sender": ["id": peerID.displayName, "displayName": senderName!]
|
||||||
] as [String : Any]
|
] as [String : Any]
|
||||||
|
|||||||
@@ -7,12 +7,14 @@ import 'package:nearby_service/nearby_service.dart';
|
|||||||
///
|
///
|
||||||
class ReceivedNearbyFilesPack implements NearbyReceivedInterface {
|
class ReceivedNearbyFilesPack implements NearbyReceivedInterface {
|
||||||
const ReceivedNearbyFilesPack({
|
const ReceivedNearbyFilesPack({
|
||||||
|
required this.id,
|
||||||
required this.sender,
|
required this.sender,
|
||||||
required this.files,
|
required this.files,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory ReceivedNearbyFilesPack.fromJson(Map<String, dynamic>? json) {
|
factory ReceivedNearbyFilesPack.fromJson(Map<String, dynamic>? json) {
|
||||||
return ReceivedNearbyFilesPack(
|
return ReceivedNearbyFilesPack(
|
||||||
|
id: json?['id'],
|
||||||
sender: NearbyDeviceInfo.fromJson(json?['sender']),
|
sender: NearbyDeviceInfo.fromJson(json?['sender']),
|
||||||
files: [
|
files: [
|
||||||
...?(json?['files'] as List?)?.map(
|
...?(json?['files'] as List?)?.map(
|
||||||
@@ -30,8 +32,14 @@ class ReceivedNearbyFilesPack implements NearbyReceivedInterface {
|
|||||||
///
|
///
|
||||||
final List<NearbyFileInfo> files;
|
final List<NearbyFileInfo> files;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// ID of the files pack
|
||||||
|
///
|
||||||
|
final String id;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return {
|
return {
|
||||||
|
'id': id,
|
||||||
'sender': sender.toJson(),
|
'sender': sender.toJson(),
|
||||||
'files': [
|
'files': [
|
||||||
...files.map((e) => e.toJson()),
|
...files.map((e) => e.toJson()),
|
||||||
@@ -45,13 +53,14 @@ class ReceivedNearbyFilesPack implements NearbyReceivedInterface {
|
|||||||
other is ReceivedNearbyFilesPack &&
|
other is ReceivedNearbyFilesPack &&
|
||||||
runtimeType == other.runtimeType &&
|
runtimeType == other.runtimeType &&
|
||||||
sender == other.sender &&
|
sender == other.sender &&
|
||||||
files == other.files;
|
files == other.files &&
|
||||||
|
id == other.id;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => sender.hashCode ^ files.hashCode;
|
int get hashCode => sender.hashCode ^ files.hashCode ^ id.hashCode;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'NearbyFilesPack{sender: $sender, files: $files}';
|
return 'ReceivedNearbyFilesPack{sender: $sender, files: $files, id: $id}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,6 +177,6 @@ final class NearbyMessageFilesResponse extends NearbyMessageContent {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'NearbyMessageFileResponse{response: $isAccepted, id: $id}';
|
return 'NearbyMessageFileResponse{isAccepted: $isAccepted, id: $id}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,13 +63,16 @@ class FilesSocket {
|
|||||||
} else if (event == separateCommandOf(_currentFileIndex)) {
|
} else if (event == separateCommandOf(_currentFileIndex)) {
|
||||||
_futures.add(_createFile(_currentFileIndex));
|
_futures.add(_createFile(_currentFileIndex));
|
||||||
_currentFileIndex = _currentFileIndex + 1;
|
_currentFileIndex = _currentFileIndex + 1;
|
||||||
|
_chunksCount = 0;
|
||||||
_bytesTable['$_currentFileIndex'] = [];
|
_bytesTable['$_currentFileIndex'] = [];
|
||||||
|
Logger.info('Completed receiving file №${_currentFileIndex - 1}');
|
||||||
} else if (event == finishCommand) {
|
} else if (event == finishCommand) {
|
||||||
await Future.wait(_futures);
|
await Future.wait(_futures);
|
||||||
Logger.info('Files pack ${filesRequest.id} was created');
|
Logger.info('Files pack ${filesRequest.id} was created');
|
||||||
|
|
||||||
listener?.onData.call(
|
listener?.onData.call(
|
||||||
ReceivedNearbyFilesPack(
|
ReceivedNearbyFilesPack(
|
||||||
|
id: filesRequest.id,
|
||||||
sender: sender,
|
sender: sender,
|
||||||
files: _files,
|
files: _files,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user