stack_wallet/lib/widgets/stack_text_field.dart

28 lines
1 KiB
Dart
Raw Normal View History

2022-08-26 08:11:35 +00:00
import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
2022-09-19 20:18:31 +00:00
import 'package:stackwallet/utilities/util.dart';
2022-08-26 08:11:35 +00:00
InputDecoration standardInputDecoration(
2022-09-22 22:17:21 +00:00
String? labelText, FocusNode textFieldFocusNode, BuildContext context) {
2022-09-19 20:18:31 +00:00
final isDesktop = Util.isDesktop;
2022-08-26 08:11:35 +00:00
return InputDecoration(
labelText: labelText,
fillColor: textFieldFocusNode.hasFocus
? Theme.of(context).extension<StackColors>()!.textFieldActiveBG
: Theme.of(context).extension<StackColors>()!.textFieldDefaultBG,
2022-09-22 22:17:21 +00:00
labelStyle: isDesktop
? STextStyles.desktopTextFieldLabel(context)
: STextStyles.fieldLabel(context),
hintStyle: isDesktop
? STextStyles.desktopTextFieldLabel(context)
: STextStyles.fieldLabel(context),
2022-08-26 08:11:35 +00:00
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
);
}