diff --git a/lib/ui/sharing/manage_links_widget.dart b/lib/ui/sharing/manage_links_widget.dart index fcf44a8fc..e6e09b791 100644 --- a/lib/ui/sharing/manage_links_widget.dart +++ b/lib/ui/sharing/manage_links_widget.dart @@ -47,7 +47,6 @@ class _ManageSharedLinkWidgetState extends State { ]; late Tuple3 _selectedExpiry; - int _selectedDeviceLimitIndex = 0; final CollectionActions sharingActions = CollectionActions(CollectionsService.instance); @@ -140,10 +139,10 @@ class _ManageSharedLinkWidgetState extends State { alignCaptionedTextToLeft: true, isBottomBorderRadiusRemoved: true, onTap: () async { - // await _showDeviceLimitPicker(); - routeToPage(context, - DeviceLimitPickerPage(widget.collection!)) - .then((value) { + routeToPage( + context, + DeviceLimitPickerPage(widget.collection!), + ).then((value) { setState(() {}); }); }, @@ -502,87 +501,4 @@ class _ManageSharedLinkWidgetState extends State { await showGenericErrorDialog(context: context); } } - - Future _showDeviceLimitPicker() async { - final List options = []; - for (int i = 50; i > 0; i--) { - options.add( - Text(i.toString(), style: Theme.of(context).textTheme.subtitle1), - ); - } - return showCupertinoModalPopup( - context: context, - builder: (context) { - return Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.cupertinoPickerTopColor, - border: const Border( - bottom: BorderSide( - color: Color(0xff999999), - width: 0.0, - ), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CupertinoButton( - onPressed: () { - Navigator.of(context).pop('cancel'); - }, - padding: const EdgeInsets.symmetric( - horizontal: 8.0, - vertical: 5.0, - ), - child: Text( - 'Cancel', - style: Theme.of(context).textTheme.subtitle1, - ), - ), - CupertinoButton( - onPressed: () async { - await _updateUrlSettings(context, { - 'deviceLimit': int.tryParse( - options[_selectedDeviceLimitIndex].data!, - ), - }); - setState(() {}); - Navigator.of(context).pop(''); - }, - padding: const EdgeInsets.symmetric( - horizontal: 16.0, - vertical: 2.0, - ), - child: Text( - 'Confirm', - style: Theme.of(context).textTheme.subtitle1, - ), - ) - ], - ), - ), - Container( - height: 220.0, - color: const Color(0xfff7f7f7), - child: CupertinoPicker( - backgroundColor: - Theme.of(context).backgroundColor.withOpacity(0.95), - onSelectedItemChanged: (value) { - _selectedDeviceLimitIndex = value; - }, - magnification: 1.3, - useMagnifier: true, - itemExtent: 25, - diameterRatio: 1, - children: options, - ), - ) - ], - ); - }, - ); - } }