[DEV] Added infrastructure extension exports
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
path_provider=C:\\Users\\Micazi\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider-2.1.3\\
|
||||
path_provider_android=C:\\Users\\Micazi\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.4\\
|
||||
path_provider_foundation=C:\\Users\\Micazi\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_foundation-2.4.0\\
|
||||
path_provider_linux=C:\\Users\\Micazi\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_linux-2.2.1\\
|
||||
path_provider_windows=C:\\Users\\Micazi\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_windows-2.2.1\\
|
||||
sqflite=C:\\Users\\Micazi\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\sqflite-2.3.3+1\\
|
||||
path_provider=/Users/micazi/.pub-cache/hosted/pub.dev/path_provider-2.1.3/
|
||||
path_provider_android=/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/
|
||||
path_provider_foundation=/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/
|
||||
path_provider_linux=/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
|
||||
path_provider_windows=/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/
|
||||
sqflite=/Users/micazi/.pub-cache/hosted/pub.dev/sqflite-2.3.3/
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.3+1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.4\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.3+1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\Micazi\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.2.1\\\\","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2024-05-22 17:33:59.184180","version":"3.22.0"}
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/micazi/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/micazi/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/micazi/.pub-cache/hosted/pub.dev/sqflite-2.3.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/micazi/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2024-09-17 12:51:18.099992","version":"3.24.1","swift_package_manager_enabled":false}
|
||||
7
lib/Infrastructure/border_extensions.dart
Normal file
7
lib/Infrastructure/border_extensions.dart
Normal file
@@ -0,0 +1,7 @@
|
||||
import "package:flutter/painting.dart";
|
||||
|
||||
extension BorderExtension on BorderDirectional {
|
||||
BorderDirectional all(BorderSide side) {
|
||||
return BorderDirectional(top: side, bottom: side, start: side, end: side);
|
||||
}
|
||||
}
|
||||
7
lib/Infrastructure/infrastructure.exports.dart
Normal file
7
lib/Infrastructure/infrastructure.exports.dart
Normal file
@@ -0,0 +1,7 @@
|
||||
export './border_extensions.dart';
|
||||
export './insets_extension.dart';
|
||||
export './list_extensions.dart';
|
||||
export './misc_extensions.dart';
|
||||
export './radius_extensions.dart';
|
||||
export './string_extensions.dart';
|
||||
export './transparent_image.dart';
|
||||
@@ -1,14 +1,12 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
extension InsetsExtension on EdgeInsetsGeometry {
|
||||
copyWith(EdgeInsetsGeometry g) => add(g);
|
||||
//
|
||||
EdgeInsetsDirectional resolveToDirectional(ui.TextDirection direction) {
|
||||
EdgeInsetsDirectional resolveToDirectional(TextDirection direction) {
|
||||
//
|
||||
return EdgeInsetsDirectional.fromSTEB(direction == ui.TextDirection.ltr ? resolve(direction).left : resolve(direction).right, resolve(direction).top,
|
||||
direction == ui.TextDirection.ltr ? resolve(direction).right : resolve(direction).left, resolve(direction).bottom);
|
||||
return EdgeInsetsDirectional.fromSTEB(direction == TextDirection.ltr ? resolve(direction).left : resolve(direction).right, resolve(direction).top,
|
||||
direction == TextDirection.ltr ? resolve(direction).right : resolve(direction).left, resolve(direction).bottom);
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
15
lib/Infrastructure/radius_extensions.dart
Normal file
15
lib/Infrastructure/radius_extensions.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
extension RadiusExtension on BorderRadiusGeometry {
|
||||
copyWith(BorderRadiusGeometry g) => add(g);
|
||||
//
|
||||
BorderRadiusDirectional resolveToDirectional(TextDirection direction) {
|
||||
//
|
||||
return BorderRadiusDirectional.only(
|
||||
topStart: direction == TextDirection.ltr ? resolve(direction).topLeft : resolve(direction).topRight,
|
||||
topEnd: direction == TextDirection.rtl ? resolve(direction).topLeft : resolve(direction).topRight,
|
||||
bottomEnd: direction == TextDirection.rtl ? resolve(direction).bottomRight : resolve(direction).bottomRight,
|
||||
bottomStart: direction == TextDirection.ltr ? resolve(direction).bottomLeft : resolve(direction).bottomRight,
|
||||
);
|
||||
}
|
||||
}
|
||||
19
lib/Infrastructure/string_extensions.dart
Normal file
19
lib/Infrastructure/string_extensions.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension StringExtensions on String {
|
||||
/// Parse the HexCode to color
|
||||
Color get toColor {
|
||||
if (this == '') return const Color(0xFF000000);
|
||||
String hexColor = replaceAll('#', '');
|
||||
hexColor = hexColor.replaceAll('0x', '');
|
||||
hexColor = hexColor.padLeft(6, '0');
|
||||
hexColor = hexColor.padLeft(8, 'F');
|
||||
final int length = hexColor.length;
|
||||
return Color(int.tryParse('0x${hexColor.substring(length - 8, length)}') ?? 0xFF000000);
|
||||
}
|
||||
|
||||
/// Capitalize the first letter in a string.
|
||||
String get capitalize {
|
||||
return (length > 1) ? this[0].toUpperCase() + substring(1) : toUpperCase();
|
||||
}
|
||||
}
|
||||
@@ -6,3 +6,4 @@ export './src/Selectors/selectors.astromic.dart';
|
||||
export './src/Toggles/toggles.astromic.dart';
|
||||
export './src/Buttons/buttons.astromic.dart';
|
||||
export './src/Fields/fields.astromic.dart';
|
||||
export './Infrastructure/infrastructure.exports.dart';
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
//s1 PACKAGES
|
||||
//---------------
|
||||
//s2 CORE
|
||||
import 'package:astromic_mobile_elements/Infrastructure/insets_extension.dart';
|
||||
import 'package:astromic_mobile_elements/Infrastructure/misc_extensions.dart';
|
||||
import 'package:astromic_mobile_elements/astromic_mobile_elements.dart';
|
||||
import '../../../Infrastructure/insets_extension.dart';
|
||||
import '../../../Infrastructure/misc_extensions.dart';
|
||||
import '../../../astromic_mobile_elements.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
|
||||
Reference in New Issue
Block a user