Answers for "flutter switch text"

2

flutter switch color

bool isChecked = false;
Switch(
            activeColor: Colors.purple,
            activeTrackColor: Colors.purple[100],
            inactiveThumbColor: Colors.grey,
            inactiveTrackColor: Colors.grey[400],
            value: isChecked,
            onChanged: (bool value) { 
              setState(() {
                isChecked = value;
              });
             }, 
            ),
Posted by: Guest on August-28-2021
7

flutter switch case

switch (value) {
  case 0:
    // do something
    break;
  case 1: 
    // do something else
    break;
}
Posted by: Guest on October-28-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language