[0.1.0]
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
path_provider=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider-2.1.3\\
|
||||
path_provider_android=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.6\\
|
||||
path_provider_foundation=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_foundation-2.4.0\\
|
||||
path_provider=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider-2.1.5\\
|
||||
path_provider_android=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.15\\
|
||||
path_provider_foundation=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_foundation-2.4.1\\
|
||||
path_provider_linux=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_linux-2.2.1\\
|
||||
path_provider_windows=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_windows-2.2.1\\
|
||||
sqflite=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\sqflite-2.3.3+1\\
|
||||
path_provider_windows=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_windows-2.3.0\\
|
||||
sqflite=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\sqflite-2.4.1\\
|
||||
sqflite_android=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\sqflite_android-2.4.0\\
|
||||
sqflite_darwin=C:\\Users\\micwa\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\sqflite_darwin-2.4.1+1\\
|
||||
|
||||
@@ -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\\\\micwa\\\\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\\\\micwa\\\\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\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.6\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\micwa\\\\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\\\\micwa\\\\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\\\\micwa\\\\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\\\\micwa\\\\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":"2025-02-09 15:39:20.757997","version":"3.27.1","swift_package_manager_enabled":false}
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite_darwin","path":"C:\\\\Users\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_darwin-2.4.1+1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.15\\\\","native_build":true,"dependencies":[]},{"name":"sqflite_android","path":"C:\\\\Users\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_android-2.4.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite_darwin","path":"C:\\\\Users\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_darwin-2.4.1+1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\micwa\\\\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\\\\micwa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","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":["sqflite_android","sqflite_darwin"]},{"name":"sqflite_android","dependencies":[]},{"name":"sqflite_darwin","dependencies":[]}],"date_created":"2025-02-12 14:12:18.753025","version":"3.27.1","swift_package_manager_enabled":false}
|
||||
38
.gitignore
vendored
38
.gitignore
vendored
@@ -1,3 +1,20 @@
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
|
||||
/pubspec.lock
|
||||
**/doc/api/
|
||||
.dart_tool/
|
||||
build/
|
||||
|
||||
# FVM Version Cache
|
||||
.fvm/
|
||||
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
@@ -9,24 +26,3 @@
|
||||
.history
|
||||
.svn/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
#.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
|
||||
/pubspec.lock
|
||||
**/doc/api/
|
||||
.dart_tool/
|
||||
build/
|
||||
|
||||
# FVM Version Cache
|
||||
.fvm/
|
||||
37
README.md
37
README.md
@@ -1,29 +1,32 @@
|
||||
## Atromic Elements
|
||||
## Astromic Elements
|
||||
|
||||
The elements module of the **Astromic** Presentation System
|
||||
Developed, Maintained, and is property of Michael W. Aziz (Micazi)
|
||||
|
||||
### Content
|
||||
|
||||
- Spacing
|
||||
- VSB,HSB ☑️
|
||||
- Flexer ☑️
|
||||
- Divider ☑️
|
||||
- Widgets
|
||||
- Image ☑️
|
||||
- Scaffold ☑️
|
||||
- Blur ☑️
|
||||
- Buttons
|
||||
- Base ☑️
|
||||
- State Button ☑️
|
||||
- Icon Button ☑️
|
||||
- Link Button ☑️
|
||||
- Fields
|
||||
- Base ☑️
|
||||
- Text Field ☑️
|
||||
- Action Field ☑️
|
||||
- Selectors
|
||||
- Radio ☑️
|
||||
- Chip ☑️
|
||||
- Toggles
|
||||
- Checkbox ☑️
|
||||
- Switcher ☑️
|
||||
- Custom ☑️
|
||||
- Buttons
|
||||
- Base ☑️
|
||||
- Icon Button ☑️
|
||||
- State Button ☑️
|
||||
- Link Button ☑️
|
||||
- Fields
|
||||
- Text Field ☑️
|
||||
- Spacing
|
||||
- VSB,HSB ☑️
|
||||
- Divider ☑️
|
||||
- Flexer ☑️
|
||||
- Widgets
|
||||
- Image ☑️
|
||||
- Blur ☑️
|
||||
- AppBar
|
||||
- Scaffold
|
||||
- SliverScaffold
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
library astromic_elements;
|
||||
|
||||
export 'src/spacing/spacing.astromic.dart';
|
||||
export 'src/widgets/widgets.astromic.dart';
|
||||
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 'package:flutter_svg/flutter_svg.dart' show SvgPicture, BytesLoader, SvgAssetLoader; //Needed for assets manipulation
|
||||
export 'src/selectors/selectors.astromic.dart';
|
||||
export 'src/toggles/toggles.astromic.dart';
|
||||
//
|
||||
export 'src/spacing/spacing.astromic.dart';
|
||||
export 'src/widgets/widgets.astromic.dart';
|
||||
export 'package:flutter_svg/flutter_svg.dart' show SvgPicture, BytesLoader, SvgAssetLoader; //Needed for assets manipulations.
|
||||
export 'dependencies/gradient_border/gradient_borders.dart' show GradientBoxBorder, GradientOutlineInputBorder; //Needed for gradient borders manipulations.
|
||||
|
||||
43
lib/src/Widgets/src/appbar.widget.dart
Normal file
43
lib/src/Widgets/src/appbar.widget.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
// //s1 Imports
|
||||
// //s2 Core Package Imports
|
||||
// import 'package:flutter/material.dart';
|
||||
// //s2 1st-party Package Imports
|
||||
// //s2 3rd-party Package Imports
|
||||
// //s2 Dependancies Imports
|
||||
// //s3 Routes
|
||||
// //s3 Services
|
||||
// //s3 Models
|
||||
// //s1 Exports
|
||||
|
||||
// class AstromicAppBar extends StatelessWidget {
|
||||
// //SECTION - Widget Arguments
|
||||
// //!SECTION
|
||||
// //
|
||||
// const AstromicAppBar({
|
||||
// super.key,
|
||||
// });
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// //SECTION - Build Setup
|
||||
// //s1 -Values
|
||||
// //double w = MediaQuery.of(context).size.width;
|
||||
// //double h = MediaQuery.of(context).size.height;
|
||||
// //s1 -Values
|
||||
// //
|
||||
// //s1 -Widgets
|
||||
// //s1 -Widgets
|
||||
// //!SECTION
|
||||
|
||||
// //SECTION - Build Return
|
||||
// return Scaffold(
|
||||
// body: Container(),
|
||||
// );
|
||||
// //!SECTION
|
||||
// }
|
||||
|
||||
// //SECTION - Helper Functions
|
||||
// // Build the leading widget
|
||||
// Widget? _buildLeading() {}
|
||||
// //!SECTION
|
||||
// }
|
||||
@@ -1,39 +1,85 @@
|
||||
//s1 Imports
|
||||
//s2 Core Package Imports
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
//s2 1st-party Package Imports
|
||||
//s2 3rd-party Package Imports
|
||||
//s2 Dependancies Imports
|
||||
//s3 Routes
|
||||
//s3 Services
|
||||
//s3 Models
|
||||
//s1 Exports
|
||||
|
||||
Widget astromicBlurEffect(
|
||||
Widget child,
|
||||
double sigmaX,
|
||||
double sigmaY, {
|
||||
Widget? topChild,
|
||||
Color? overlayColor = const Color.fromRGBO(0, 0, 0, 0.1),
|
||||
TileMode? tileMode = TileMode.mirror,
|
||||
List<BoxShadow>? shadow,
|
||||
BorderRadius? radius,
|
||||
}) =>
|
||||
Container(
|
||||
class AstromicBlur extends StatelessWidget {
|
||||
//SECTION - Widget Arguments
|
||||
final Widget child;
|
||||
final (double x, double y)? sigma;
|
||||
final TileMode? tileMode;
|
||||
final Color? overlayColor;
|
||||
final Gradient? overlayGradient;
|
||||
final BorderRadius? radius;
|
||||
final List<BoxShadow>? shadow;
|
||||
final Widget? childOnTop;
|
||||
//!SECTION
|
||||
//
|
||||
const AstromicBlur({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.sigma = (5, 5),
|
||||
this.tileMode = TileMode.clamp,
|
||||
this.overlayColor,
|
||||
this.overlayGradient,
|
||||
this.radius,
|
||||
this.shadow,
|
||||
this.childOnTop,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//SECTION - Build Setup
|
||||
//s1 -Values
|
||||
//double w = MediaQuery.of(context).size.width;
|
||||
//double h = MediaQuery.of(context).size.height;
|
||||
//s1 -Values
|
||||
//
|
||||
//s1 -Widgets
|
||||
//s1 -Widgets
|
||||
//!SECTION
|
||||
|
||||
//SECTION - Build Return
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: radius,
|
||||
boxShadow: shadow,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: radius ?? BorderRadius.zero,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
child,
|
||||
child, // The main widget goes under the blurred background
|
||||
BackdropFilter(
|
||||
filter: ImageFilter.blur(
|
||||
sigmaX: 5.0,
|
||||
sigmaY: 5.0,
|
||||
tileMode: TileMode.mirror,
|
||||
filter: ImageFilter.blur(sigmaX: sigma!.$1, sigmaY: sigma!.$2),
|
||||
child: Container(decoration: BoxDecoration(color: overlayColor, gradient: overlayGradient)),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: overlayColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
topChild ?? Container(),
|
||||
childOnTop ?? Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
//!SECTION
|
||||
}
|
||||
}
|
||||
|
||||
extension BlurExtension on Widget {
|
||||
Widget blur({
|
||||
(double x, double y)? sigma,
|
||||
TileMode? tileMode,
|
||||
Color? overlayColor,
|
||||
Gradient? overlayGradient,
|
||||
BorderRadius? radius,
|
||||
List<BoxShadow>? shadow,
|
||||
Widget? childOnTop,
|
||||
}) =>
|
||||
AstromicBlur(child: this, sigma: sigma, tileMode: tileMode, overlayColor: overlayColor, overlayGradient: overlayGradient, radius: radius, shadow: shadow, childOnTop: childOnTop);
|
||||
}
|
||||
|
||||
@@ -1,76 +1,113 @@
|
||||
import 'package:flutter/material.dart';
|
||||
// //s1 Imports
|
||||
// //s2 Core Package Imports
|
||||
// import 'package:flutter/material.dart';
|
||||
// //s2 1st-party Package Imports
|
||||
// //s2 3rd-party Package Imports
|
||||
// //s2 Dependancies Imports
|
||||
// //s3 Routes
|
||||
// //s3 Services
|
||||
// //s3 Models
|
||||
// //s1 Exports
|
||||
|
||||
//
|
||||
Widget astromicScaffold({
|
||||
//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,
|
||||
//
|
||||
}) {
|
||||
assert(!withScrollView || (withScrollView && body is Column), 'Make sure you add a column in the body section!');
|
||||
//
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
//
|
||||
appBar: isAppbarStacked ? null : appBar,
|
||||
floatingActionButton: floatingActionButton,
|
||||
floatingActionButtonLocation: floatingActionButtonLocation,
|
||||
drawer: drawer,
|
||||
bottomNavigationBar: bottomNavigationBar,
|
||||
bottomSheet: bottomSheet,
|
||||
//
|
||||
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
|
||||
extendBody: extendBody,
|
||||
body: Stack(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: !withScrollView && closeKeyboardOnTap ? () => FocusManager.instance.primaryFocus?.unfocus() : null,
|
||||
child: withSafeArea
|
||||
? SafeArea(
|
||||
child: withScrollView
|
||||
? SingleChildScrollView(
|
||||
keyboardDismissBehavior: closeKeyboardOnTap ? ScrollViewKeyboardDismissBehavior.onDrag : ScrollViewKeyboardDismissBehavior.manual,
|
||||
physics: scrollPhysics,
|
||||
padding: padding ?? EdgeInsets.zero,
|
||||
child: body,
|
||||
)
|
||||
: Padding(
|
||||
padding: padding ?? EdgeInsets.zero,
|
||||
child: body,
|
||||
),
|
||||
)
|
||||
: withScrollView
|
||||
? SingleChildScrollView(
|
||||
keyboardDismissBehavior: closeKeyboardOnTap ? ScrollViewKeyboardDismissBehavior.onDrag : ScrollViewKeyboardDismissBehavior.manual,
|
||||
padding: padding ?? EdgeInsets.zero,
|
||||
child: body,
|
||||
)
|
||||
: Padding(
|
||||
padding: padding ?? EdgeInsets.zero,
|
||||
child: body,
|
||||
),
|
||||
),
|
||||
isAppbarStacked && appBar != null ? Wrap(children: [appBar]) : Container(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
// class AstromicScaffold extends StatelessWidget {
|
||||
// //SECTION - Widget Arguments
|
||||
// //!SECTION
|
||||
// //
|
||||
// const AstromicScaffold({
|
||||
// super.key,
|
||||
// });
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// //SECTION - Build Setup
|
||||
// //s1 -Values
|
||||
// //double w = MediaQuery.of(context).size.width;
|
||||
// //double h = MediaQuery.of(context).size.height;
|
||||
// //s1 -Values
|
||||
// //
|
||||
// //s1 -Widgets
|
||||
// //s1 -Widgets
|
||||
// //!SECTION
|
||||
|
||||
// //SECTION - Build Return
|
||||
// return Scaffold(
|
||||
// body: Container(),
|
||||
// );
|
||||
// //!SECTION
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// Widget astromicScaffold({
|
||||
// //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,
|
||||
// //
|
||||
// }) {
|
||||
// assert(!withScrollView || (withScrollView && body is Column), 'Make sure you add a column in the body section!');
|
||||
// //
|
||||
// return Scaffold(
|
||||
// backgroundColor: backgroundColor,
|
||||
// //
|
||||
// appBar: isAppbarStacked ? null : appBar,
|
||||
// floatingActionButton: floatingActionButton,
|
||||
// floatingActionButtonLocation: floatingActionButtonLocation,
|
||||
// drawer: drawer,
|
||||
// bottomNavigationBar: bottomNavigationBar,
|
||||
// bottomSheet: bottomSheet,
|
||||
// //
|
||||
// resizeToAvoidBottomInset: resizeToAvoidBottomInset,
|
||||
// extendBody: extendBody,
|
||||
// body: Stack(
|
||||
// children: [
|
||||
// GestureDetector(
|
||||
// onTap: !withScrollView && closeKeyboardOnTap ? () => FocusManager.instance.primaryFocus?.unfocus() : null,
|
||||
// child: withSafeArea
|
||||
// ? SafeArea(
|
||||
// child: withScrollView
|
||||
// ? SingleChildScrollView(
|
||||
// keyboardDismissBehavior: closeKeyboardOnTap ? ScrollViewKeyboardDismissBehavior.onDrag : ScrollViewKeyboardDismissBehavior.manual,
|
||||
// physics: scrollPhysics,
|
||||
// padding: padding ?? EdgeInsets.zero,
|
||||
// child: body,
|
||||
// )
|
||||
// : Padding(
|
||||
// padding: padding ?? EdgeInsets.zero,
|
||||
// child: body,
|
||||
// ),
|
||||
// )
|
||||
// : withScrollView
|
||||
// ? SingleChildScrollView(
|
||||
// keyboardDismissBehavior: closeKeyboardOnTap ? ScrollViewKeyboardDismissBehavior.onDrag : ScrollViewKeyboardDismissBehavior.manual,
|
||||
// padding: padding ?? EdgeInsets.zero,
|
||||
// child: body,
|
||||
// )
|
||||
// : Padding(
|
||||
// padding: padding ?? EdgeInsets.zero,
|
||||
// child: body,
|
||||
// ),
|
||||
// ),
|
||||
// isAppbarStacked && appBar != null ? Wrap(children: [appBar]) : Container(),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
284
lib/src/Widgets/src/sliver_scaffold.widget.dart
Normal file
284
lib/src/Widgets/src/sliver_scaffold.widget.dart
Normal file
@@ -0,0 +1,284 @@
|
||||
// //SECTION - Imports
|
||||
// //
|
||||
// //s1 PACKAGES
|
||||
// //---------------
|
||||
// //s2 CORE
|
||||
// import 'dart:io';
|
||||
// import 'dart:ui';
|
||||
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter/widgets.dart';
|
||||
// import '../../../../../Domain/Services/Core/L10n/l10n.service.dart';
|
||||
// import '../../../../../Domain/Services/Core/Routing/routing.service.dart';
|
||||
// import '../../../../Astromic/astromic.dart';
|
||||
// import '../../../../DS/ds.dart';
|
||||
|
||||
// //s2 3RD-PARTY
|
||||
// //
|
||||
// //s1 DEPENDENCIES
|
||||
// //---------------
|
||||
// //s2 SERVICES
|
||||
// //s2 MODELS
|
||||
// //s2 MISC
|
||||
// //!SECTION - Imports
|
||||
// //
|
||||
// //SECTION - Exports
|
||||
// //!SECTION - Exports
|
||||
// //
|
||||
// class SliverScaffoldComponent extends StatefulWidget {
|
||||
// //SECTION - Widget Arguments
|
||||
// final EdgeInsets padding;
|
||||
// //
|
||||
// final bool isForm;
|
||||
// final bool resizeToAvoidBottomInset;
|
||||
// //
|
||||
// final bool implyAppbarLeading;
|
||||
// //
|
||||
// final String? appbarTitleString;
|
||||
// final Widget Function(bool isExpanded)? appbarTitleWidget;
|
||||
// //
|
||||
// final List<Widget>? appbarActions;
|
||||
// final Widget? appbarLeading;
|
||||
// //
|
||||
// final Widget? bottomNavigationBar;
|
||||
// final Widget? fab;
|
||||
// final FloatingActionButtonLocation? fabLocation;
|
||||
// //
|
||||
// final bool withSafeArea;
|
||||
// final bool withScrollView;
|
||||
// final bool closeKeyboardOnTap;
|
||||
// final Color? forcedColor;
|
||||
// final Color? forcedAppbarColor;
|
||||
// final bool? isBlurred;
|
||||
// //
|
||||
// final Widget Function(ScrollController? controller)? body;
|
||||
// final Widget? stackedImage;
|
||||
// final bool withExpanded;
|
||||
// final Widget? expandedWidget;
|
||||
// final double? expandedHeight;
|
||||
// //!SECTION
|
||||
// //
|
||||
// const SliverScaffoldComponent({
|
||||
// Key? key,
|
||||
// this.padding = const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
// this.isForm = false,
|
||||
// this.resizeToAvoidBottomInset = true,
|
||||
// this.implyAppbarLeading = true,
|
||||
// this.appbarTitleString,
|
||||
// this.appbarTitleWidget,
|
||||
// this.appbarActions,
|
||||
// this.appbarLeading,
|
||||
// this.bottomNavigationBar,
|
||||
// this.fab,
|
||||
// this.fabLocation,
|
||||
// this.withSafeArea = false,
|
||||
// this.withScrollView = false,
|
||||
// this.closeKeyboardOnTap = true,
|
||||
// this.forcedColor,
|
||||
// this.forcedAppbarColor,
|
||||
// this.isBlurred = false,
|
||||
// this.body,
|
||||
// this.stackedImage,
|
||||
// this.withExpanded = false,
|
||||
// this.expandedWidget,
|
||||
// this.expandedHeight,
|
||||
// }) : super(
|
||||
// key: key,
|
||||
// );
|
||||
|
||||
// @override
|
||||
// State<SliverScaffoldComponent> createState() => _SliverScaffoldComponentState();
|
||||
// }
|
||||
|
||||
// class _SliverScaffoldComponentState extends State<SliverScaffoldComponent> {
|
||||
// //
|
||||
// //SECTION - State Variables
|
||||
// //s1 --State
|
||||
// late ScrollController _scrollController;
|
||||
// //s1 --State
|
||||
// //
|
||||
// //s1 --Controllers
|
||||
// //late AstromicFormController _formController;
|
||||
// //s1 --Controllers
|
||||
// //
|
||||
// //s1 --Constants
|
||||
// double collapsedBarHeight = kToolbarHeight + 8;
|
||||
// //s1 --Constants
|
||||
// //!SECTION
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// //
|
||||
// //SECTION - State Variables initializations & Listeners
|
||||
// //s1 --State
|
||||
// //s1 --State
|
||||
// //
|
||||
// //s1 --Controllers & Listeners
|
||||
// // _formController = AstromicFormController();
|
||||
// _scrollController = ScrollController();
|
||||
|
||||
// //s1 --Controllers & Listeners
|
||||
// //
|
||||
// //s1 --Late & Async Initializers
|
||||
// //s1 --Late & Async Initializers
|
||||
// //!SECTION
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void didChangeDependencies() {
|
||||
// super.didChangeDependencies();
|
||||
// //
|
||||
// //SECTION - State Variables initializations & Listeners
|
||||
// //s1 --State
|
||||
// //s1 --State
|
||||
// //
|
||||
// //s1 --Controllers & Listeners
|
||||
// //s1 --Controllers & Listeners
|
||||
// //
|
||||
// //!SECTION
|
||||
// }
|
||||
|
||||
// //SECTION - Dumb Widgets
|
||||
// bool get _isSliverAppBarExpanded {
|
||||
// return _scrollController.hasClients && _scrollController.offset > ((((widget.expandedHeight) ?? 250) - 20) - kToolbarHeight);
|
||||
// }
|
||||
|
||||
// //-
|
||||
// //----------------------------------------------------------------
|
||||
// //-
|
||||
|
||||
// //!SECTION
|
||||
|
||||
// //SECTION - Stateless functions
|
||||
|
||||
// //!SECTION
|
||||
|
||||
// //SECTION - Action Callbacks
|
||||
// //!SECTION
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// //SECTION - Build Setup
|
||||
// //s1 --Values
|
||||
// double w = MediaQuery.of(context).size.width;
|
||||
// //double h = MediaQuery.of(context).size.height;
|
||||
|
||||
// // debugPrint(MediaQuery.of(context).viewPadding.top.toString());
|
||||
// //s1 --Values
|
||||
// //
|
||||
// //s1 --Contexted Widgets
|
||||
// //s1 --Contexted Widgets
|
||||
// //!SECTION
|
||||
|
||||
// //SECTION - Build Return
|
||||
// return AstromicWidgets.scaffold(
|
||||
// withSafeArea: false,
|
||||
// closeKeyboardOnTap: widget.closeKeyboardOnTap,
|
||||
// padding: widget.padding,
|
||||
// backgroundColor: Colors.white,
|
||||
// resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
|
||||
// bottomNavigationBar: widget.bottomNavigationBar,
|
||||
// floatingActionButton: widget.fab,
|
||||
// floatingActionButtonLocation: widget.fabLocation,
|
||||
// appBar: widget.withExpanded
|
||||
// ? null
|
||||
// : context.miscComponents.appbar(
|
||||
// context,
|
||||
// color: widget.forcedAppbarColor ?? context.colors.main.primary,
|
||||
// elevation: 0,
|
||||
// implyLeading: widget.implyAppbarLeading,
|
||||
// leading: widget.appbarLeading,
|
||||
// actions: widget.appbarActions,
|
||||
// titleString: widget.appbarTitleString,
|
||||
// titleWidget: widget.appbarTitleWidget != null ? widget.appbarTitleWidget!(false) : null,
|
||||
// centerTitle: Platform.isIOS,
|
||||
// isBlurred: widget.isBlurred ?? false,
|
||||
// ),
|
||||
// //
|
||||
// body: widget.withExpanded
|
||||
// ? NestedScrollView(
|
||||
// controller: _scrollController,
|
||||
// headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
// //S1 -- Sliver Appbar
|
||||
|
||||
// widget.withExpanded
|
||||
// ? SliverAppBar(
|
||||
// collapsedHeight: collapsedBarHeight,
|
||||
// expandedHeight: widget.withExpanded ? (widget.expandedHeight ?? 250) : null,
|
||||
// floating: false,
|
||||
// pinned: true,
|
||||
// toolbarHeight: collapsedBarHeight,
|
||||
// flexibleSpace: widget.withExpanded
|
||||
// ? FlexibleSpaceBar(
|
||||
// titlePadding: EdgeInsets.only(top: collapsedBarHeight + MediaQuery.of(context).viewPadding.top),
|
||||
// collapseMode: CollapseMode.parallax,
|
||||
// // stretchModes: const [StretchMode.fadeTitle],
|
||||
// expandedTitleScale: 1,
|
||||
// // titlePadding: EdgeInsets.only(top: collapsedBarHeight + (kToolbarHeight / 2)),
|
||||
// title: widget.expandedWidget ?? Container(),
|
||||
// )
|
||||
// : Container(),
|
||||
// backgroundColor: widget.forcedAppbarColor ?? context.colors.main.primary,
|
||||
// elevation: 0,
|
||||
// automaticallyImplyLeading: widget.implyAppbarLeading,
|
||||
// foregroundColor: context.colors.gs.white,
|
||||
// leading: widget.appbarLeading != null || widget.implyAppbarLeading
|
||||
// ? Row(
|
||||
// textDirection: L10nService.get(context).direction,
|
||||
// children: [
|
||||
// const SizedBox(
|
||||
// width: 4,
|
||||
// ),
|
||||
// widget.appbarLeading ??
|
||||
// context.buttons.neutral.icon(
|
||||
// context,
|
||||
// L10nService.get(context).value<IconString>(
|
||||
// ar: context.assets.iconAssets.arrowRight,
|
||||
// en: context.assets.iconAssets.arrowLeft,
|
||||
// ),
|
||||
// onTap: () async {
|
||||
// RoutingService.back(context);
|
||||
// },
|
||||
// iconColor: context.colors.gs.white,
|
||||
// ),
|
||||
// ],
|
||||
// )
|
||||
// : null,
|
||||
// leadingWidth: 48,
|
||||
// actions: widget.appbarActions != null
|
||||
// ? [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
// child: Row(
|
||||
// children: widget.appbarActions!,
|
||||
// ),
|
||||
// )
|
||||
// ]
|
||||
// : null,
|
||||
// title: widget.appbarTitleString != null
|
||||
// ? Text(
|
||||
// widget.appbarTitleString!,
|
||||
// style: context.typography.headlines.h6.copyWith(fontSize: 18),
|
||||
// )
|
||||
// : widget.appbarTitleWidget!(_isSliverAppBarExpanded),
|
||||
// centerTitle: Platform.isIOS,
|
||||
// )
|
||||
// : Container(),
|
||||
// ],
|
||||
// body: widget.body != null ? widget.body!(_scrollController) : Container(),
|
||||
// )
|
||||
// : widget.body != null
|
||||
// ? widget.body!(null)
|
||||
// : Container(),
|
||||
// );
|
||||
// //!SECTION
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void dispose() {
|
||||
// //SECTION - Disposable variables
|
||||
// //!SECTION
|
||||
// super.dispose();
|
||||
// }
|
||||
// }
|
||||
@@ -1,63 +1,20 @@
|
||||
//s1 Imports
|
||||
//s2 Core Package Imports
|
||||
import 'dart:typed_data';
|
||||
//s2 Core Packages Imports
|
||||
import 'src/blur.widget.dart';
|
||||
import 'src/scaffold.widget.dart';
|
||||
import 'src/image.widget.dart';
|
||||
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;
|
||||
|
||||
class AstromicWidgets {
|
||||
//S1 -- SCAFFOLD
|
||||
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,
|
||||
);
|
||||
|
||||
//S1 -- IMAGE
|
||||
/// Customized Image widget for the Astromic system.
|
||||
static Widget image({
|
||||
String? assetPath,
|
||||
String? assetURL,
|
||||
@@ -121,25 +78,75 @@ class AstromicWidgets {
|
||||
errorWidget: errorWidget,
|
||||
);
|
||||
|
||||
//S1 -- BLUR
|
||||
static Widget blur(
|
||||
Widget child,
|
||||
double sigmaX,
|
||||
double sigmaY, {
|
||||
Widget? topChild,
|
||||
Color? overlayColor = const Color.fromRGBO(0, 0, 0, 0.1),
|
||||
TileMode? tileMode = TileMode.mirror,
|
||||
List<BoxShadow>? shadow,
|
||||
/// 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,
|
||||
}) =>
|
||||
astromicBlurEffect(
|
||||
child,
|
||||
sigmaX,
|
||||
sigmaY,
|
||||
topChild: topChild,
|
||||
overlayColor: overlayColor,
|
||||
AstromicBlur(
|
||||
child: child,
|
||||
sigma: sigma,
|
||||
tileMode: tileMode,
|
||||
shadow: shadow,
|
||||
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,
|
||||
// );
|
||||
}
|
||||
|
||||
11
pubspec.yaml
11
pubspec.yaml
@@ -13,16 +13,17 @@ dev_dependencies:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
##S1 ~ Astromic
|
||||
astromic_extensions:
|
||||
git:
|
||||
url: https://git.micazi.dev/astromic_extensions.git
|
||||
url: https://stag-git.micazi.dev/micazi/astromic_extensions.git
|
||||
##S1 ~ 3rd-party
|
||||
## Needed for the image widget.
|
||||
cached_network_image: ^3.3.1
|
||||
flutter_svg: ^2.0.10+1
|
||||
octo_image: ^2.0.0
|
||||
## Needed for the switcher toggle.
|
||||
flutter_switch: ^0.3.2
|
||||
## Needed for the field element.
|
||||
intl: ^0.19.0
|
||||
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
dependency_overrides:
|
||||
astromic_extensions:
|
||||
git:
|
||||
url: https://git.prox/micazi/astromic_extensions.git
|
||||
Reference in New Issue
Block a user