✨ Explore screen has a drop to share
This commit is contained in:
@@ -1471,5 +1471,6 @@
|
|||||||
"allFilesUploadedSuccess": "All files uploaded successfully",
|
"allFilesUploadedSuccess": "All files uploaded successfully",
|
||||||
"lotteryLastNumberSpecial": "The last selected number will be your special number.",
|
"lotteryLastNumberSpecial": "The last selected number will be your special number.",
|
||||||
"lotteryMultiplierRequired": "Please enter a multiplier",
|
"lotteryMultiplierRequired": "Please enter a multiplier",
|
||||||
"lotteryMultiplierRange": "Multiplier must be between 1 and 10"
|
"lotteryMultiplierRange": "Multiplier must be between 1 and 10",
|
||||||
|
"dropToShare": "Drop to share"
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:desktop_drop/desktop_drop.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -30,6 +31,7 @@ import 'package:island/widgets/publisher/publisher_card.dart';
|
|||||||
import 'package:island/widgets/web_article_card.dart';
|
import 'package:island/widgets/web_article_card.dart';
|
||||||
import 'package:island/widgets/extended_refresh_indicator.dart';
|
import 'package:island/widgets/extended_refresh_indicator.dart';
|
||||||
import 'package:island/services/event_bus.dart';
|
import 'package:island/services/event_bus.dart';
|
||||||
|
import 'package:island/widgets/share/share_sheet.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'package:super_sliver_list/super_sliver_list.dart';
|
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||||
|
|
||||||
@@ -240,23 +242,74 @@ class ExploreScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
final appBar = isWide ? null : _buildAppBar(tabController, context);
|
final appBar = isWide ? null : _buildAppBar(tabController, context);
|
||||||
|
|
||||||
return AppScaffold(
|
final dragging = useState(false);
|
||||||
isNoBackground: false,
|
|
||||||
appBar: appBar,
|
return DropTarget(
|
||||||
body:
|
onDragDone: (detail) {
|
||||||
isWide
|
dragging.value = false;
|
||||||
? _buildWideBody(
|
if (detail.files.isNotEmpty) {
|
||||||
context,
|
showModalBottomSheet(
|
||||||
ref,
|
context: context,
|
||||||
filterBar,
|
isScrollControlled: true,
|
||||||
user,
|
useRootNavigator: true,
|
||||||
notificationCount,
|
builder: (context) => ShareSheet.files(files: detail.files),
|
||||||
query,
|
);
|
||||||
events,
|
}
|
||||||
selectedDay,
|
},
|
||||||
currentFilter.value,
|
onDragEntered: (_) => dragging.value = true,
|
||||||
)
|
onDragExited: (_) => dragging.value = false,
|
||||||
: _buildNarrowBody(context, ref, currentFilter.value),
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
AppScaffold(
|
||||||
|
isNoBackground: false,
|
||||||
|
appBar: appBar,
|
||||||
|
body:
|
||||||
|
isWide
|
||||||
|
? _buildWideBody(
|
||||||
|
context,
|
||||||
|
ref,
|
||||||
|
filterBar,
|
||||||
|
user,
|
||||||
|
notificationCount,
|
||||||
|
query,
|
||||||
|
events,
|
||||||
|
selectedDay,
|
||||||
|
currentFilter.value,
|
||||||
|
)
|
||||||
|
: _buildNarrowBody(context, ref, currentFilter.value),
|
||||||
|
),
|
||||||
|
if (dragging.value)
|
||||||
|
Positioned.fill(
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(
|
||||||
|
context,
|
||||||
|
).colorScheme.primaryContainer.withOpacity(0.9),
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Symbols.upload_file,
|
||||||
|
size: 64,
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
const Gap(16),
|
||||||
|
Text(
|
||||||
|
'dropToShare'.tr(),
|
||||||
|
style: Theme.of(
|
||||||
|
context,
|
||||||
|
).textTheme.headlineMedium?.copyWith(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user