Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created January 26, 2026 14:44
Show Gist options
  • Select an option

  • Save fredgrott/d1c69aeb26524655c2c6470fccf8c424 to your computer and use it in GitHub Desktop.

Select an option

Save fredgrott/d1c69aeb26524655c2c6470fccf8c424 to your computer and use it in GitHub Desktop.
using M3ETheme, non dynamic color way
@override
Widget build(BuildContext context) {
final light = ColorScheme.fromSeed(
seedColor: Colors.purple, brightness: Brightness.light);
final dark = ColorScheme.fromSeed(
seedColor: Colors.purple, brightness: Brightness.dark);
return MaterialApp(
title: 'M3E Gallery',
theme: light.toM3EThemeData(override: M3eOverride(colors: M3ECustomColors.from(light),
typography: M3ECustomTypography(base: CustomTextTheme, emphasized: MyM3ECustomEmphasized ),
shapes: M3ECustomShapes.expressive(),
spacing: M3ECustomSpacing.regular(),
motion: M3EMotion.expressive()),
base: ThemeDataWithCustomComponentThemes(colorScheme: light) ),
darkTheme: dark.toM3EThemeData(override: M3eOverride(colors: M3ECustomColors(dark),
typography: M3ECustomTypography(base: CustomTextTheme, emphasized: MyM3ECustomEmphasized ),
shapes: M3ECustomShapes.expressive(),
spacing: M3ECustomSpacing.regular(),
motion: M3EMotion.expressive()),
base: ThemeDataWithCustomComponentThemes(colorScheme: dark)),
themeMode: _mode,
home: GalleryHome(
isDark: _mode == ThemeMode.dark,
onToggleBrightness: _toggleMode,
),
debugShowCheckedModeBanner: false,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment