Code Monkey home page Code Monkey logo

wtf_sliding_sheet's Issues

Can't fling sheet closed using header.

This function returns the widget that handles the header and footer gestures.
https://github.com/What-the-Flutter/wtf_sliding_sheet/blob/bcce0088049570efea5b6dd483869711a76ece0a/lib/src/sheet.dart#L1179

When the user finishes a drag, if there is sufficient velocity, the sheet will snap to the next / previous snapping point.
This function is on the gesture handler handles that.
https://github.com/What-the-Flutter/wtf_sliding_sheet/blob/bcce0088049570efea5b6dd483869711a76ece0a/lib/src/sheet.dart#L1219

BUG
When SetState runs at the end of this function, the sheet snaps back open. This only happens when closing a sheet.
This is only happening when using a customBuilder
It seems that the extent value is not being updated properly, calling set state therefore rebuilds the sheet in an open state
https://github.com/What-the-Flutter/wtf_sliding_sheet/blob/bcce0088049570efea5b6dd483869711a76ece0a/lib/src/sheet.dart#L1228

untitlssssssssssed.webm

Uncaught error when scrolling over dialog with showScrollBar = true

Hello!
I've encountered an unhandled exception while scrolling through the component. The issue seems to arise whenever I try to scroll, with showScrollbar enabled.

Error: "The Scrollbar's ScrollController has no ScrollPosition attached."

Reproducible example:

Future<void> showBottomSheetDialog(
  BuildContext context,
) async {
  final controller = SheetController();

  await showSlidingBottomSheet(
    context,
    builder: (_) {
      return SlidingSheetDialog(
        controller: controller,
        duration: const Duration(milliseconds: 500),
        snapSpec: const SnapSpec(
          snap: true,
          initialSnap: 0.7,
          snappings: [0.3, 0.7],
        ),
        scrollSpec: const ScrollSpec(
          showScrollbar: true,
        ),
        builder: (_, __) => Column(
          children: [
            Container(
              height: 200,
              color: Colors.black,
            ),
            Container(
              height: 700,
              color: Colors.red,
            ),
          ],
        ),
      );
    },
  );
}
image

Could you please take a look? Thank you!

Can't fling `customBuilder` sheet closed by dragging on header header.

Bug

When using a customBuilder for the sheet, you can't fling the sheet closed by dragging on the header, It snaps back up.

Video

untitlssssssssssed.webm

Sample Code

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

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: Text('Hello World!'),
          ),
          body: SlidingSheet(
            snapSpec: const SnapSpec(
              snap: true,
              snappings: [0.2, 1.0],
              positioning: SnapPositioning.relativeToAvailableSpace,
            ),
            body: Center(
              child: Text('This widget is below the SlidingSheet'),
            ),
            headerBuilder: (context, state) {
              return Container(
                height: 100,
                color: Colors.black,
                child: Center(
                  child: Text("Header"),
                ),
              );
            },
            customBuilder: (context, controller, state) {
              return SingleChildScrollView(
                controller: controller,
                child: Column(
                  children: [
                    Container(
                      height: 100,
                      color: Colors.red,
                    ),
                    Container(
                      height: 100,
                      color: Colors.blue,
                    ),
                    Container(
                      height: 100,
                      color: Colors.yellow,
                    ),
                    Container(
                      height: 100,
                      color: Colors.red,
                    ),
                    Container(
                      height: 100,
                      color: Colors.blue,
                    ),
                    Container(
                      height: 100,
                      color: Colors.yellow,
                    ),
                  ],
                ),
              );
            },
          )),
    );
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.