mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
25
lib/util/themes_data.dart
Normal file
25
lib/util/themes_data.dart
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue