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

Modify bottom Navigation with improved drag behavior #56

Open
maheshj01 opened this issue Jan 20, 2025 · 0 comments
Open

Modify bottom Navigation with improved drag behavior #56

maheshj01 opened this issue Jan 20, 2025 · 0 comments
Labels
easy fix Should typically take less than 2 hours to implement P3 Low priority (default) for features/bugs that will be worked on in near future quality related to fine details and user experience

Comments

@maheshj01
Copy link
Owner

Screen.Recording.2025-01-03.at.22.03.50.mov
code sample
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: DraggableScrollableDemo(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Draggable Scrollable Sheet"),
      ),
      body: Stack(
        children: [
          // Background content
          const Center(child: Text("Main Content Here")),

          // DraggableScrollableSheet
          DraggableScrollableSheet(
            initialChildSize: 0.3, // Initial size of the sheet
            minChildSize: 0.2, // Minimum size of the sheet
            maxChildSize: 0.8, // Maximum size of the sheet
            builder: (context, scrollController) {
              return Column(
                children: [
                  SingleChildScrollView(
                    controller: scrollController,
                    child: Container(
                      height: 50,
                      color: Colors.red,
                      child: const Center(
                        child: Text("Draggable area"),
                      ),
                    ),
                  ),
                  Expanded(
                    child: Container(
                      color: Colors.grey.shade100,
                      child: ListView.builder(
                        shrinkWrap: true,
                        controller: scrollController,
                        itemCount: 100,
                        itemBuilder: (context, position) {
                          return ListTile(
                            title: Text('Item ${position.toString()}'),
                          );
                        },
                      ),
                    ),
                  ),
                ],
              );
            },
          ),
        ],
      ),
    );
  }
}
@maheshj01 maheshj01 added P3 Low priority (default) for features/bugs that will be worked on in near future quality related to fine details and user experience easy fix Should typically take less than 2 hours to implement labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy fix Should typically take less than 2 hours to implement P3 Low priority (default) for features/bugs that will be worked on in near future quality related to fine details and user experience
Projects
None yet
Development

No branches or pull requests

1 participant