[DEV] updated and activated the Widgets elements

This commit is contained in:
2024-05-14 13:49:55 +03:00
parent dcc53dbc0a
commit 1777641eaf
3 changed files with 35 additions and 31 deletions

View File

@@ -14,6 +14,6 @@ Developed, Maintained, and is property of Michael W. Aziz (Micazi)
- Selectors - Selectors
- Toggles - Toggles
- Widgets - Widgets
- Image ☑️ - Image
- Scaffold ☑️ - Scaffold
- Blur ☑️ - Blur

View File

@@ -2,11 +2,11 @@ library astromic_mobile_elements;
// //
export './src/Spacing/spacing.astromic.dart'; export './src/Spacing/spacing.astromic.dart';
export './src/Widgets/widgets.astromic.dart';
// export './src/2.Buttons/buttons.astromic.dart'; // export './src/2.Buttons/buttons.astromic.dart';
// export './src/3.Selectors/selectors.astromic.dart'; // export './src/3.Selectors/selectors.astromic.dart';
// export './src/4.Toggles/toggles.astromic.dart'; // export './src/4.Toggles/toggles.astromic.dart';
// export './src/5.Fields/fields.astromic.dart'; // export './src/5.Fields/fields.astromic.dart';
// export './src/6.Widgets/Widgets.astromic.dart';
// // // //
// export './src/styles/styles.astromic.dart'; // export './src/styles/styles.astromic.dart';
// export './src/configurations/configs.astromic.dart'; // export './src/configurations/configs.astromic.dart';

View File

@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
class AstromicSpacing { class AstromicSpacing {
//S1 -- SizedBox //S1 -- SizedBox
static Widget vsb([double h = 0]) => SizedBox(height: h); static Widget vsb([double h = 10]) => SizedBox(height: h);
static Widget hsb([double w = 0]) => SizedBox(width: w); static Widget hsb([double w = 10]) => SizedBox(width: w);
//s1 --- FLEXER //s1 --- FLEXER
static Widget flexer(int factor, [Widget? child]) => factor >= 0 static Widget flexer(int factor, [Widget? child]) => factor >= 0
@@ -17,14 +17,16 @@ class AstromicSpacing {
//S1 --- DIVIDER //S1 --- DIVIDER
static divider( static divider(
double thickness, double thickness, {
Color color, { Color? color,
Gradient? gradient,
Axis mode = Axis.horizontal,
double length = 24.0, double length = 24.0,
double margin = 8.0, double margin = 8.0,
Axis mode = Axis.horizontal,
bool rounded = true, bool rounded = true,
}) => }) {
SizedBox( assert(color != null && gradient == null || color == null && gradient != null, "You can't provide both a color and a gradient.");
return SizedBox(
height: mode == Axis.horizontal height: mode == Axis.horizontal
? thickness + (2 * margin) ? thickness + (2 * margin)
: mode == Axis.vertical : mode == Axis.vertical
@@ -41,9 +43,11 @@ class AstromicSpacing {
vertical: mode == Axis.horizontal ? margin : 0, vertical: mode == Axis.horizontal ? margin : 0,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color, color: gradient != null ? null : color,
gradient: color != null ? null : gradient,
borderRadius: rounded ? BorderRadius.circular(1000) : BorderRadius.zero, borderRadius: rounded ? BorderRadius.circular(1000) : BorderRadius.zero,
), ),
), ),
); );
}
} }