2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Stack Wallet.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2023 Cypher Stack
|
|
|
|
* All Rights Reserved.
|
|
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-05-27 23:56:22 +00:00
|
|
|
|
2024-05-23 00:37:06 +00:00
|
|
|
import '../themes/stack_colors.dart';
|
|
|
|
import '../utilities/text_styles.dart';
|
|
|
|
import '../utilities/util.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
InputDecoration standardInputDecoration(
|
2022-10-27 16:51:56 +00:00
|
|
|
String? labelText,
|
|
|
|
FocusNode textFieldFocusNode,
|
|
|
|
BuildContext context, {
|
|
|
|
bool desktopMed = false,
|
|
|
|
}) {
|
2022-09-19 20:18:31 +00:00
|
|
|
final isDesktop = Util.isDesktop;
|
2022-09-15 19:48:28 +00:00
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
return InputDecoration(
|
|
|
|
labelText: labelText,
|
|
|
|
fillColor: textFieldFocusNode.hasFocus
|
2022-09-22 23:48:50 +00:00
|
|
|
? Theme.of(context).extension<StackColors>()!.textFieldActiveBG
|
|
|
|
: Theme.of(context).extension<StackColors>()!.textFieldDefaultBG,
|
2022-09-22 22:17:21 +00:00
|
|
|
labelStyle: isDesktop
|
2022-10-27 16:51:56 +00:00
|
|
|
? desktopMed
|
|
|
|
? STextStyles.desktopTextExtraSmall(context).copyWith(
|
|
|
|
color: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
2024-05-27 23:56:22 +00:00
|
|
|
.textFieldDefaultText,
|
|
|
|
)
|
2022-10-27 16:51:56 +00:00
|
|
|
: STextStyles.desktopTextFieldLabel(context)
|
2022-09-22 22:17:21 +00:00
|
|
|
: STextStyles.fieldLabel(context),
|
|
|
|
hintStyle: isDesktop
|
2022-10-27 16:51:56 +00:00
|
|
|
? desktopMed
|
|
|
|
? STextStyles.desktopTextExtraSmall(context).copyWith(
|
|
|
|
color: Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
2024-05-27 23:56:22 +00:00
|
|
|
.textFieldDefaultText,
|
|
|
|
)
|
2022-10-27 16:51:56 +00:00
|
|
|
: STextStyles.desktopTextFieldLabel(context)
|
2022-09-22 22:17:21 +00:00
|
|
|
: 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,
|
|
|
|
);
|
|
|
|
}
|