|
@@ -42,10 +42,15 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
+ final isCollectEnabled =
|
|
|
|
+ widget.collection!.publicURLs?.firstOrNull?.enableCollect ?? false;
|
|
|
|
+ final isDownloadEnabled =
|
|
|
|
+ widget.collection!.publicURLs?.firstOrNull?.enableDownload ?? true;
|
|
|
|
+ final isPasswordEnabled =
|
|
|
|
+ widget.collection!.publicURLs?.firstOrNull?.passwordEnabled ?? false;
|
|
final enteColorScheme = getEnteColorScheme(context);
|
|
final enteColorScheme = getEnteColorScheme(context);
|
|
final PublicURL url = widget.collection!.publicURLs!.firstOrNull!;
|
|
final PublicURL url = widget.collection!.publicURLs!.firstOrNull!;
|
|
return Scaffold(
|
|
return Scaffold(
|
|
- backgroundColor: Theme.of(context).backgroundColor,
|
|
|
|
appBar: AppBar(
|
|
appBar: AppBar(
|
|
elevation: 0,
|
|
elevation: 0,
|
|
title: const Text(
|
|
title: const Text(
|
|
@@ -61,6 +66,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
children: [
|
|
MenuItemWidget(
|
|
MenuItemWidget(
|
|
|
|
+ key: ValueKey("Allow collect $isCollectEnabled"),
|
|
captionedTextWidget: const CaptionedTextWidget(
|
|
captionedTextWidget: const CaptionedTextWidget(
|
|
title: "Allow adding photos",
|
|
title: "Allow adding photos",
|
|
),
|
|
),
|
|
@@ -142,6 +148,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|
bgColor: getEnteColorScheme(context).fillFaint,
|
|
bgColor: getEnteColorScheme(context).fillFaint,
|
|
),
|
|
),
|
|
MenuItemWidget(
|
|
MenuItemWidget(
|
|
|
|
+ key: ValueKey("Allow downloads $isDownloadEnabled"),
|
|
captionedTextWidget: const CaptionedTextWidget(
|
|
captionedTextWidget: const CaptionedTextWidget(
|
|
title: "Allow downloads",
|
|
title: "Allow downloads",
|
|
),
|
|
),
|
|
@@ -150,9 +157,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|
isTopBorderRadiusRemoved: true,
|
|
isTopBorderRadiusRemoved: true,
|
|
menuItemColor: getEnteColorScheme(context).fillFaint,
|
|
menuItemColor: getEnteColorScheme(context).fillFaint,
|
|
trailingWidget: Switch.adaptive(
|
|
trailingWidget: Switch.adaptive(
|
|
- value: widget.collection!.publicURLs?.firstOrNull
|
|
|
|
- ?.enableDownload ??
|
|
|
|
- true,
|
|
|
|
|
|
+ value: isDownloadEnabled,
|
|
onChanged: (value) async {
|
|
onChanged: (value) async {
|
|
await _updateUrlSettings(
|
|
await _updateUrlSettings(
|
|
context,
|
|
context,
|
|
@@ -174,6 +179,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|
bgColor: getEnteColorScheme(context).fillFaint,
|
|
bgColor: getEnteColorScheme(context).fillFaint,
|
|
),
|
|
),
|
|
MenuItemWidget(
|
|
MenuItemWidget(
|
|
|
|
+ key: ValueKey("Password lock $isPasswordEnabled"),
|
|
captionedTextWidget: const CaptionedTextWidget(
|
|
captionedTextWidget: const CaptionedTextWidget(
|
|
title: "Password lock",
|
|
title: "Password lock",
|
|
),
|
|
),
|
|
@@ -181,9 +187,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|
isTopBorderRadiusRemoved: true,
|
|
isTopBorderRadiusRemoved: true,
|
|
menuItemColor: getEnteColorScheme(context).fillFaint,
|
|
menuItemColor: getEnteColorScheme(context).fillFaint,
|
|
trailingWidget: Switch.adaptive(
|
|
trailingWidget: Switch.adaptive(
|
|
- value: widget.collection!.publicURLs?.firstOrNull
|
|
|
|
- ?.passwordEnabled ??
|
|
|
|
- false,
|
|
|
|
|
|
+ value: isPasswordEnabled,
|
|
onChanged: (enablePassword) async {
|
|
onChanged: (enablePassword) async {
|
|
if (enablePassword) {
|
|
if (enablePassword) {
|
|
final inputResult =
|
|
final inputResult =
|