feat: starter kit.

This commit is contained in:
Darshan
2025-02-07 17:53:36 +05:30
parent 4705d9ba34
commit 1f9a482d56
208 changed files with 7497 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
/// Extension on [BuildContext] to provide easy access to media query properties.
extension MediaQueryExtensions on BuildContext {
/// Returns `true` if the device width is greater than 768 pixels.
bool get isLargeScreen => MediaQuery.of(this).size.width > 768;
bool get isExtraWideScreen => MediaQuery.of(this).size.width > 1024;
/// Returns `true` if the device width is 768 pixels or less.
bool get isMobile => !isLargeScreen;
/// Returns a scaled width factor based on the screen size.
double widthFactor({
required double mobileFactor,
required double largeScreenFactor,
}) {
return MediaQuery.of(this).size.width *
(isMobile ? mobileFactor : largeScreenFactor);
}
}