Initial commit

This commit is contained in:
jahongireshonqulov
2025-10-18 09:40:06 +05:00
commit 1bf3e41abe
352 changed files with 16315 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
import '../theme/colors/app_colors.dart';
import '../theme/theme_text_style.dart';
extension BuildContextExt on BuildContext {
ThemeTextStyles get text => Theme.of(this).extension<ThemeTextStyles>()!;
AppThemeColors get color => Theme.of(this).extension<AppThemeColors>()!;
bool get isDarkMode => Theme.of(this).brightness == Brightness.dark;
}

View File

@@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
extension HexColor on Color {
/// String is in the format "aabbcc" or "ffaabbcc" with an optional leading "#".
static Color fromHex(String hexString) {
final buffer = StringBuffer();
if (hexString.length == 6 || hexString.length == 7) buffer.write('ff');
buffer.write(hexString.replaceFirst('#', ''));
return Color(int.parse(buffer.toString(), radix: 16));
}
}

View File

@@ -0,0 +1,13 @@
extension SliverCountExtension on int {
int get doubleTheListCount => (this * 2) - 1;
int get exactIndex => (this ~/ 2);
int get lastIndex => (this * 2) - 2;
}
extension VersionParsing on String {
int toVersion() {
return int.tryParse(replaceAll(".", "")) ?? 0;
}
}

View File

@@ -0,0 +1,12 @@
import 'package:flutter/cupertino.dart';
import '../../router/app_routes.dart';
extension ScreenSize on double {
double get w {
return this / 375 * MediaQuery.sizeOf(rootNavigatorKey.currentContext!).width;
}
double get h {
return this / 812 * MediaQuery.sizeOf(rootNavigatorKey.currentContext!).height;
}
}