mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: use theme.of(context) text theme in shared widgets (#1460)
This commit is contained in:
parent
81bc31d1b1
commit
dc462b3847
@ -1,4 +1,4 @@
|
||||
import 'package:flowy_infra/text_style.dart';
|
||||
import 'package:flowy_infra/color_extension.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/hover.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||
import 'package:flowy_infra_ui/widget/spacing.dart';
|
||||
@ -150,7 +150,7 @@ class FlowyTextButton extends StatelessWidget {
|
||||
if (tooltip != null) {
|
||||
child = Tooltip(
|
||||
message: tooltip!,
|
||||
textStyle: TextStyles.caption.textColor(Colors.white),
|
||||
textStyle: AFThemeExtension.of(context).caption.textColor(Colors.white),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math' as math;
|
||||
import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra/text_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
// ignore: import_of_legacy_library_into_null_safe
|
||||
import 'package:textstyle_extensions/textstyle_extensions.dart';
|
||||
|
||||
class FlowyFormTextInput extends StatelessWidget {
|
||||
@ -51,7 +49,7 @@ class FlowyFormTextInput extends StatelessWidget {
|
||||
initialValue: initialValue,
|
||||
onChanged: onChanged,
|
||||
onFocusCreated: onFocusCreated,
|
||||
style: textStyle ?? TextStyles.body1,
|
||||
style: textStyle ?? Theme.of(context).textTheme.bodyMedium,
|
||||
onEditingComplete: onEditingComplete,
|
||||
onFocusChanged: onFocusChanged,
|
||||
controller: controller,
|
||||
@ -196,7 +194,7 @@ class StyledSearchTextInputState extends State<StyledSearchTextInput> {
|
||||
obscureText: widget.obscureText ?? false,
|
||||
autocorrect: widget.autoCorrect ?? false,
|
||||
enableSuggestions: widget.enableSuggestions ?? false,
|
||||
style: widget.style ?? TextStyles.body1,
|
||||
style: widget.style ?? Theme.of(context).textTheme.bodyMedium,
|
||||
cursorColor: Theme.of(context).colorScheme.primary,
|
||||
controller: _controller,
|
||||
showCursor: true,
|
||||
@ -205,19 +203,21 @@ class StyledSearchTextInputState extends State<StyledSearchTextInput> {
|
||||
textCapitalization: widget.capitalization ?? TextCapitalization.none,
|
||||
decoration: widget.inputDecoration ??
|
||||
InputDecoration(
|
||||
prefixIcon: widget.prefixIcon,
|
||||
suffixIcon: widget.suffixIcon,
|
||||
contentPadding:
|
||||
widget.contentPadding ?? EdgeInsets.all(Insets.m),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide.none),
|
||||
isDense: true,
|
||||
icon: widget.icon == null ? null : Icon(widget.icon),
|
||||
errorText: widget.errorText,
|
||||
errorMaxLines: 2,
|
||||
hintText: widget.hintText,
|
||||
hintStyle:
|
||||
TextStyles.body1.textColor(Theme.of(context).hintColor),
|
||||
labelText: widget.label),
|
||||
prefixIcon: widget.prefixIcon,
|
||||
suffixIcon: widget.suffixIcon,
|
||||
contentPadding: widget.contentPadding ?? EdgeInsets.all(Insets.m),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide.none),
|
||||
isDense: true,
|
||||
icon: widget.icon == null ? null : Icon(widget.icon),
|
||||
errorText: widget.errorText,
|
||||
errorMaxLines: 2,
|
||||
hintText: widget.hintText,
|
||||
hintStyle: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium!
|
||||
.textColor(Theme.of(context).hintColor),
|
||||
labelText: widget.label,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra/text_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BaseStyledButton extends StatefulWidget {
|
||||
@ -106,7 +105,8 @@ class BaseStyledBtnState extends State<BaseStyledButton> {
|
||||
child: RawMaterialButton(
|
||||
focusNode: _focusNode,
|
||||
autofocus: widget.autoFocus,
|
||||
textStyle: widget.useBtnText ? TextStyles.body1 : null,
|
||||
textStyle:
|
||||
widget.useBtnText ? Theme.of(context).textTheme.bodyMedium : null,
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
// visualDensity: VisualDensity.compact,
|
||||
splashColor: Colors.transparent,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// ignore: import_of_legacy_library_into_null_safe
|
||||
import 'package:flowy_infra/size.dart';
|
||||
|
||||
import 'base_styled_button.dart';
|
||||
|
||||
class SecondaryTextButton extends StatelessWidget {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra/text_style.dart';
|
||||
import 'package:flowy_infra_ui/widget/rounded_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flowy_infra/time/duration.dart';
|
||||
@ -118,7 +117,8 @@ class _RoundedInputFieldState extends State<RoundedInputField> {
|
||||
decoration: InputDecoration(
|
||||
contentPadding: widget.contentPadding,
|
||||
hintText: widget.hintText,
|
||||
hintStyle: TextStyles.body1.textColor(borderColor),
|
||||
hintStyle:
|
||||
Theme.of(context).textTheme.bodyMedium!.textColor(borderColor),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: borderColor,
|
||||
|
Loading…
Reference in New Issue
Block a user