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

pull/1850/head
Kevin Moore 2 years ago committed by GitHub
parent f082be4015
commit 4f01fbb9c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,23 +551,26 @@ class _ExpandedImageColorAction extends StatelessWidget {
crossAxisCount: 3,
children: List.generate(
ColorImageProvider.values.length,
(i) => InkWell(
borderRadius: BorderRadius.circular(4.0),
onTap: () => handleImageSelect(i),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Material(
borderRadius: BorderRadius.circular(4.0),
elevation: imageSelected == ColorImageProvider.values[i] &&
colorSelectionMethod == ColorSelectionMethod.image
? 3
: 0,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(4.0),
child: Image(
image: NetworkImage(ColorImageProvider.values[i].url),
(i) => Tooltip(
message: ColorImageProvider.values[i].label,
child: InkWell(
borderRadius: BorderRadius.circular(4.0),
onTap: () => handleImageSelect(i),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Material(
borderRadius: BorderRadius.circular(4.0),
elevation: imageSelected == ColorImageProvider.values[i] &&
colorSelectionMethod == ColorSelectionMethod.image
? 3
: 0,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(4.0),
child: Image(
image: NetworkImage(ColorImageProvider.values[i].url),
),
),
),
),

@ -524,6 +524,7 @@ class _ExpandedColorSeedAction extends StatelessWidget {
onPressed: () {
handleColorSelect(i);
},
tooltip: ColorSeed.values[i].label,
),
),
),
@ -552,23 +553,26 @@ class _ExpandedImageColorAction extends StatelessWidget {
crossAxisCount: 3,
children: List.generate(
ColorImageProvider.values.length,
(i) => InkWell(
borderRadius: BorderRadius.circular(4.0),
onTap: () => handleImageSelect(i),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Material(
borderRadius: BorderRadius.circular(4.0),
elevation: imageSelected == ColorImageProvider.values[i] &&
colorSelectionMethod == ColorSelectionMethod.image
? 3
: 0,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(4.0),
child: Image(
image: NetworkImage(ColorImageProvider.values[i].url),
(i) => Tooltip(
message: ColorImageProvider.values[i].name,
child: InkWell(
borderRadius: BorderRadius.circular(4.0),
onTap: () => handleImageSelect(i),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Material(
borderRadius: BorderRadius.circular(4.0),
elevation: imageSelected == ColorImageProvider.values[i] &&
colorSelectionMethod == ColorSelectionMethod.image
? 3
: 0,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(4.0),
child: Image(
image: NetworkImage(ColorImageProvider.values[i].url),
),
),
),
),

Loading…
Cancel
Save