initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'app_data_styles.dart';
|
||||
import 'status_colors.dart';
|
||||
|
||||
/// Shorthand accessors so screens read `context.status.good` /
|
||||
/// `context.dataStyles.dataMono` instead of the verbose
|
||||
/// `Theme.of(context).extension<...>()!` at every call site.
|
||||
extension ThemeX on BuildContext {
|
||||
ThemeData get theme => Theme.of(this);
|
||||
ColorScheme get colors => Theme.of(this).colorScheme;
|
||||
TextTheme get text => Theme.of(this).textTheme;
|
||||
StatusColors get status => Theme.of(this).extension<StatusColors>()!;
|
||||
AppDataStyles get dataStyles => Theme.of(this).extension<AppDataStyles>()!;
|
||||
}
|
||||
Reference in New Issue
Block a user