8000 Home and FAQ Scrollable sheet doesn't work on web · Issue #304 · now-u/now-u-app · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Home and FAQ Scrollable sheet doesn't work on web #304
Open
@JElgar

Description

@JElgar

There is an issue in flutter where the dragable scrollable sheet doesn't work on web. In an ideal world if someone scrolled within the sheet it would expand the draggable sheet as well.

Ive tested out the proposed custom scroll behavior (see below) but that only fixes dragging (dragging on the sheet exapnds) whilst scrolling in the list view still does not expand the sheet.

flutter/flutter#101903 (comment)

Fixes dragging but doesn't have desired scroll behavior

import 'package:auto_route/auto_route.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

class MyCustomScrollBehavior extends MaterialScrollBehavior {
  // Override behavior methods and getters like dragDevices
  @override
  Set<PointerDeviceKind> get dragDevices => { 
    PointerDeviceKind.touch,
    PointerDeviceKind.mouse,
    // etc.
  };
}

@RoutePage()
class TestingView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          Container(height: MediaQuery.sizeOf(context).height, color: Colors.red),
          ScrollConfiguration(
            behavior: MyCustomScrollBehavior(),
            child: DraggableScrollableSheet(
              maxChildSize: 0.8,
              initialChildSize: 0.4,
              minChildSize: 0.2,
              builder: (context, scrollController) {
                return SingleChildScrollView(
                  controller: scrollController,
                  child: Container(
                    height: 10000,
                    color: Colors.green,
                    child: Column(
                      children: [
                        Padding(
                          padding: const EdgeInsets.all(8.0),
                          child: Container(
                            color: Colors.blue,
                            height: 200,
                          ),
                        ),
                        Padding(
                          padding: const EdgeInsets.all(8.0),
                          child: Container(
                            color: Colors.blue,
                            height: 200,
                          ),
                        ),
                        Padding(
                          padding: const EdgeInsets.all(8.0),
                          child: Container(
                            color: Colors.blue,
                            height: 200,
                          ),
                        ),
                      ],
                    ),
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0