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

Button with Rough #4

Open
vptcnt opened this issue Aug 21, 2020 · 0 comments
Open

Button with Rough #4

vptcnt opened this issue Aug 21, 2020 · 0 comments

Comments

@vptcnt
Copy link

vptcnt commented Aug 21, 2020

Hello,

How to create a button with a Rough border.

class ProfileInfo extends StatelessWidget {
  final String firstText;
  final Function onTap;

  const ProfileInfoBigCard(
      {Key key,
      @required this.firstText,
      this.onTap,
      })
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    var deco = RoughBoxDecoration(    // <- ROUGH
      drawConfig: DrawConfig.build(
        roughness: 1,
        curveStepCount: 10,
        maxRandomnessOffset: 5,
        seed: 1,
      ),
      shape: RoughBoxShape.rectangle,
      borderStyle: RoughDrawingStyle(
        width: 3,
        color: Colors.blue,
      ),
    );
    return Card(
      margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
      elevation: 0,
      shape: RoundedRectangleBorder(.   // <- ROUGH
        borderRadius: BorderRadius.circular(10),
      ),
      child: Container(
        decoration: deco,
        child: InkWell(
          onTap: onTap,
          child: Padding(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Text(firstText, style: titleStyle),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

It works ... BUT.... When I push on the button, the ROUGH border is redraw all the time...

I would like to keep the original rough border

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant