Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizable "sheet" uses minResizableExtent as max height. #410

Open
apackin opened this issue Jun 25, 2024 · 1 comment
Open

Resizable "sheet" uses minResizableExtent as max height. #410

apackin opened this issue Jun 25, 2024 · 1 comment

Comments

@apackin
Copy link
Contributor

apackin commented Jun 25, 2024

Description

The only way to get a resizeable sheet to extend larger than minResizableExtent is by passing in a larger initialExtent. Once the sheet is resized smaller than minResizableExtent, it can no longer be extended back to a larger size, even if they one is included as maxExtent or initialExtent.

Steps to Reproduce

  1. Create a resizable bottom sheet with the following properties:
    • maxExtent/initialExtent greater than minResizableExtent (e.g., maxExtent and initialExtent of 800 with minResizableExtent of 500).
    • Define maxExtent to a value greater than initialExtent (e.g., 800).
  2. Resize the sheet down to or below the minResizableExtent.
  3. Try to resize the sheet back up to the maxExtent.

Expected Behavior

The bottom sheet should allow expanding to the maxExtent after being resized down below the minResizableExtent.

Actual Behavior

The bottom sheet gets stuck at the minResizableExtent and does not expand back to the maxExtent.

Code Sample

import 'package:flutter/material.dart';  
import 'package:sheet/sheet.dart';

class PingFriendProfileViewSheet extends StatelessWidget {  
  const PingFriendProfileViewSheet({  
    required this.userId,  
    required this.initialExtent,  
    required this.minExtent,  
    required this.maxExtent,  
    super.key,  
    this.pop,  
    this.sheetController,  
  });

  final String userId;  
  final VoidCallback? pop;  
  final SheetController? sheetController;  
  final double initialExtent;  
  final double minExtent;  
  final double maxExtent;

  @override  
  Widget build(BuildContext context) {  
    return Sheet(  
      controller: sheetController,  
      minExtent: 200,  
      maxExtent: 800,  
      initialExtent: 800,  
      backgroundColor: Colors.transparent,  
      physics: const SnapSheetPhysics(  
        stops: [200, 500, 800],  
        relative: false,  
      ),  
      resizable: true,  
      minResizableExtent: 500,  
      child: const Column(  
        children: [  
          Expanded(  
            child: ColoredBox(  
              color: Colors.orange,  
              child: Text(  
                'Expanded should be able to grow back to maxExtent',  
              ),  
            ),  
          ),  
        ],  
      ),  
    );  
  }  
}

Video Demonstration

resizableSheetIssue.mov

Also not that jank while scrolling in sizes larger than minResizableExtent

Environment Information

  • Flutter version: 3.22.2
  • Package version: sheet:
    dependency: "direct main"
    description:
    name: sheet
    sha256: f7619b2bd5e031f206d8c22228ef2b12794192dea25b5af0862fa5e37fe6e36d
    url: "https://pub.dev"
    source: hosted
    version: "1.0.0"
  • Device: iPhone 15 Pro Simulator
@AlexanderThiele
Copy link

@apackin is this issue now fixed with PR #411 ? if so, please close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants