Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add search input to list of fiat currencies #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@
- published on zap.store with self-signing
- choose currency for wallet on settings

===== v0.16
===== v0.16 DONE
- nostr+walletconnect onboarding with lud16
- fix not finding metadatas
- fix not finding metadatas


===== v0.16 TODO
- make thread detail subscription of new replies work

=======
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/enum_multi_selector_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _EnumMultiSelectorComponent extends State<EnumMultiSelectorComponent> {
return Stack(
alignment: Alignment.center,
children: [
EnumSelectorComponent(list: widget.list, enumItemBuild: enumItemBuild),
EnumSelectorComponent(list: widget.list, enumItemBuild: enumItemBuild, showSearchInput: false,),
Positioned(
bottom: mediaDataCache.size.height / 20,
child: GestureDetector(
Expand Down
77 changes: 52 additions & 25 deletions lib/ui/enum_selector_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ import '../utils/router_util.dart';

class EnumSelectorComponent extends StatelessWidget {
final List<EnumObj> list;
final bool showSearchInput;

Widget Function(BuildContext, EnumObj)? enumItemBuild;

EnumSelectorComponent({
required this.list,
this.enumItemBuild,
});
EnumSelectorComponent(
{required this.list, this.enumItemBuild, required this.showSearchInput});

static Future<EnumObj?> show(BuildContext context, List<EnumObj> list) async {
static Future<EnumObj?> show(BuildContext context, List<EnumObj> list,
{bool showSearchInput = false}) async {
return await showDialog<EnumObj?>(
context: context,
builder: (_context) {
return EnumSelectorComponent(
list: list,
showSearchInput: showSearchInput,
);
},
);
Expand All @@ -44,28 +45,54 @@ class EnumSelectorComponent extends StatelessWidget {
}
}

Widget main = Container(
width: double.infinity,
padding: const EdgeInsets.only(
left: Base.BASE_PADDING,
right: Base.BASE_PADDING,
top: Base.BASE_PADDING_HALF,
bottom: Base.BASE_PADDING_HALF,
),
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(15)),
color: cardColor,
),
constraints: BoxConstraints(
maxHeight: maxHeight * 0.8,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: widgets,
Widget main = Column(children: [
TextField(
autofocus: true,
textAlign: TextAlign.center,
cursorColor: themeData.primaryColor,
style: const TextStyle(fontSize: 80, fontFamily: 'Geist.Mono'),
// textDirection: TextDirection.ltr,
controller: amountInputcontroller,
keyboardType:
TextInputType.numberWithOptions(decimal: !satsInput),
inputFormatters: <TextInputFormatter>[
satsInput
? FilteringTextInputFormatter.digitsOnly
: FilteringTextInputFormatter.allow(RegExp(r'[0-9.]'))
],
decoration: InputDecoration(
border: InputBorder.none,
hintText: " 0",
hintTextDirection: TextDirection.ltr,
hintStyle: TextStyle(
fontSize: 80,
color: themeData.disabledColor,
fontFamily: 'Geist.Mono'),
contentPadding: const EdgeInsets.only(right: 20),
),
),
);
Container(
width: double.infinity,
padding: const EdgeInsets.only(
left: Base.BASE_PADDING,
right: Base.BASE_PADDING,
top: Base.BASE_PADDING_HALF,
bottom: Base.BASE_PADDING_HALF,
),
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(15)),
color: cardColor,
),
constraints: BoxConstraints(
maxHeight: maxHeight * 0.8,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: widgets,
),
))
]);

return Scaffold(
backgroundColor: Colors.black.withOpacity(0.2),
Expand Down