Coder Social home page Coder Social logo

Comments (3)

hauketoenjes avatar hauketoenjes commented on July 17, 2024

Hi, thanks for the feature request. Currently, such a feature is not planned because that would result in maintaining all the parameters in the scroll views as flutter updates them.

But it's still possible to use the options with this package using the ResponsiveGridListBuilder. It essentially provides the same responsive features as the List / SliverList, but abstracts them a bit. See the README for more information.

You can use it with any scroll view or column like so:

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Responsive Grid List Demo',
      debugShowCheckedModeBanner: false,
      home: DemoPage(),
    );
  }
}

class DemoPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // Generate a list of 100 cards containing a text widget with it's index
    // and render it using a ResponsiveGridListBuilder

    return Scaffold(
      appBar: AppBar(title: const Text("SingleChildScrollViewDemo")),
      body: ResponsiveGridListBuilder(
        horizontalGridMargin: 50,
        verticalGridMargin: 50,
        minItemWidth: 100,
        gridItems: List.generate(
          100,
          (index) => Container(
            color: Colors.lightBlue,
            child: Padding(
              padding: const EdgeInsets.all(32),
              child: Text(
                '$index',
                textAlign: TextAlign.center,
                style: const TextStyle(color: Colors.white),
              ),
            ),
          ),
        ),
        builder: (BuildContext context, List<Widget> items) {
          return SingleChildScrollView(
            reverse: false,
            // ...
            // You can pass all parameters the used scroll view offers
            child: Column(children: items),
          );
        },
      ),
    );
  }
}

from responsive_grid_list.

rozenrod avatar rozenrod commented on July 17, 2024

Can you add at least a ScrollController to get position.pixels?

from responsive_grid_list.

hauketoenjes avatar hauketoenjes commented on July 17, 2024

I'll check that use case some time in the future. Maybe there is a good solution which does not result in maintaining all these parameters and still getting access to them.

from responsive_grid_list.

Related Issues (14)

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.