Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:meta_app/presentation/themes/theme.dart';
extension BuildContextExt on BuildContext {
AppLocalizations get localizations => AppLocalizations.of(this)!;
ThemeTextStyles get text => Theme.of(this).extension<ThemeTextStyles>()!;
ThemeColors get color => Theme.of(this).extension<ThemeColors>()!;
return ThemeData(
textTheme: createTextTheme(),
brightness: Brightness.light,
scaffoldBackgroundColor: AppColors.white,
extensions: <ThemeExtension<dynamic>>[
ThemeColors.light,
ThemeTextStyles.light,
ThemeGradients.light,
],
);
part of '../theme.dart';
class ThemeColors extends ThemeExtension<ThemeColors> {
final Color filterButtonFillColor;
const ThemeColors({
required this.filterButtonFillColor,
});
@override
part of '../theme.dart';
const headline1 = TextStyle(fontWeight: FontWeight.w400, fontSize: 16);
const headline2 = TextStyle(fontWeight: FontWeight.w400, fontSize: 14);
abstract class AppColors {
static const white = Colors.white;
static const black = Colors.black;
static const blue = Colors.blue;
part of '../theme.dart';
TextTheme createTextTheme() {
return const TextTheme(
headline1: headline1,
headline2: headline2,
);
}
part of '../theme.dart';
ThemeData createLightTheme() {
return ThemeData(
textTheme: createTextTheme(),
brightness: Brightness.light,
scaffoldBackgroundColor: AppColors.white,
extensions: <ThemeExtension<dynamic>>[
ThemeColors.light,
ThemeTextStyles.light,
import 'package:flutter/material.dart';
part 'src/constants.dart';
part 'src/dark_theme.dart';
part 'src/light_theme.dart';
part 'src/text_theme.dart';
part 'src/theme_colors.dart';
part 'src/theme_text_styles.dart';
part 'src/theme_gradients.dart';
{
"version": "2.0.0",
"tasks": [
{
"label": "flutter: analyze",
"type": "shell",
"command": "flutter",
"group": "build",
"runOptions": {
"instanceLimit": 1,