1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Material 3 demo: add tooltips to expanded color picker widgets (#1848)

This commit is contained in:
Kevin Moore
2023-05-26 12:04:49 -07:00
committed by GitHub
parent f082be4015
commit 4f01fbb9c1
2 changed files with 43 additions and 37 deletions

View File

@@ -521,9 +521,8 @@ class _ExpandedColorSeedAction extends StatelessWidget {
isSelected: colorSelected.color == ColorSeed.values[i].color &&
colorSelectionMethod == ColorSelectionMethod.colorSeed,
selectedIcon: const Icon(Icons.circle),
onPressed: () {
handleColorSelect(i);
},
onPressed: () => handleColorSelect(i),
tooltip: ColorSeed.values[i].label,
),
),
),
@@ -552,7 +551,9 @@ class _ExpandedImageColorAction extends StatelessWidget {
crossAxisCount: 3,
children: List.generate(
ColorImageProvider.values.length,
(i) => InkWell(
(i) => Tooltip(
message: ColorImageProvider.values[i].label,
child: InkWell(
borderRadius: BorderRadius.circular(4.0),
onTap: () => handleImageSelect(i),
child: Padding(
@@ -578,6 +579,7 @@ class _ExpandedImageColorAction extends StatelessWidget {
),
),
),
),
);
}
}

View File

@@ -524,6 +524,7 @@ class _ExpandedColorSeedAction extends StatelessWidget {
onPressed: () {
handleColorSelect(i);
},
tooltip: ColorSeed.values[i].label,
),
),
),
@@ -552,7 +553,9 @@ class _ExpandedImageColorAction extends StatelessWidget {
crossAxisCount: 3,
children: List.generate(
ColorImageProvider.values.length,
(i) => InkWell(
(i) => Tooltip(
message: ColorImageProvider.values[i].name,
child: InkWell(
borderRadius: BorderRadius.circular(4.0),
onTap: () => handleImageSelect(i),
child: Padding(
@@ -578,6 +581,7 @@ class _ExpandedImageColorAction extends StatelessWidget {
),
),
),
),
);
}
}