MaterialStateProperty 颤动

代码示例

1
0

MaterialStateProperty 颤动

// ** Declaration ** //
MaterialStateProperty<Color?>? redColor = MaterialStateProperty.all(Colors.red);
// backgroundColor property
backgroundColor: MaterialStateProperty.all(Colors.green),
//OR
backgroundColor: MaterialStateProperty.all(Color(0xFFEDEDED)),
1
0

materialstateproperty颜色

ElevatedButton(
          style: ButtonStyle(
          backgroundColor: MaterialStateProperty.all(Colors.amberAccent)),
          onPressed: () {},
          child: const Text(
            "Hover Me",
            style: TextStyle(
              fontSize: 20,
            ),
          ),
        ),

类似页面

带有示例的类似页面

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................