Code Monkey home page Code Monkey logo

Comments (3)

roketstorm avatar roketstorm commented on May 26, 2024

Hello!

I want to use slideable on a list of cards, but since the Card Widget has a rounder border than the slidable Widget, it looks very odd. I originally wanted to make a fork that had the correct border with elevation and more "round" edges, but I can't find the lines where you define the border of the slidable. I therefore do not know what to change. I know it is a small issue, but any help is still greatly appreciated. Thanks in advance.

Hi!

I think I found solution. Check Delegate class that you use in your slidable.dart and just tweak the value of extent in ctx.getMaxExtent:

class SlidableBehindDelegate extends SlidableStackDelegate {
  const SlidableBehindDelegate({
    double fastThreshold,
  }) : super(
          fastThreshold: fastThreshold,
        );

  @override
  Widget buildStackActions(BuildContext context, SlidableDelegateContext ctx) {
    return new Positioned.fill(
      child: new LayoutBuilder(builder: (context, constraints) {
        return new Stack(
          children: <Widget>[
            ctx.createPositioned(
              position: 0.0,
              extent:
                  ctx.getMaxExtent(constraints) * ctx.state.totalActionsExtent + 10.0, // TWEAK THIS TO FIND THE BEST OFFSET FOR YOUR UI (Add double value)
              child: new Flex(
                direction: ctx.state.widget.direction,
                children: ctx
                    .buildActions(context)
                    .map((a) => Expanded(child: a))
                    .toList(),
              ),
            ),
          ],
        );
      }),
    );
  }
}

from flutter_slidable.

letsar avatar letsar commented on May 26, 2024

For the refactoring:
Make sure action panes are clipped

from flutter_slidable.

letsar avatar letsar commented on May 26, 2024

This is now possible in 1.0.0. I will close this ticket. If you have any issue, please open a new one.

from flutter_slidable.

Related Issues (20)

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.