16 lines
619 B
Dart
16 lines
619 B
Dart
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>()!;
|
|
}
|