[DEV] updated and activated the Widgets elements
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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';
|
||||||
@@ -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,33 +17,37 @@ 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.");
|
||||||
height: mode == Axis.horizontal
|
return SizedBox(
|
||||||
? thickness + (2 * margin)
|
height: mode == Axis.horizontal
|
||||||
: mode == Axis.vertical
|
? thickness + (2 * margin)
|
||||||
? length
|
: mode == Axis.vertical
|
||||||
: 0,
|
? length
|
||||||
width: mode == Axis.vertical
|
: 0,
|
||||||
? thickness + (2 * margin)
|
width: mode == Axis.vertical
|
||||||
: mode == Axis.horizontal
|
? thickness + (2 * margin)
|
||||||
? length
|
: mode == Axis.horizontal
|
||||||
: 0,
|
? length
|
||||||
child: Container(
|
: 0,
|
||||||
margin: EdgeInsets.symmetric(
|
child: Container(
|
||||||
horizontal: mode == Axis.vertical ? margin : 0,
|
margin: EdgeInsets.symmetric(
|
||||||
vertical: mode == Axis.horizontal ? margin : 0,
|
horizontal: mode == Axis.vertical ? margin : 0,
|
||||||
),
|
vertical: mode == Axis.horizontal ? margin : 0,
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: color,
|
|
||||||
borderRadius: rounded ? BorderRadius.circular(1000) : BorderRadius.zero,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
decoration: BoxDecoration(
|
||||||
|
color: gradient != null ? null : color,
|
||||||
|
gradient: color != null ? null : gradient,
|
||||||
|
borderRadius: rounded ? BorderRadius.circular(1000) : BorderRadius.zero,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user