-
Notifications
You must be signed in to change notification settings - Fork 167
Open
Labels
bugSomething isn't workingSomething isn't workingp: dynamic_colortriageIssues that haven't been fully triaged (labels applied, reproducible bug / relevant feature request)Issues that haven't been fully triaged (labels applied, reproducible bug / relevant feature request)
Description
Package
dynamic_color
Existing issue?
- I checked the existing issues
What happened?
When using Dynamic color, the surface container and its variants variants Theme.of(context).colorScheme.
surfaceContainersurfaceContainerHighestsurfaceContainerHighsurfaceContainerLowsurfaceContainerLowest
are the same color as Theme.of(context).colorScheme.surface.
Screenshot (web without dynamicColor, Android with dynamicColor:

Code:
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return DynamicColorBuilder(
builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme:
lightDynamic ?? ColorScheme.fromSeed(seedColor: Colors.cyan),
),
darkTheme: ThemeData(
colorScheme:
darkDynamic ??
ColorScheme.fromSeed(
seedColor: Colors.cyan,
brightness: Brightness.dark,
),
brightness: Brightness.dark,
),
themeMode: ThemeMode.dark,
home: Scaffold(body: Center(child: MyWidget())),
);
},
);
}
}
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Card(
child: Padding(
padding: EdgeInsets.all(8),
child: Text('Hello, World!'),
),
),
Card(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
child: Padding(
padding: EdgeInsets.all(8),
child: Text('Hello, World!'),
),
),
],
);
}
}adisesasi, caoyanglee, PiotrRogulski, rusty-snake, Oqtavios and 2 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp: dynamic_colortriageIssues that haven't been fully triaged (labels applied, reproducible bug / relevant feature request)Issues that haven't been fully triaged (labels applied, reproducible bug / relevant feature request)