Compare commits

...

9 Commits

37 changed files with 875 additions and 42 deletions

View File

@ -0,0 +1,41 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
/// {@template authentication_mock_cache_data_source_impl}
/// A data source that manages the cache strategy.
/// This implementation is mocked.
/// {@endtemplate}
class AuthenticationMockCacheDataSourceImpl<Data>
extends AuthenticationCacheDataSource<Data> {
/// {@macro authentication_mock_cache_data_source_impl}
AuthenticationMockCacheDataSourceImpl();
@override
Future<void> cacheAccount(Account account) => Future.value();
/// Always returns null.
@override
Future<Account?> getCachedAccount() async {
await Future<void>.delayed(const Duration(milliseconds: 200));
return null;
}
@override
Future<void> removeCachedAccount() => Future.value();
}

View File

@ -15,5 +15,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export 'authentication_firebase_cache_data_source_impl.dart';
export 'authentication_mock_cache_data_source_impl.dart';
export 'authentication_secure_storage_cache_data_source_impl.dart';
export 'authentication_session_data_source_impl.dart';

View File

@ -0,0 +1,23 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';
abstract class CubitConsumerBase<Cubit extends bloc_base.Cubit<State>,
State extends Object> extends CubitConsumerScreen<Cubit, State> {
const CubitConsumerBase({super.key});
}

View File

@ -0,0 +1,31 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
abstract class CubitConsumerCrudBase<Cubit extends bloc_base.Cubit<CrudState>,
CrudSuccessState extends CrudSuccess>
extends CubitConsumerBase<Cubit, CrudState>
with CrudMixin<Cubit, CrudSuccessState> {
const CubitConsumerCrudBase({super.key});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}

View File

@ -0,0 +1,25 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
abstract class CubitConsumerCrudItemBase<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitConsumerCrudBase<Cubit, CrudLoaded<T>> {
const CubitConsumerCrudItemBase({super.key});
}

View File

@ -0,0 +1,25 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
abstract class CubitConsumerCrudListBase<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitConsumerCrudBase<Cubit, CrudListLoaded<T>> {
const CubitConsumerCrudListBase({super.key});
}

View File

@ -26,6 +26,7 @@ abstract class FrameLayoutGridCubitScreenCrudList<
super.customAppBar,
super.customBottomNavBar,
super.height = 60,
super.scaffoldFieldsWrapper,
super.key,
});
}

View File

@ -26,6 +26,7 @@ abstract class FrameLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
const FrameLayoutCubitScreen({
this.customAppBar,
this.customBottomNavBar,
this.scaffoldFieldsWrapper,
this.height = 60,
super.key,
});
@ -34,12 +35,14 @@ abstract class FrameLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
final BottomNavigationBarComponent? Function(BottomNavigationBarComponent?)?
customBottomNavBar;
final double height;
final ScaffoldFieldsWrapper? scaffoldFieldsWrapper;
@override
Widget parent(BuildContext context, Widget child) => FrameLayout(
customAppBar: customAppBar,
customBottomNavBar: customBottomNavBar,
height: height,
scaffoldFieldsWrapper: scaffoldFieldsWrapper,
body: child,
);
}

View File

@ -29,6 +29,7 @@ abstract class FrameLayoutCubitScreenCrud<
super.customBottomNavBar,
super.height,
super.key,
super.scaffoldFieldsWrapper,
});
@override

View File

@ -25,6 +25,7 @@ abstract class FrameLayoutCubitScreenCrudItem<
super.customAppBar,
super.customBottomNavBar,
super.height = 60,
super.scaffoldFieldsWrapper,
super.key,
});
}

View File

@ -25,6 +25,7 @@ abstract class FrameLayoutCubitScreenCrudList<
super.customAppBar,
super.customBottomNavBar,
super.height = 60,
super.scaffoldFieldsWrapper,
super.key,
});
}

View File

@ -15,6 +15,10 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export './bottom_navigation_bar_bloc_layout/bottom_navigation_bar_bloc_layout.dart';
export './cubit_consumer_base.dart';
export './cubit_consumer_crud_base.dart';
export './cubit_consumer_crud_item_base.dart';
export './cubit_consumer_crud_list_base.dart';
export './cubit_screen_base.dart';
export './cubit_screen_crud_base.dart';
export './cubit_screen_crud_item_base.dart';

View File

@ -15,7 +15,7 @@ dependencies:
flutter_bloc: ^8.1.2
flutter_localizations: { sdk: flutter }
http: ^0.13.5
intl: ^0.17.0
intl: ^0.18.0
path: ^1.8.0
petitparser: ^5.1.0
wyatt_architecture:

View File

@ -19,6 +19,7 @@ export './buttons/buttons.dart';
export './cards/cards.dart';
export './component.dart';
export './error/error.dart';
export './floating_buttons/floating_buttons.dart';
export './gradients/gradients.dart';
export './loader/loader.dart';
export './rich_text_builder/rich_text_builder.dart';

View File

@ -0,0 +1,17 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export './floating_action_button_component.dart';

View File

@ -28,6 +28,17 @@ abstract class RichTextBuilderComponent extends Component
this.parser,
this.defaultStyle,
this.styles,
this.strutStyle,
this.textAlign,
this.textDirection,
this.locale,
this.softWrap,
this.overflow,
this.textScaleFactor,
this.maxLines,
this.semanticsLabel,
this.textWidthBasis,
this.selectionColor,
super.key,
});
@ -52,4 +63,83 @@ abstract class RichTextBuilderComponent extends Component
/// ```
/// in "This text `is red`."
final Map<String, TextStyle>? styles;
final StrutStyle? strutStyle;
/// How the text should be aligned horizontally.
final TextAlign? textAlign;
/// The directionality of the text.
///
/// This decides how [textAlign] values like [TextAlign.start] and
/// [TextAlign.end] are interpreted.
final TextDirection? textDirection;
/// Used to select a font when the same Unicode character can
/// be rendered differently, depending on the locale.
final Locale? locale;
/// Whether the text should break at soft line breaks.
///
/// If false, the glyphs in the text will be positioned as if there
/// was unlimited horizontal space.
final bool? softWrap;
/// How visual overflow should be handled.
///
/// If this is null [TextStyle.overflow] will be used, otherwise the value
/// from the nearest [DefaultTextStyle] ancestor will be used.
final TextOverflow? overflow;
/// The number of font pixels for each logical pixel.
///
/// For example, if the text scale factor is 1.5, text will be 50% larger than
/// the specified font size.
///
/// The value given to the constructor as textScaleFactor. If null, will
/// use the [MediaQueryData.textScaleFactor] obtained from the ambient
/// [MediaQuery], or 1.0 if there is no [MediaQuery] in scope.
final double? textScaleFactor;
/// An optional maximum number of lines for the text to span, wrapping if
/// necessary.
/// If the text exceeds the given number of lines, it will be truncated
/// according to [overflow].
///
/// If this is 1, text will not wrap. Otherwise, text will be wrapped at the
/// edge of the box.
///
/// If this is null, but there is an ambient [DefaultTextStyle] that specifies
/// an explicit number for its [DefaultTextStyle.maxLines], then the
/// [DefaultTextStyle] value will take precedence. You can use a [RichText]
/// widget directly to entirely override the [DefaultTextStyle].
final int? maxLines;
/// {@template flutter.widgets.Text.semanticsLabel}
/// An alternative semantics label for this text.
///
/// If present, the semantics of this widget will contain this value instead
/// of the actual text. This will overwrite any of the semantics labels
/// applied directly to the [TextSpan]s.
///
/// This is useful for replacing abbreviations or shorthands with the full
/// text value:
///
/// ```dart
/// const Text(r'$$', semanticsLabel: 'Double dollars')
/// ```
/// {@endtemplate}
final String? semanticsLabel;
final TextWidthBasis? textWidthBasis;
/// The color to use when painting the selection.
///
/// This is ignored if [SelectionContainer.maybeOf] returns null
/// in the [BuildContext] of the [Text] widget.
///
/// If null, the ambient [DefaultSelectionStyle] is used (if any); failing
/// that, the selection color defaults to [DefaultSelectionStyle.defaultColor]
/// (semi-transparent grey).
final Color? selectionColor;
}

View File

@ -11,12 +11,34 @@ abstract class $RichTextBuilderComponentCWProxy {
RichTextBuilderComponent parser(RichTextParser? parser);
RichTextBuilderComponent defaultStyle(TextStyle? defaultStyle);
RichTextBuilderComponent styles(Map<String, TextStyle>? styles);
RichTextBuilderComponent strutStyle(StrutStyle? strutStyle);
RichTextBuilderComponent textAlign(TextAlign? textAlign);
RichTextBuilderComponent textDirection(TextDirection? textDirection);
RichTextBuilderComponent locale(Locale? locale);
RichTextBuilderComponent softWrap(bool? softWrap);
RichTextBuilderComponent overflow(TextOverflow? overflow);
RichTextBuilderComponent textScaleFactor(double? textScaleFactor);
RichTextBuilderComponent maxLines(int? maxLines);
RichTextBuilderComponent semanticsLabel(String? semanticsLabel);
RichTextBuilderComponent textWidthBasis(TextWidthBasis? textWidthBasis);
RichTextBuilderComponent selectionColor(Color? selectionColor);
RichTextBuilderComponent key(Key? key);
RichTextBuilderComponent call({
String? text,
RichTextParser? parser,
TextStyle? defaultStyle,
Map<String, TextStyle>? styles,
StrutStyle? strutStyle,
TextAlign? textAlign,
TextDirection? textDirection,
Locale? locale,
bool? softWrap,
TextOverflow? overflow,
double? textScaleFactor,
int? maxLines,
String? semanticsLabel,
TextWidthBasis? textWidthBasis,
Color? selectionColor,
Key? key,
});
}

View File

@ -17,7 +17,6 @@
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/src/domain/entities/entities.dart';
import 'package:wyatt_ui_components/src/domain/entities/floating_buttons/floating_action_button_component.dart';
part 'component_theme_data.g.dart';
/// {@template component_theme_data}
@ -42,6 +41,7 @@ class ComponentThemeData {
PortfolioCardComponent? portfolioCard,
QuoteCardComponent? quoteCard,
SkillCardComponent? skillCard,
PricingCardComponent? pricingCard,
FloatingActionButtonComponent? floatingActionButton,
}) =>
ComponentThemeData.raw(
@ -60,6 +60,7 @@ class ComponentThemeData {
portfolioCard: portfolioCard,
quoteCard: quoteCard,
skillCard: skillCard,
pricingCard: pricingCard,
floatingActionButton: floatingActionButton,
);
@ -81,6 +82,7 @@ class ComponentThemeData {
portfolioCard: other.portfolioCard,
quoteCard: other.quoteCard,
skillCard: other.skillCard,
pricingCard: other.pricingCard,
floatingActionButton: other.floatingActionButton,
);
@ -106,6 +108,7 @@ class ComponentThemeData {
this.portfolioCard,
this.quoteCard,
this.skillCard,
this.pricingCard,
this.floatingActionButton,
});
@ -154,6 +157,9 @@ class ComponentThemeData {
final SkillCardComponent? skillCard;
$SkillCardComponentCWProxy get skillCardComponent =>
_get(skillCard, skillCard?.copyWith);
final PricingCardComponent? pricingCard;
$PricingCardComponentCWProxy get pricingCardComponent =>
_get(pricingCard, pricingCard?.copyWith);
// Rich Text
final RichTextBuilderComponent? richTextBuilder;

View File

@ -41,6 +41,8 @@ abstract class _$ComponentThemeDataCWProxy {
ComponentThemeData skillCard(SkillCardComponent? skillCard);
ComponentThemeData pricingCard(PricingCardComponent? pricingCard);
ComponentThemeData floatingActionButton(
FloatingActionButtonComponent? floatingActionButton);
@ -66,6 +68,7 @@ abstract class _$ComponentThemeDataCWProxy {
PortfolioCardComponent? portfolioCard,
QuoteCardComponent? quoteCard,
SkillCardComponent? skillCard,
PricingCardComponent? pricingCard,
FloatingActionButtonComponent? floatingActionButton,
});
}
@ -140,6 +143,10 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy {
ComponentThemeData skillCard(SkillCardComponent? skillCard) =>
this(skillCard: skillCard);
@override
ComponentThemeData pricingCard(PricingCardComponent? pricingCard) =>
this(pricingCard: pricingCard);
@override
ComponentThemeData floatingActionButton(
FloatingActionButtonComponent? floatingActionButton) =>
@ -169,6 +176,7 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy {
Object? portfolioCard = const $CopyWithPlaceholder(),
Object? quoteCard = const $CopyWithPlaceholder(),
Object? skillCard = const $CopyWithPlaceholder(),
Object? pricingCard = const $CopyWithPlaceholder(),
Object? floatingActionButton = const $CopyWithPlaceholder(),
}) {
return ComponentThemeData(
@ -232,6 +240,10 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy {
? _value.skillCard
// ignore: cast_nullable_to_non_nullable
: skillCard as SkillCardComponent?,
pricingCard: pricingCard == const $CopyWithPlaceholder()
? _value.pricingCard
// ignore: cast_nullable_to_non_nullable
: pricingCard as PricingCardComponent?,
floatingActionButton: floatingActionButton == const $CopyWithPlaceholder()
? _value.floatingActionButton
// ignore: cast_nullable_to_non_nullable

View File

@ -6,7 +6,7 @@ version: 0.2.1
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=2.19.0 <3.0.0"
dependencies:
flutter: { sdk: flutter }

View File

@ -40,10 +40,10 @@ class Buttons extends DemoPage {
),
),
const Gap(20),
Row(
const Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
children: [
FlatButtons(),
Gap(20),
SymbolButtons(),

View File

@ -30,10 +30,10 @@ class QuoteCards extends StatelessWidget {
style: Theme.of(context).textTheme.titleMedium,
),
const Gap(20),
Row(
const Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: const [
children: [
QuoteCard(
quote:
TextWrapper('Cupidatat reprehenderit aliqua eiusmod Lorem. '

View File

@ -43,9 +43,9 @@ class Loaders extends DemoPage {
radius: 57,
),
const Gap(20),
Row(
const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
children: [
Loader(
stroke: 5,
),

View File

@ -43,7 +43,8 @@ class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
final brightness = WidgetsBinding.instance.window.platformBrightness;
final brightness =
WidgetsBinding.instance.platformDispatcher.platformBrightness;
return BlocProvider(
create: (context) => AppModeCubit(
theme: defaultTheme,

View File

@ -117,9 +117,9 @@ class PricingCardTitles extends StatelessWidget {
WidgetSpan(
child: Transform.translate(
offset: const Offset(5, -15),
child: const Text(
child: Text(
'* ',
style: TextStyle(fontSize: 18),
style: titleStyle?.copyWith(fontSize: 18),
),
),
),

View File

@ -29,6 +29,17 @@ class RichTextBuilder extends RichTextBuilderComponent
super.parser,
super.defaultStyle,
super.styles,
super.strutStyle,
super.textAlign,
super.textDirection,
super.locale,
super.softWrap,
super.overflow,
super.textScaleFactor,
super.maxLines,
super.semanticsLabel,
super.textWidthBasis,
super.selectionColor,
super.key,
});
@ -91,6 +102,17 @@ class RichTextBuilder extends RichTextBuilderComponent
TextSpan(children: [root.toInlineSpan(customParser)]),
textHeightBehavior:
const TextHeightBehavior(applyHeightToLastDescent: false),
strutStyle: super.strutStyle,
textAlign: super.textAlign,
textDirection: super.textDirection,
locale: super.locale,
softWrap: super.softWrap,
overflow: super.overflow,
textScaleFactor: super.textScaleFactor,
maxLines: super.maxLines,
semanticsLabel: super.semanticsLabel,
textWidthBasis: super.textWidthBasis,
selectionColor: super.selectionColor,
);
}
}

View File

@ -20,6 +20,34 @@ class $RichTextBuilderCWProxyImpl implements $RichTextBuilderComponentCWProxy {
RichTextBuilder styles(Map<String, TextStyle>? styles) =>
this(styles: styles);
@override
RichTextBuilder strutStyle(StrutStyle? strutStyle) =>
this(strutStyle: strutStyle);
@override
RichTextBuilder textAlign(TextAlign? textAlign) => this(textAlign: textAlign);
@override
RichTextBuilder textDirection(TextDirection? textDirection) =>
this(textDirection: textDirection);
@override
RichTextBuilder locale(Locale? locale) => this(locale: locale);
@override
RichTextBuilder softWrap(bool? softWrap) => this(softWrap: softWrap);
@override
RichTextBuilder overflow(TextOverflow? overflow) => this(overflow: overflow);
@override
RichTextBuilder textScaleFactor(double? textScaleFactor) =>
this(textScaleFactor: textScaleFactor);
@override
RichTextBuilder maxLines(int? maxLines) => this(maxLines: maxLines);
@override
RichTextBuilder semanticsLabel(String? semanticsLabel) =>
this(semanticsLabel: semanticsLabel);
@override
RichTextBuilder textWidthBasis(TextWidthBasis? textWidthBasis) =>
this(textWidthBasis: textWidthBasis);
@override
RichTextBuilder selectionColor(Color? selectionColor) =>
this(selectionColor: selectionColor);
@override
RichTextBuilder key(Key? key) => this(key: key);
@override
RichTextBuilder call({
@ -27,6 +55,17 @@ class $RichTextBuilderCWProxyImpl implements $RichTextBuilderComponentCWProxy {
RichTextParser? parser,
TextStyle? defaultStyle,
Map<String, TextStyle>? styles,
StrutStyle? strutStyle,
TextAlign? textAlign,
TextDirection? textDirection,
Locale? locale,
bool? softWrap,
TextOverflow? overflow,
double? textScaleFactor,
int? maxLines,
String? semanticsLabel,
TextWidthBasis? textWidthBasis,
Color? selectionColor,
Key? key,
}) =>
RichTextBuilder(
@ -34,6 +73,17 @@ class $RichTextBuilderCWProxyImpl implements $RichTextBuilderComponentCWProxy {
parser: parser ?? _value.parser,
defaultStyle: defaultStyle ?? _value.defaultStyle,
styles: styles ?? _value.styles,
strutStyle: strutStyle ?? _value.strutStyle,
textAlign: textAlign ?? _value.textAlign,
textDirection: textDirection ?? _value.textDirection,
locale: locale ?? _value.locale,
softWrap: softWrap ?? _value.softWrap,
overflow: overflow ?? _value.overflow,
textScaleFactor: textScaleFactor ?? _value.textScaleFactor,
maxLines: maxLines ?? _value.maxLines,
semanticsLabel: semanticsLabel ?? _value.semanticsLabel,
textWidthBasis: textWidthBasis ?? _value.textWidthBasis,
selectionColor: selectionColor ?? _value.selectionColor,
key: key ?? _value.key,
);
}

View File

@ -77,7 +77,7 @@ class CardThemeExtensionImpl extends CardThemeExtension {
radius: const BorderRadius.all(Radius.circular(12)),
padding: const EdgeInsets.all(25),
stroke: 1,
backgroundColors: WyattColors.grayBgOpacityGradient,
backgroundColors: MultiColor.single(WyattColors.light.withOpacity(0.04)),
borderColors: WyattColors.grayGradient,
titleStyle: theme.textTheme.titleLarge?.copyWith(
fontSize: 26,

View File

@ -17,6 +17,7 @@
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
import 'package:wyatt_ui_kit/src/components/gradients/gradient_text_style.dart';
import 'package:wyatt_ui_kit/src/core/design_system/colors.dart';
class RichTextBuilderThemeExtensionImpl extends RichTextBuilderThemeExtension {
const RichTextBuilderThemeExtensionImpl({
@ -52,54 +53,131 @@ class RichTextBuilderThemeExtensionImpl extends RichTextBuilderThemeExtension {
fontWeight: FontWeight.w600,
height: 1.8,
),
const MultiColor([
Color(0xFF3C97FB),
Color(0xFF436EF4),
]),
WyattColors.blueGradient,
),
'gradient-dark-blue': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
WyattColors.darkBlueGradient,
),
'gradient-gray': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
WyattColors.grayGradient,
),
'gradient-light-gray': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
WyattColors.lightGrayGradient,
),
'gradient-light': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
WyattColors.lightGradient,
),
'gradient-purple': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
WyattColors.purpleGradient,
),
'gradient-red': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
const MultiColor([
Color(0xFFF44464),
Color(0xFFF44464),
]),
WyattColors.redGradient,
),
'gradient-yellow': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
WyattColors.yellowGradient,
),
'gradient-green': GradientTextStyle.from(
theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
height: 1.8,
),
const MultiColor([
Color(0xFF00D16C),
Color(0xFF00D16C),
]),
WyattColors.greenGradient,
),
'blue': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: const Color(0xFF3C97FB),
color: WyattColors.blue1,
height: 1.8,
) ??
const TextStyle(
color: Color(0xFF3C97FB),
color: WyattColors.blue1,
),
'red': theme.textTheme.bodyMedium?.copyWith(
'dark-blue': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: const Color(0xFFF44464),
color: WyattColors.darkBlue1,
height: 1.8,
) ??
const TextStyle(
color: Color(0xFFF44464),
color: WyattColors.darkBlue1,
),
'gray': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: WyattColors.gray1,
height: 1.8,
) ??
const TextStyle(
color: WyattColors.gray1,
),
'green': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: const Color(0xFF00D16C),
color: WyattColors.green1,
height: 1.8,
) ??
const TextStyle(
color: Color(0xFF00D16C),
color: WyattColors.green1,
),
'light': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: WyattColors.light,
height: 1.8,
) ??
const TextStyle(
color: WyattColors.light,
),
'light-gray': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: WyattColors.lightGray1,
height: 1.8,
) ??
const TextStyle(
color: WyattColors.lightGray1,
),
'purple': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: WyattColors.purple1,
height: 1.8,
) ??
const TextStyle(
color: WyattColors.purple1,
),
'red': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: WyattColors.red1,
height: 1.8,
) ??
const TextStyle(color: WyattColors.red1),
'yellow': theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: WyattColors.yellow1,
height: 1.8,
) ??
const TextStyle(color: WyattColors.yellow1),
};
}

View File

@ -35,7 +35,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
normalStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(221, 224, 227, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(55, 65, 81, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(
@ -45,7 +45,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
focusedStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(60, 125, 251, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(55, 65, 81, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(
@ -55,7 +55,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
invalidStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(244, 68, 100, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(244, 68, 100, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(
@ -65,7 +65,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
disabledStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(229, 231, 235, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(156, 163, 175, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(
@ -81,7 +81,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
normalStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(96, 101, 106, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(204, 204, 204, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(
@ -91,7 +91,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
focusedStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(60, 125, 251, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(204, 204, 204, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(
@ -101,7 +101,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
invalidStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(244, 68, 100, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(244, 68, 100, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(
@ -111,7 +111,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
disabledStyle: TextInputStyle(
radius: BorderRadius.circular(12),
borderColors: const Color.fromRGBO(96, 101, 106, 1),
labelStyle: theme.textTheme.labelLarge?.copyWith(
labelStyle: theme.textTheme.labelMedium?.copyWith(
color: const Color.fromRGBO(96, 101, 106, 1),
),
inputStyle: theme.textTheme.bodyMedium?.copyWith(

View File

@ -39,5 +39,6 @@ abstract class WyattComponentThemeData {
portfolioCard: PortfolioCard(),
quoteCard: QuoteCard(),
skillCard: SkillCard(),
pricingCard: PricingCard(),
);
}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export './scaffold_fields_wrapper.dart';

View File

@ -0,0 +1,244 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
class ScaffoldFieldsWrapper {
ScaffoldFieldsWrapper({
this.extendBody,
this.extendBodyBehindAppBar,
this.floatingActionButtonLocation,
this.floatingActionButtonAnimator,
this.persistentFooterButtons,
this.persistentFooterAlignment,
this.drawer,
this.onDrawerChanged,
this.endDrawer,
this.onEndDrawerChanged,
this.drawerScrimColor,
this.backgroundColor,
this.bottomSheet,
this.resizeToAvoidBottomInset,
this.primary,
this.drawerDragStartBehavior,
this.drawerEdgeDragWidth,
this.drawerEnableOpenDragGesture,
this.endDrawerEnableOpenDragGesture,
this.restorationId,
});
final bool? extendBody;
/// If true, and an appBar is specified, then the height of the body is
/// extended to include the height of the app bar and the top of the body
/// is aligned with the top of the app bar.
///
/// This is useful if the app bar's [AppBar.backgroundColor] is not
/// completely opaque.
///
/// This property is false by default. It must not be null.
///
/// See also:
///
/// * [extendBody], which extends the height of the body to the bottom
/// of the scaffold.
final bool? extendBodyBehindAppBar;
/// Responsible for determining where the floatingActionButton should go.
///
/// If null, the [ScaffoldState] will use
/// the default location, [FloatingActionButtonLocation.endFloat].
final FloatingActionButtonLocation? floatingActionButtonLocation;
/// Animator to move the floatingActionButton to a
/// new [floatingActionButtonLocation].
///
/// If null, the [ScaffoldState] will use the default animator,
/// [FloatingActionButtonAnimator.scaling].
final FloatingActionButtonAnimator? floatingActionButtonAnimator;
/// A set of buttons that are displayed at the bottom of the scaffold.
///
/// Typically this is a list of [TextButton] widgets. These buttons are
/// persistently visible, even if the body of the scaffold scrolls.
///
/// These widgets will be wrapped in an [OverflowBar].
///
/// The [persistentFooterButtons] are rendered above the
/// bottomNavigationBar but below the body.
final List<Widget>? persistentFooterButtons;
/// The alignment of the [persistentFooterButtons] inside the [OverflowBar].
///
/// Defaults to [AlignmentDirectional.centerEnd].
final AlignmentDirectional? persistentFooterAlignment;
/// A panel displayed to the side of the body, often hidden on mobile
/// devices. Swipes in from either left-to-right ([TextDirection.ltr]) or
/// right-to-left ([TextDirection.rtl])
///
/// Typically a [Drawer].
///
/// To open the drawer, use the [ScaffoldState.openDrawer] function.
///
/// To close the drawer, use either [ScaffoldState.closeDrawer],
/// [Navigator.pop] or press the escape key on the keyboard.
///
/// {@tool dartpad}
/// To disable the drawer edge swipe on mobile, set the
/// [Scaffold.drawerEnableOpenDragGesture] to false. Then, use
/// [ScaffoldState.openDrawer] to open the drawer and [Navigator.pop] to close
/// it.
///
/// ** See code in examples/api/lib/material/scaffold/scaffold.drawer.0.dart **
/// {@end-tool}
final Widget? drawer;
/// Optional callback that is called when the [Scaffold.drawer]
/// is opened or closed.
final DrawerCallback? onDrawerChanged;
/// A panel displayed to the side of the body, often hidden on mobile
/// devices. Swipes in from right-to-left ([TextDirection.ltr]) or
/// left-to-right ([TextDirection.rtl])
///
/// Typically a [Drawer].
///
/// To open the drawer, use the [ScaffoldState.openEndDrawer] function.
///
/// To close the drawer, use either [ScaffoldState.closeEndDrawer],
/// [Navigator.pop]
/// or press the escape key on the keyboard.
///
/// {@tool dartpad}
/// To disable the drawer edge swipe, set the
/// [Scaffold.endDrawerEnableOpenDragGesture] to false. Then, use
/// [ScaffoldState.openEndDrawer] to open the drawer and [Navigator.pop] to
/// close it.
///
/// ** See code in examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart **
/// {@end-tool}
final Widget? endDrawer;
/// Optional callback that is called when the [Scaffold.endDrawer]
/// is opened or closed.
final DrawerCallback? onEndDrawerChanged;
/// The color to use for the scrim that obscures primary content while
/// a drawer is open.
///
/// If this is null, then [DrawerThemeData.scrimColor] is used. If that
/// is also null, then it defaults to [Colors.black54].
final Color? drawerScrimColor;
/// The color of the [Material] widget that underlies the entire Scaffold.
///
/// The theme's [ThemeData.scaffoldBackgroundColor] by default.
final Color? backgroundColor;
/// The persistent bottom sheet to display.
///
/// A persistent bottom sheet shows information that supplements the primary
/// content of the app. A persistent bottom sheet remains visible even when
/// the user interacts with other parts of the app.
///
/// A closely related widget is a modal bottom sheet, which is an alternative
/// to a menu or a dialog and prevents the user from interacting with the rest
/// of the app. Modal bottom sheets can be created and displayed with the
/// [showModalBottomSheet] function.
///
/// Unlike the persistent bottom sheet displayed by [showBottomSheet]
/// this bottom sheet is not a [LocalHistoryEntry] and cannot be dismissed
/// with the scaffold appbar's back button.
///
/// If a persistent bottom sheet created with [showBottomSheet] is already
/// visible, it must be closed before building the Scaffold with a new
/// [bottomSheet].
///
/// The value of [bottomSheet] can be any widget at all. It's unlikely to
/// actually be a [BottomSheet], which is used by the implementations of
/// [showBottomSheet] and [showModalBottomSheet]. Typically it's a widget
/// that includes [Material].
///
/// See also:
///
/// * [showBottomSheet], which displays a bottom sheet as a route that can
/// be dismissed with the scaffold's back button.
/// * [showModalBottomSheet], which displays a modal bottom sheet.
/// * [BottomSheetThemeData], which can be used to customize the default
/// bottom sheet property values when using a [BottomSheet].
final Widget? bottomSheet;
/// If true the body and the scaffold's floating widgets should size
/// themselves to avoid the onscreen keyboard whose height is defined by the
/// ambient [MediaQuery]'s [MediaQueryData.viewInsets] `bottom` property.
///
/// For example, if there is an onscreen keyboard displayed above the
/// scaffold, the body can be resized to avoid overlapping the keyboard, which
/// prevents widgets inside the body from being obscured by the keyboard.
///
/// Defaults to true.
final bool? resizeToAvoidBottomInset;
/// Whether this scaffold is being displayed at the top of the screen.
///
/// If true then the height of the appBar will be extended by the height
/// of the screen's status bar, i.e. the top padding for [MediaQuery].
///
/// The default value of this property, like the default value of
/// [AppBar.primary], is true.
final bool? primary;
/// {@macro flutter.material.DrawerController.dragStartBehavior}
final DragStartBehavior? drawerDragStartBehavior;
/// The width of the area within which a horizontal swipe will open the
/// drawer.
///
/// By default, the value used is 20.0 added to the padding edge of
/// `MediaQuery.of(context).padding` that corresponds to the surrounding
/// [TextDirection]. This ensures that the drag area for notched devices is
/// not obscured. For example, if `TextDirection.of(context)` is set to
/// [TextDirection.ltr], 20.0 will be added to
/// `MediaQuery.of(context).padding.left`.
final double? drawerEdgeDragWidth;
/// Determines if the [Scaffold.drawer] can be opened with a drag
/// gesture on mobile.
///
/// On desktop platforms, the drawer is not draggable.
///
/// By default, the drag gesture is enabled on mobile.
final bool? drawerEnableOpenDragGesture;
/// Determines if the [Scaffold.endDrawer] can be opened with a
/// gesture on mobile.
///
/// On desktop platforms, the drawer is not draggable.
///
/// By default, the drag gesture is enabled on mobile.
final bool? endDrawerEnableOpenDragGesture;
/// Restoration ID to save and restore the state of the [Scaffold].
///
/// If it is non-null, the scaffold will persist and restore whether the
/// [drawer] and [endDrawer] was open or closed.
///
/// The state of this widget is persisted in a [RestorationBucket] claimed
/// from the surrounding [RestorationScope] using the provided restoration ID.
final String? restorationId;
}

View File

@ -14,8 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
import 'package:wyatt_ui_layout/src/core/scaffold_fields_wrapper.dart';
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
/// {@template bottom_navigation_bar_layout}
@ -27,6 +29,7 @@ class BottomNavigationBarLayout extends StructuralLayout {
const BottomNavigationBarLayout({
required this.body,
this.custom,
this.scaffoldFieldsWrapper,
super.key,
});
@ -38,6 +41,8 @@ class BottomNavigationBarLayout extends StructuralLayout {
final BottomNavigationBarComponent? Function(BottomNavigationBarComponent?)?
custom;
final ScaffoldFieldsWrapper? scaffoldFieldsWrapper;
@override
Widget build(BuildContext context) => Scaffold(
body: body,
@ -45,5 +50,35 @@ class BottomNavigationBarLayout extends StructuralLayout {
context.components.bottomNavigationBar,
) ??
context.components.bottomNavigationBar,
floatingActionButtonLocation:
scaffoldFieldsWrapper?.floatingActionButtonLocation,
floatingActionButtonAnimator:
scaffoldFieldsWrapper?.floatingActionButtonAnimator,
persistentFooterButtons: scaffoldFieldsWrapper?.persistentFooterButtons,
persistentFooterAlignment:
scaffoldFieldsWrapper?.persistentFooterAlignment ??
AlignmentDirectional.centerEnd,
drawer: scaffoldFieldsWrapper?.drawer,
onDrawerChanged: scaffoldFieldsWrapper?.onDrawerChanged,
endDrawer: scaffoldFieldsWrapper?.endDrawer,
onEndDrawerChanged: scaffoldFieldsWrapper?.onEndDrawerChanged,
bottomSheet: scaffoldFieldsWrapper?.bottomSheet,
backgroundColor: scaffoldFieldsWrapper?.backgroundColor,
resizeToAvoidBottomInset:
scaffoldFieldsWrapper?.resizeToAvoidBottomInset,
primary: scaffoldFieldsWrapper?.primary ?? true,
drawerDragStartBehavior:
scaffoldFieldsWrapper?.drawerDragStartBehavior ??
DragStartBehavior.start,
extendBody: scaffoldFieldsWrapper?.extendBody ?? false,
extendBodyBehindAppBar:
scaffoldFieldsWrapper?.extendBodyBehindAppBar ?? false,
drawerScrimColor: scaffoldFieldsWrapper?.drawerScrimColor,
drawerEdgeDragWidth: scaffoldFieldsWrapper?.drawerEdgeDragWidth,
drawerEnableOpenDragGesture:
scaffoldFieldsWrapper?.drawerEnableOpenDragGesture ?? true,
endDrawerEnableOpenDragGesture:
scaffoldFieldsWrapper?.endDrawerEnableOpenDragGesture ?? true,
restorationId: scaffoldFieldsWrapper?.restorationId,
);
}

View File

@ -14,8 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
import 'package:wyatt_ui_layout/src/core/scaffold_fields_wrapper.dart';
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
/// {@template frame_layout}
@ -33,7 +35,9 @@ class FrameLayout extends StructuralLayout {
required this.body,
this.customAppBar,
this.customBottomNavBar,
this.customFloatingActionButton,
this.height = 60,
this.scaffoldFieldsWrapper,
super.key,
});
@ -44,12 +48,19 @@ class FrameLayout extends StructuralLayout {
final BottomNavigationBarComponent? Function(BottomNavigationBarComponent?)?
customBottomNavBar;
/// An optional function that can be used to customize the
/// floating action button
final FloatingActionButtonComponent? Function(FloatingActionButtonComponent?)?
customFloatingActionButton;
/// The main content of the layout.
final Widget body;
/// The height of the top app bar.
final double height;
final ScaffoldFieldsWrapper? scaffoldFieldsWrapper;
@override
Widget build(BuildContext context) => Scaffold(
appBar: (customAppBar?.call(context.components.topAppBar) != null ||
@ -60,9 +71,42 @@ class FrameLayout extends StructuralLayout {
context.components.topAppBar!,
)
: null,
body: body,
floatingActionButton: customFloatingActionButton
?.call(context.components.floatingActionButton) ??
context.components.floatingActionButton,
bottomNavigationBar:
customBottomNavBar?.call(context.components.bottomNavigationBar) ??
context.components.bottomNavigationBar,
body: body,
floatingActionButtonLocation:
scaffoldFieldsWrapper?.floatingActionButtonLocation,
floatingActionButtonAnimator:
scaffoldFieldsWrapper?.floatingActionButtonAnimator,
persistentFooterButtons: scaffoldFieldsWrapper?.persistentFooterButtons,
persistentFooterAlignment:
scaffoldFieldsWrapper?.persistentFooterAlignment ??
AlignmentDirectional.centerEnd,
drawer: scaffoldFieldsWrapper?.drawer,
onDrawerChanged: scaffoldFieldsWrapper?.onDrawerChanged,
endDrawer: scaffoldFieldsWrapper?.endDrawer,
onEndDrawerChanged: scaffoldFieldsWrapper?.onEndDrawerChanged,
bottomSheet: scaffoldFieldsWrapper?.bottomSheet,
backgroundColor: scaffoldFieldsWrapper?.backgroundColor,
resizeToAvoidBottomInset:
scaffoldFieldsWrapper?.resizeToAvoidBottomInset,
primary: scaffoldFieldsWrapper?.primary ?? true,
drawerDragStartBehavior:
scaffoldFieldsWrapper?.drawerDragStartBehavior ??
DragStartBehavior.start,
extendBody: scaffoldFieldsWrapper?.extendBody ?? false,
extendBodyBehindAppBar:
scaffoldFieldsWrapper?.extendBodyBehindAppBar ?? false,
drawerScrimColor: scaffoldFieldsWrapper?.drawerScrimColor,
drawerEdgeDragWidth: scaffoldFieldsWrapper?.drawerEdgeDragWidth,
drawerEnableOpenDragGesture:
scaffoldFieldsWrapper?.drawerEnableOpenDragGesture ?? true,
endDrawerEnableOpenDragGesture:
scaffoldFieldsWrapper?.endDrawerEnableOpenDragGesture ?? true,
restorationId: scaffoldFieldsWrapper?.restorationId,
);
}

View File

@ -14,8 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
import 'package:wyatt_ui_layout/src/core/scaffold_fields_wrapper.dart';
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
/// {@template top_bar_layout}
@ -37,6 +39,7 @@ abstract class TopBarLayout<T extends TopBarComponent>
required this.body,
this.custom,
this.height = 60,
this.scaffoldFieldsWrapper,
super.key,
});
@ -54,6 +57,8 @@ abstract class TopBarLayout<T extends TopBarComponent>
/// Returns the top bar component for the given [BuildContext].
T? child(BuildContext context);
final ScaffoldFieldsWrapper? scaffoldFieldsWrapper;
@override
Widget build(BuildContext context) => Scaffold(
appBar: (custom?.call(child(context)) != null || child(context) != null)
@ -63,6 +68,36 @@ abstract class TopBarLayout<T extends TopBarComponent>
)
: null,
body: body,
floatingActionButtonLocation:
scaffoldFieldsWrapper?.floatingActionButtonLocation,
floatingActionButtonAnimator:
scaffoldFieldsWrapper?.floatingActionButtonAnimator,
persistentFooterButtons: scaffoldFieldsWrapper?.persistentFooterButtons,
persistentFooterAlignment:
scaffoldFieldsWrapper?.persistentFooterAlignment ??
AlignmentDirectional.centerEnd,
drawer: scaffoldFieldsWrapper?.drawer,
onDrawerChanged: scaffoldFieldsWrapper?.onDrawerChanged,
endDrawer: scaffoldFieldsWrapper?.endDrawer,
onEndDrawerChanged: scaffoldFieldsWrapper?.onEndDrawerChanged,
bottomSheet: scaffoldFieldsWrapper?.bottomSheet,
backgroundColor: scaffoldFieldsWrapper?.backgroundColor,
resizeToAvoidBottomInset:
scaffoldFieldsWrapper?.resizeToAvoidBottomInset,
primary: scaffoldFieldsWrapper?.primary ?? true,
drawerDragStartBehavior:
scaffoldFieldsWrapper?.drawerDragStartBehavior ??
DragStartBehavior.start,
extendBody: scaffoldFieldsWrapper?.extendBody ?? false,
extendBodyBehindAppBar:
scaffoldFieldsWrapper?.extendBodyBehindAppBar ?? false,
drawerScrimColor: scaffoldFieldsWrapper?.drawerScrimColor,
drawerEdgeDragWidth: scaffoldFieldsWrapper?.drawerEdgeDragWidth,
drawerEnableOpenDragGesture:
scaffoldFieldsWrapper?.drawerEnableOpenDragGesture ?? true,
endDrawerEnableOpenDragGesture:
scaffoldFieldsWrapper?.endDrawerEnableOpenDragGesture ?? true,
restorationId: scaffoldFieldsWrapper?.restorationId,
);
}

View File

@ -14,4 +14,5 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export 'presentation/presentation.dart';
export './core/core.dart';
export './presentation/presentation.dart';