Files
astromic_elements/lib/src/Widgets/widgets.astromic.dart

156 lines
5.0 KiB
Dart

//s1 Imports
//s2 Core Package Imports
import 'dart:typed_data';
import 'package:flutter/material.dart';
//s2 1st-party Package Imports
//s2 3rd-party Package Imports
//s2 Dependancies Imports
//s3 Routes
//s3 Services
//s3 Models & Widgets
import 'src/blur.widget.dart';
import 'src/image.widget.dart';
//s1 Exports
export 'src/blur.widget.dart' show BlurExtension;
export 'src/image.widget.dart' show ImageSizingMaster;
class AstromicWidgets {
/// Customized Image widget for the Astromic system.
static Widget image({
String? assetPath,
String? assetURL,
Uint8List? assetBytes,
String? assetFallback,
ImageSizingMaster? sizingMaster,
(double factor, double? min, double? max)? widthSizing,
/// Used when the width is Master and want to set fixed width OR if height is Master and want to constraint the width
double? fixedWidth,
(double factor, double? min, double? max)? heightSizing,
/// Used when the height is Master and want to set fixed height OR if width is Master and want to constraint the height
double? fixedHeight,
bool? isCircular,
double? borderWidth,
Color? borderColor,
EdgeInsetsGeometry? borderPadding,
BorderRadiusGeometry? radius,
List<BoxShadow>? shadow,
Color? overlayColor,
Gradient? overlayGradient,
Alignment? alignment,
BoxFit? fit,
BlendMode? blendMode,
Curve? fadeInCurve,
Duration? fadeInDuration,
Color? svgColor,
Widget Function(int? loadedBytes, int? totalBytesToLoad)? loadingWidget,
Widget Function(dynamic error, StackTrace? stackTrace)? errorWidget,
double? imageQuality,
}) =>
AstromicImage(
assetPath: assetPath,
assetURL: assetURL,
assetBytes: assetBytes,
assetFallback: assetFallback,
sizingMaster: sizingMaster ?? ImageSizingMaster.w,
widthSizing: widthSizing,
/// Used when the width is Master and want to set fixed width OR if height is Master and want to constraint the width
fixedWidth: fixedWidth,
heightSizing: heightSizing,
/// Used when the height is Master and want to set fixed height OR if width is Master and want to constraint the height
fixedHeight: fixedHeight,
isCircular: isCircular ?? false,
borderWidth: borderWidth,
borderColor: borderColor,
borderPadding: borderPadding,
radius: radius ?? BorderRadius.zero,
shadow: shadow,
overlayColor: overlayColor,
overlayGradient: overlayGradient,
alignment: alignment ?? Alignment.center,
fit: fit ?? BoxFit.cover,
blendMode: blendMode,
fadeInCurve: fadeInCurve ?? Curves.ease,
fadeInDuration: fadeInDuration ?? const Duration(milliseconds: 250),
svgColor: svgColor,
loadingWidget: loadingWidget,
errorWidget: errorWidget,
imageQuality: imageQuality,
);
/// Customized Blur widget for the Astromic system.
static Widget blur({
required Widget child,
(double x, double y)? sigma,
TileMode? tileMode,
Color? overlayColor,
Gradient? overlayGradient,
BorderRadius? radius,
List<BoxShadow>? shadow,
Widget? childOnTop,
}) =>
AstromicBlur(
child: child,
sigma: sigma,
tileMode: tileMode,
overlayColor: overlayColor,
overlayGradient: overlayGradient,
radius: radius,
shadow: shadow,
childOnTop: childOnTop,
);
// static Widget scaffold({
// //S1 -- AppBar
// PreferredSizeWidget? appBar,
// bool isAppbarStacked = false,
// //S1 -- FAB
// Widget? floatingActionButton,
// FloatingActionButtonLocation? floatingActionButtonLocation,
// //S1 -- Other Integral Components
// Widget? drawer,
// Widget? bottomNavigationBar,
// Widget? bottomSheet,
// //S1 -- Styling
// Color? backgroundColor,
// EdgeInsetsGeometry? padding,
// ScrollPhysics? scrollPhysics = const BouncingScrollPhysics(),
// //S1 -- Configs
// bool withSafeArea = false,
// bool extendBody = false,
// bool resizeToAvoidBottomInset = true,
// bool withScrollView = false,
// bool closeKeyboardOnTap = true,
// //
// Widget? body,
// //
// }) =>
// astromicScaffold(
// //
// appBar: appBar,
// isAppbarStacked: isAppbarStacked,
// //
// floatingActionButton: floatingActionButton,
// floatingActionButtonLocation: floatingActionButtonLocation,
// //
// drawer: drawer,
// bottomNavigationBar: bottomNavigationBar,
// bottomSheet: bottomSheet,
// //
// backgroundColor: backgroundColor,
// padding: padding,
// scrollPhysics: scrollPhysics,
// //
// withSafeArea: withSafeArea,
// extendBody: extendBody,
// resizeToAvoidBottomInset: resizeToAvoidBottomInset,
// withScrollView: withScrollView,
// closeKeyboardOnTap: closeKeyboardOnTap,
// //
// body: body,
// );
}