Files

16 lines
418 B
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
import 'app_colors.dart';
extension AppThemeExtension on BuildContext {
ThemeData get theme => Theme.of(this);
ColorScheme get colors => theme.colorScheme;
TextTheme get textTheme => theme.textTheme;
AppColors get appColors {
final ext = theme.extension<AppColors>();
assert(ext != null, 'AppColors not found in ThemeData.extensions');
return ext!;
}
}