Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter multi icon button

List<Icon> icons = [
  ESGIcons.star,
  ESGIcons.crown,
];
int buttonOnPressed = -1;
ListView.builder(
    scrollDirection : Axis.horizontal,
    shrinkWrap: true,
    itemCount: icons.length,
    itemBuilder: (BuildContext context, int index) {
      return IconButton(
        iconSize: 25,
        onPressed: () {
          setState(() {
            buttonOnPressed = index;
          });
        },
        icon: Icon(icons[index]),
        color: (buttonOnPressed == index)
            ? AppTheme.esgEasyYellow
            : AppTheme.esgDarkBlue,
      );
    });
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter showmodal initstate 
Dart :: support various locales flutter 
Dart :: onpressed null flutter 
Dart :: dart formatter stuck 
Dart :: quebrar linha texto flutter 
Dart :: flutter button sound effects 
Dart :: flutter sembast delete a single record 
Dart :: nullable conditional assignment dart 
Dart :: what is shouldshowrequestpermissionrationale return 
Dart :: how to get current date without time in flutter 
Dart :: dart async map 
Dart :: convert data type dart 
Dart :: dart multi line print statement 
Dart :: how to parse json with missing key in lfutter 
Dart :: cascade notation 
Swift :: tellraw minecraft 
Swift :: swift hide navigation bar 
Swift :: swift set view z order front 
Swift :: add toggle without text swiftui 
Swift :: quartzcore framework pi chart 
Swift :: swift comments 
Swift :: swift 5 make a phone call 
Swift :: add corner radius to uiview swift 
Swift :: remove padding hstack swiftui 
Swift :: swift date difference in days 
Swift :: swift find difference between two arrays 
Swift :: get height of navigation bar swift 
Swift :: swift create custom button programmatically 
Swift :: if else if and else statments in swift language 
Swift :: timer in swift stack overflow 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =