fast_extensions 0.1.1 fast_extensions: ^0.1.1 copied to clipboard
Convenience extensions to make common Flutter tasks less annoying
Convenience extensions to make common Flutter tasks less annoying
Features #
Extension | Use-case |
---|---|
FastLocale | Localizations.localeOf(context) |
FastMaterialColor | FastMaterialColor.fromColor(color) |
FastMaterialLocalizations | MaterialLocalizations.of(context) |
FastMediaQuery | MediaQuery.of(context) |
FastTheme | Theme.of(context) |
Usage #
import 'package:fast_extensions/fast_extensions.dart';
import 'package:flutter/material.dart';
void example(BuildContext context) {
// FastLocale
context.countryCode;
context.languageCode;
// FastMaterialColor
final primarySwatch = FastMaterialColor.fromColor(const Color(0xFFBC52CC));
ThemeData(primarySwatch: primarySwatch);
// FastMaterialLocalizations
context.backButtonTooltip;
// FastMediaQuery
context.screenWidth;
context.screenHeight;
context.windowViewInsets;
// FastTheme
context.theme;
context.textTheme;
context.isDarkMode;
// ...
}
Additional information #
See fast_ui for more information