mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
25 lines
617 B
Dart
25 lines
617 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ThemesData extends InheritedWidget {
|
|
const ThemesData({
|
|
super.key,
|
|
required this.light,
|
|
required this.dark,
|
|
required super.child,
|
|
});
|
|
|
|
final ThemeData light;
|
|
final ThemeData dark;
|
|
|
|
static ThemesData? maybeOf(BuildContext context) {
|
|
return context.dependOnInheritedWidgetOfExactType<ThemesData>();
|
|
}
|
|
|
|
static ThemesData of(BuildContext context) {
|
|
final ThemesData? result = maybeOf(context);
|
|
return result!;
|
|
}
|
|
|
|
@override
|
|
bool updateShouldNotify(ThemesData oldWidget) => light != oldWidget.light || dark != oldWidget.dark;
|
|
}
|