all transactions search field fix for mobile

This commit is contained in:
julian 2022-11-03 18:11:51 -06:00
parent 23d0ab8734
commit 9231c3a2a5

View file

@ -21,6 +21,7 @@ import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/conditional_parent.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
@ -302,68 +303,78 @@ class _TransactionDetailsViewState extends ConsumerState<AllTransactionsView> {
padding: const EdgeInsets.all(4), padding: const EdgeInsets.all(4),
child: Row( child: Row(
children: [ children: [
SizedBox( ConditionalParent(
width: isDesktop ? 570 : null, condition: isDesktop,
child: ClipRRect( builder: (child) => SizedBox(
borderRadius: BorderRadius.circular( width: 570,
Constants.size.circularBorderRadius, child: child,
),
child: ConditionalParent(
condition: !isDesktop,
builder: (child) => Expanded(
child: child,
), ),
child: TextField( child: ClipRRect(
autocorrect: !isDesktop, borderRadius: BorderRadius.circular(
enableSuggestions: !isDesktop, Constants.size.circularBorderRadius,
controller: _searchController, ),
focusNode: searchFieldFocusNode, child: TextField(
onChanged: (value) { autocorrect: !isDesktop,
setState(() { enableSuggestions: !isDesktop,
_searchString = value; controller: _searchController,
}); focusNode: searchFieldFocusNode,
}, onChanged: (value) {
style: isDesktop setState(() {
? STextStyles.desktopTextExtraSmall(context) _searchString = value;
.copyWith( });
color: Theme.of(context) },
.extension<StackColors>()! style: isDesktop
.textFieldActiveText, ? STextStyles.desktopTextExtraSmall(context)
height: 1.8, .copyWith(
) color: Theme.of(context)
: STextStyles.field(context), .extension<StackColors>()!
decoration: standardInputDecoration( .textFieldActiveText,
"Search...", height: 1.8,
searchFieldFocusNode,
context,
desktopMed: isDesktop,
).copyWith(
prefixIcon: Padding(
padding: EdgeInsets.symmetric(
horizontal: isDesktop ? 12 : 10,
vertical: isDesktop ? 18 : 16,
),
child: SvgPicture.asset(
Assets.svg.search,
width: isDesktop ? 20 : 16,
height: isDesktop ? 20 : 16,
),
),
suffixIcon: _searchController.text.isNotEmpty
? Padding(
padding: const EdgeInsets.only(right: 0),
child: UnconstrainedBox(
child: Row(
children: [
TextFieldIconButton(
child: const XIcon(),
onTap: () async {
setState(() {
_searchController.text = "";
_searchString = "";
});
},
),
],
),
),
) )
: null, : STextStyles.field(context),
decoration: standardInputDecoration(
"Search...",
searchFieldFocusNode,
context,
desktopMed: isDesktop,
).copyWith(
prefixIcon: Padding(
padding: EdgeInsets.symmetric(
horizontal: isDesktop ? 12 : 10,
vertical: isDesktop ? 18 : 16,
),
child: SvgPicture.asset(
Assets.svg.search,
width: isDesktop ? 20 : 16,
height: isDesktop ? 20 : 16,
),
),
suffixIcon: _searchController.text.isNotEmpty
? Padding(
padding: const EdgeInsets.only(right: 0),
child: UnconstrainedBox(
child: Row(
children: [
TextFieldIconButton(
child: const XIcon(),
onTap: () async {
setState(() {
_searchController.text = "";
_searchString = "";
});
},
),
],
),
),
)
: null,
),
), ),
), ),
), ),