Code Monkey home page Code Monkey logo

Comments (3)

dewygame1 avatar dewygame1 commented on August 28, 2024

try this

class CustomChip extends StatelessWidget {
  final String label;
  final Color? color;
  final double? width;
  final double? height;
  final EdgeInsetsGeometry? margin;
  final bool selected;
  final Function(bool selected) onSelect;

  const CustomChip({
    Key? key,
    required this.label,
    this.color,
    this.width,
    this.height,
    this.margin,
    this.selected = false,
    required this.onSelect,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return RawChip(
      clipBehavior: Clip.none,
      label: Text(label),
      labelStyle: selected ? textStyle(color: AppColors.primary, fontWeight: FontWeight.bold) : textStyle(color: Colors.black),
      backgroundColor: selected ? Color(0xFFFFE2EA) : Color(0xFFEEEEEE),
      padding: EdgeInsets.fromLTRB(17, 2, 17, 2),
      onPressed: () => onSelect(!selected),
    );
  }
}

And use

choiceBuilder: (item) {
                              return Container(
                                margin: EdgeInsets.symmetric(horizontal: 5, vertical: 3),
                                child: CustomChip(
                                  label: item.label,
                                  height: 100,
                                  selected: item.selected,
                                  onSelect: item.select!,
                                ),
                              );
                            }

from flutter_chips_choice.

slavap avatar slavap commented on August 28, 2024

@dewygame1 Thanks, I know how to workaround this issue. But expecting to see β€œnormal” fix without need of any workarounds.

from flutter_chips_choice.

davigmacode avatar davigmacode commented on August 28, 2024

Hi everyone,

I'm sorry to announce that I'm no longer maintaining the chips_choice package. It's been a great project, but it's become too difficult to maintain.

In its place, I've released a new package called choice. The combination to smart_select and chips_choice with cleaner, more flexible, and composable API for creating inline or prompted choice widgets with single or multiple selection.

I hope you'll check out choice. I think you'll find it to be a great replacement for chips_choice.

Thanks for your understanding.

from flutter_chips_choice.

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.