-[corepalette]: https://github.com/material-foundation/material-dynamic-color-flutter/tree/main/lib/src/core_palette.dart
[complete example]: https://github.com/material-foundation/material-dynamic-color-flutter/tree/main/example/lib/complete_example.dart
[dynamiccolorbuilder example]: https://github.com/material-foundation/material-dynamic-color-flutter/tree/main/example/lib/dynamic_color_builder_example.dart
[dynamiccolorplugin.getcorepalette example]: https://github.com/material-foundation/material-dynamic-color-flutter/tree/main/example/lib/get_core_palette_example.dart
diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock
index 309cd00..c751001 100644
--- a/example/ios/Podfile.lock
+++ b/example/ios/Podfile.lock
@@ -13,4 +13,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
-COCOAPODS: 1.10.1
+COCOAPODS: 1.10.0
diff --git a/example/lib/complete_example.dart b/example/lib/complete_example.dart
index 9791312..0fc91b3 100644
--- a/example/lib/complete_example.dart
+++ b/example/lib/complete_example.dart
@@ -1,5 +1,4 @@
import 'package:dynamic_color/dynamic_color.dart';
-import 'package:material_color_utilities/material_color_utilities.dart';
import 'package:flutter/material.dart';
bool _isDemoUsingDynamicColors = false;
@@ -12,20 +11,19 @@ class CompleteExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DynamicColorBuilder(
- builder: (CorePalette? corePalette) {
+ builder: (ColorScheme? light, ColorScheme? dark) {
// One can create ColorSchemes from scratch, but we'll start from the
// default schemes.
ColorScheme colorScheme = const ColorScheme.light();
ColorScheme darkColorScheme = const ColorScheme.dark();
- if (corePalette != null) {
- // On Android S+ devices, use the 40 and 80 tones of the dynamic
- // primary tonal palette for the light and dark schemes, respectively.
+ if (light != null && dark != null) {
+ // On Android S+ devices, use the dynamic primary color.
colorScheme = colorScheme.copyWith(
- primary: Color(corePalette.primary.get(40)),
+ primary: light.primary,
);
darkColorScheme = darkColorScheme.copyWith(
- primary: Color(corePalette.primary.get(80)),
+ primary: dark.primary,
);
// Harmonize the dynamic color schemes' error and onError colors
diff --git a/example/lib/core_palette_visualization.dart b/example/lib/core_palette_visualization.dart
index 7767d7a..2582141 100644
--- a/example/lib/core_palette_visualization.dart
+++ b/example/lib/core_palette_visualization.dart
@@ -1,9 +1,9 @@
import 'dart:io';
import 'package:dynamic_color/dynamic_color.dart';
-import 'package:material_color_utilities/material_color_utilities.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+import 'package:material_color_utilities/material_color_utilities.dart';
/// A sample [CorePalette], as obtained by the [DynamicColorPlugin] from the
/// Android OS.
@@ -113,11 +113,16 @@ class _CorePaletteVisualizationState extends StateVO{gu@7n%w!g;qjGp|j9k7$6K0#t7qu$--1&hA>lDBrFqF
z32TLo!d79Yuv^$K92AZS$A#0vdEtU^MYtzC5>p7zgjd2l;gj%9Bt%9OL`Bp@M@)z*
z#k68ZF{_wM%qbQUONwR1iego $E4ubH(3gP?!L}Y@MAt91>c{qITU=`r=;M0S_;q6XQc2FeO3x@QvVtX?^0i{
zC`_X-Na17pq7*)-{(cm`rY}q3d-{qLexk2R;aB>a6lPGr2T+(pUzfrH`i2x1Q9maX
z7Sp$+7@>a8px8s-kz$Pcd83%3Q>B=r?@6&n-yLa>*!CCjZnKbvI)9QvKhKw
zvK6{Pvh}I057~pLJu}EQrkf?(gl>^+bGlWst*AX$$hM)jw;jB0Pj^c8RBF!~vYqH|
z$#$W(e`IaOev$0u^jFDtqxO6v+k@H}A=``oF4=zc56SkYdnJ1twR1%F4*I8Lhf;gC
zksU_=mh1>>XN~L_`j2GC(tjm8&f#E-|H)3EPRUN9F3G+``HnEz>C_|Hnba%UIn*cF
z`P47jC6w{%g$Cb2B9M@3J!Z@y@VR76*
zBjUJ;M#a&e#>8