Compare commits
9 Commits
9713d1ec29
...
a078f6b6b0
Author | SHA1 | Date | |
---|---|---|---|
a078f6b6b0 | |||
fd40d1be3d | |||
952d3f8539 | |||
5de3dbd5b3 | |||
874d85f29c | |||
a82d28a6d5 | |||
80135a611d | |||
93873e3134 | |||
553b6763af |
@ -584,7 +584,6 @@ new_version.sh
|
|||||||
.latest_version
|
.latest_version
|
||||||
.vscode/
|
.vscode/
|
||||||
example/
|
example/
|
||||||
models/
|
|
||||||
build/
|
build/
|
||||||
*.iml
|
*.iml
|
||||||
|
|
||||||
|
21
CHANGELOG.md
21
CHANGELOG.md
@ -3,6 +3,27 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## 2023-05-06
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- There are no breaking changes in this release.
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_authentication_bloc` - `v0.5.0+1`](#wyatt_authentication_bloc---v0501)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_authentication_bloc` - `v0.5.0+1`
|
||||||
|
|
||||||
|
- **REFACTOR**(authentication): controle cache checking.
|
||||||
|
|
||||||
|
|
||||||
## 2023-05-04
|
## 2023-05-04
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
## 0.5.0+1
|
||||||
|
|
||||||
|
- **REFACTOR**(authentication): controle cache checking.
|
||||||
|
|
||||||
## 0.5.0
|
## 0.5.0
|
||||||
|
|
||||||
> Note: This release has breaking changes.
|
> Note: This release has breaking changes.
|
||||||
|
@ -40,6 +40,7 @@ abstract class AuthenticationCubit<Data>
|
|||||||
/// {@macro authentication_cubit}
|
/// {@macro authentication_cubit}
|
||||||
AuthenticationCubit({
|
AuthenticationCubit({
|
||||||
required this.authenticationRepository,
|
required this.authenticationRepository,
|
||||||
|
this.checkForCachedAccountOnInitialization = true,
|
||||||
}) : super(const AuthenticationState.unknown()) {
|
}) : super(const AuthenticationState.unknown()) {
|
||||||
_init();
|
_init();
|
||||||
}
|
}
|
||||||
@ -47,6 +48,9 @@ abstract class AuthenticationCubit<Data>
|
|||||||
/// The authentication repository.
|
/// The authentication repository.
|
||||||
final AuthenticationRepository<Data> authenticationRepository;
|
final AuthenticationRepository<Data> authenticationRepository;
|
||||||
|
|
||||||
|
/// Automatically check for cached account on initialization.
|
||||||
|
final bool checkForCachedAccountOnInitialization;
|
||||||
|
|
||||||
/// The latest session.
|
/// The latest session.
|
||||||
AuthenticationSession<Data>? _latestSession;
|
AuthenticationSession<Data>? _latestSession;
|
||||||
|
|
||||||
@ -56,7 +60,9 @@ abstract class AuthenticationCubit<Data>
|
|||||||
_listenForAuthenticationChanges();
|
_listenForAuthenticationChanges();
|
||||||
|
|
||||||
/// Check if there is a cached account.
|
/// Check if there is a cached account.
|
||||||
await authenticationRepository.checkForCachedAccount();
|
if (checkForCachedAccountOnInitialization) {
|
||||||
|
await checkForCachedAccount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _listenForAuthenticationChanges() {
|
void _listenForAuthenticationChanges() {
|
||||||
@ -148,6 +154,10 @@ abstract class AuthenticationCubit<Data>
|
|||||||
),
|
),
|
||||||
).call();
|
).call();
|
||||||
|
|
||||||
|
/// Checks for cached account.
|
||||||
|
FutureOr<void> checkForCachedAccount() async =>
|
||||||
|
authenticationRepository.checkForCachedAccount();
|
||||||
|
|
||||||
/// Returns latest session.
|
/// Returns latest session.
|
||||||
///
|
///
|
||||||
/// Contains latest event and latest session data (account + extra data)
|
/// Contains latest event and latest session data (account + extra data)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: wyatt_authentication_bloc
|
name: wyatt_authentication_bloc
|
||||||
description: Authentication BLoC for Flutter
|
description: Authentication BLoC for Flutter
|
||||||
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_authentication_bloc
|
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_authentication_bloc
|
||||||
version: 0.5.0
|
version: 0.5.0+1
|
||||||
|
|
||||||
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ dependencies:
|
|||||||
flutter_bloc: ^8.1.2
|
flutter_bloc: ^8.1.2
|
||||||
flutter_localizations: { sdk: flutter }
|
flutter_localizations: { sdk: flutter }
|
||||||
http: ^0.13.5
|
http: ^0.13.5
|
||||||
intl: ^0.17.0
|
intl: ^0.18.0
|
||||||
path: ^1.8.0
|
path: ^1.8.0
|
||||||
petitparser: ^5.1.0
|
petitparser: ^5.1.0
|
||||||
wyatt_architecture:
|
wyatt_architecture:
|
||||||
|
@ -28,6 +28,17 @@ abstract class RichTextBuilderComponent extends Component
|
|||||||
this.parser,
|
this.parser,
|
||||||
this.defaultStyle,
|
this.defaultStyle,
|
||||||
this.styles,
|
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,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -52,4 +63,83 @@ abstract class RichTextBuilderComponent extends Component
|
|||||||
/// ```
|
/// ```
|
||||||
/// in "This text `is red`."
|
/// in "This text `is red`."
|
||||||
final Map<String, TextStyle>? styles;
|
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;
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,34 @@ abstract class $RichTextBuilderComponentCWProxy {
|
|||||||
RichTextBuilderComponent parser(RichTextParser? parser);
|
RichTextBuilderComponent parser(RichTextParser? parser);
|
||||||
RichTextBuilderComponent defaultStyle(TextStyle? defaultStyle);
|
RichTextBuilderComponent defaultStyle(TextStyle? defaultStyle);
|
||||||
RichTextBuilderComponent styles(Map<String, TextStyle>? styles);
|
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 key(Key? key);
|
||||||
RichTextBuilderComponent call({
|
RichTextBuilderComponent call({
|
||||||
String? text,
|
String? text,
|
||||||
RichTextParser? parser,
|
RichTextParser? parser,
|
||||||
TextStyle? defaultStyle,
|
TextStyle? defaultStyle,
|
||||||
Map<String, TextStyle>? styles,
|
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,
|
Key? key,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ version: 0.2.1
|
|||||||
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.0 <3.0.0"
|
sdk: ">=2.19.0 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter: { sdk: flutter }
|
flutter: { sdk: flutter }
|
||||||
|
@ -40,10 +40,10 @@ class Buttons extends DemoPage {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(20),
|
const Gap(20),
|
||||||
Row(
|
const Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: const [
|
children: [
|
||||||
FlatButtons(),
|
FlatButtons(),
|
||||||
Gap(20),
|
Gap(20),
|
||||||
SymbolButtons(),
|
SymbolButtons(),
|
||||||
|
@ -30,10 +30,10 @@ class QuoteCards extends StatelessWidget {
|
|||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
),
|
),
|
||||||
const Gap(20),
|
const Gap(20),
|
||||||
Row(
|
const Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: const [
|
children: [
|
||||||
QuoteCard(
|
QuoteCard(
|
||||||
quote:
|
quote:
|
||||||
TextWrapper('Cupidatat reprehenderit aliqua eiusmod Lorem. '
|
TextWrapper('Cupidatat reprehenderit aliqua eiusmod Lorem. '
|
||||||
|
@ -43,9 +43,9 @@ class Loaders extends DemoPage {
|
|||||||
radius: 57,
|
radius: 57,
|
||||||
),
|
),
|
||||||
const Gap(20),
|
const Gap(20),
|
||||||
Row(
|
const Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: const [
|
children: [
|
||||||
Loader(
|
Loader(
|
||||||
stroke: 5,
|
stroke: 5,
|
||||||
),
|
),
|
||||||
|
@ -43,7 +43,8 @@ class App extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final brightness = WidgetsBinding.instance.window.platformBrightness;
|
final brightness =
|
||||||
|
WidgetsBinding.instance.platformDispatcher.platformBrightness;
|
||||||
return BlocProvider(
|
return BlocProvider(
|
||||||
create: (context) => AppModeCubit(
|
create: (context) => AppModeCubit(
|
||||||
theme: defaultTheme,
|
theme: defaultTheme,
|
||||||
|
@ -29,6 +29,17 @@ class RichTextBuilder extends RichTextBuilderComponent
|
|||||||
super.parser,
|
super.parser,
|
||||||
super.defaultStyle,
|
super.defaultStyle,
|
||||||
super.styles,
|
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,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -91,6 +102,17 @@ class RichTextBuilder extends RichTextBuilderComponent
|
|||||||
TextSpan(children: [root.toInlineSpan(customParser)]),
|
TextSpan(children: [root.toInlineSpan(customParser)]),
|
||||||
textHeightBehavior:
|
textHeightBehavior:
|
||||||
const TextHeightBehavior(applyHeightToLastDescent: false),
|
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,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,34 @@ class $RichTextBuilderCWProxyImpl implements $RichTextBuilderComponentCWProxy {
|
|||||||
RichTextBuilder styles(Map<String, TextStyle>? styles) =>
|
RichTextBuilder styles(Map<String, TextStyle>? styles) =>
|
||||||
this(styles: styles);
|
this(styles: styles);
|
||||||
@override
|
@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);
|
RichTextBuilder key(Key? key) => this(key: key);
|
||||||
@override
|
@override
|
||||||
RichTextBuilder call({
|
RichTextBuilder call({
|
||||||
@ -27,6 +55,17 @@ class $RichTextBuilderCWProxyImpl implements $RichTextBuilderComponentCWProxy {
|
|||||||
RichTextParser? parser,
|
RichTextParser? parser,
|
||||||
TextStyle? defaultStyle,
|
TextStyle? defaultStyle,
|
||||||
Map<String, TextStyle>? styles,
|
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,
|
Key? key,
|
||||||
}) =>
|
}) =>
|
||||||
RichTextBuilder(
|
RichTextBuilder(
|
||||||
@ -34,6 +73,17 @@ class $RichTextBuilderCWProxyImpl implements $RichTextBuilderComponentCWProxy {
|
|||||||
parser: parser ?? _value.parser,
|
parser: parser ?? _value.parser,
|
||||||
defaultStyle: defaultStyle ?? _value.defaultStyle,
|
defaultStyle: defaultStyle ?? _value.defaultStyle,
|
||||||
styles: styles ?? _value.styles,
|
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,
|
key: key ?? _value.key,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class CardThemeExtensionImpl extends CardThemeExtension {
|
|||||||
radius: const BorderRadius.all(Radius.circular(12)),
|
radius: const BorderRadius.all(Radius.circular(12)),
|
||||||
padding: const EdgeInsets.all(25),
|
padding: const EdgeInsets.all(25),
|
||||||
stroke: 1,
|
stroke: 1,
|
||||||
backgroundColors: WyattColors.grayBgOpacityGradient,
|
backgroundColors: MultiColor.single(WyattColors.light.withOpacity(0.04)),
|
||||||
borderColors: WyattColors.grayGradient,
|
borderColors: WyattColors.grayGradient,
|
||||||
titleStyle: theme.textTheme.titleLarge?.copyWith(
|
titleStyle: theme.textTheme.titleLarge?.copyWith(
|
||||||
fontSize: 26,
|
fontSize: 26,
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:wyatt_ui_components/wyatt_ui_components.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/components/gradients/gradient_text_style.dart';
|
||||||
|
import 'package:wyatt_ui_kit/src/core/design_system/colors.dart';
|
||||||
|
|
||||||
class RichTextBuilderThemeExtensionImpl extends RichTextBuilderThemeExtension {
|
class RichTextBuilderThemeExtensionImpl extends RichTextBuilderThemeExtension {
|
||||||
const RichTextBuilderThemeExtensionImpl({
|
const RichTextBuilderThemeExtensionImpl({
|
||||||
@ -52,54 +53,131 @@ class RichTextBuilderThemeExtensionImpl extends RichTextBuilderThemeExtension {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
),
|
),
|
||||||
const MultiColor([
|
WyattColors.blueGradient,
|
||||||
Color(0xFF3C97FB),
|
),
|
||||||
Color(0xFF436EF4),
|
'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(
|
'gradient-red': GradientTextStyle.from(
|
||||||
theme.textTheme.bodyMedium?.copyWith(
|
theme.textTheme.bodyMedium?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
),
|
),
|
||||||
const MultiColor([
|
WyattColors.redGradient,
|
||||||
Color(0xFFF44464),
|
),
|
||||||
Color(0xFFF44464),
|
'gradient-yellow': GradientTextStyle.from(
|
||||||
]),
|
theme.textTheme.bodyMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
height: 1.8,
|
||||||
|
),
|
||||||
|
WyattColors.yellowGradient,
|
||||||
),
|
),
|
||||||
'gradient-green': GradientTextStyle.from(
|
'gradient-green': GradientTextStyle.from(
|
||||||
theme.textTheme.bodyMedium?.copyWith(
|
theme.textTheme.bodyMedium?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
),
|
),
|
||||||
const MultiColor([
|
WyattColors.greenGradient,
|
||||||
Color(0xFF00D16C),
|
|
||||||
Color(0xFF00D16C),
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
'blue': theme.textTheme.bodyMedium?.copyWith(
|
'blue': theme.textTheme.bodyMedium?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: const Color(0xFF3C97FB),
|
color: WyattColors.blue1,
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
) ??
|
) ??
|
||||||
const TextStyle(
|
const TextStyle(
|
||||||
color: Color(0xFF3C97FB),
|
color: WyattColors.blue1,
|
||||||
),
|
),
|
||||||
'red': theme.textTheme.bodyMedium?.copyWith(
|
'dark-blue': theme.textTheme.bodyMedium?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: const Color(0xFFF44464),
|
color: WyattColors.darkBlue1,
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
) ??
|
) ??
|
||||||
const TextStyle(
|
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(
|
'green': theme.textTheme.bodyMedium?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: const Color(0xFF00D16C),
|
color: WyattColors.green1,
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
) ??
|
) ??
|
||||||
const TextStyle(
|
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),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
normalStyle: TextInputStyle(
|
normalStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(221, 224, 227, 1),
|
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),
|
color: const Color.fromRGBO(55, 65, 81, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
@ -45,7 +45,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
focusedStyle: TextInputStyle(
|
focusedStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(60, 125, 251, 1),
|
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),
|
color: const Color.fromRGBO(55, 65, 81, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
@ -55,7 +55,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
invalidStyle: TextInputStyle(
|
invalidStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(244, 68, 100, 1),
|
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),
|
color: const Color.fromRGBO(244, 68, 100, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
@ -65,7 +65,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
disabledStyle: TextInputStyle(
|
disabledStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(229, 231, 235, 1),
|
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),
|
color: const Color.fromRGBO(156, 163, 175, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
@ -81,7 +81,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
normalStyle: TextInputStyle(
|
normalStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(96, 101, 106, 1),
|
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),
|
color: const Color.fromRGBO(204, 204, 204, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
@ -91,7 +91,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
focusedStyle: TextInputStyle(
|
focusedStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(60, 125, 251, 1),
|
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),
|
color: const Color.fromRGBO(204, 204, 204, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
@ -101,7 +101,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
invalidStyle: TextInputStyle(
|
invalidStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(244, 68, 100, 1),
|
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),
|
color: const Color.fromRGBO(244, 68, 100, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
@ -111,7 +111,7 @@ class TextInputThemeExtensionImpl extends TextInputThemeExtension {
|
|||||||
disabledStyle: TextInputStyle(
|
disabledStyle: TextInputStyle(
|
||||||
radius: BorderRadius.circular(12),
|
radius: BorderRadius.circular(12),
|
||||||
borderColors: const Color.fromRGBO(96, 101, 106, 1),
|
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),
|
color: const Color.fromRGBO(96, 101, 106, 1),
|
||||||
),
|
),
|
||||||
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
inputStyle: theme.textTheme.bodyMedium?.copyWith(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user