dynamicDarkTheme function
Implementation
ThemeData dynamicDarkTheme(ColorScheme? darkColorScheme) {
final baseScheme =
darkColorScheme ?? const ColorScheme.dark(primary: kPrimaryColor);
return ThemeData(
useMaterial3: true,
colorScheme: baseScheme,
scaffoldBackgroundColor: baseScheme.surface,
fontFamily: GoogleFonts.notoSans().fontFamily,
brightness: Brightness.dark,
appBarTheme: appBarTheme().copyWith(
backgroundColor: Colors.transparent,
iconTheme: IconThemeData(color: baseScheme.onSurface),
titleTextStyle: GoogleFonts.spaceGrotesk(
color: baseScheme.onSurface,
fontSize: 18,
fontWeight: FontWeight.bold),
),
inputDecorationTheme: inputDecorationTheme(
fillColor:
baseScheme.surfaceContainerHigh, // Adapts to dynamic dark surface
borderColor: baseScheme.outline,
focusColor: baseScheme.primary,
),
textTheme: textTheme().apply(
bodyColor: baseScheme.onSurface,
displayColor: baseScheme.onSurface,
),
extensions: <ThemeExtension<dynamic>>[
DiagramTheme(
canvasBg: baseScheme.surfaceContainerLowest,
panelBg: baseScheme.surfaceContainerLow,
gridLine: baseScheme.onSurface.withValues(alpha: 0.05),
nodeBg: baseScheme.surfaceContainerHigh,
nodeBorder: baseScheme.outline,
textColor: baseScheme.onSurface,
accentColor: baseScheme.primary,
isDark: true,
),
],
);
}