finish sender_list && plain-text-search
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:simplecloudnotifier/components/modals/filter_modal_channel.dart';
|
||||
import 'package:simplecloudnotifier/components/modals/filter_modal_keytoken.dart';
|
||||
import 'package:simplecloudnotifier/components/modals/filter_modal_priority.dart';
|
||||
import 'package:simplecloudnotifier/components/modals/filter_modal_searchplain.dart';
|
||||
import 'package:simplecloudnotifier/components/modals/filter_modal_sendername.dart';
|
||||
import 'package:simplecloudnotifier/components/modals/filter_modal_time.dart';
|
||||
import 'package:simplecloudnotifier/state/app_bar_state.dart';
|
||||
@@ -16,7 +17,9 @@ class AppBarFilterDialog extends StatefulWidget {
|
||||
class _AppBarFilterDialogState extends State<AppBarFilterDialog> {
|
||||
double _height = 0;
|
||||
|
||||
double _targetHeight = 4 + (48 * 6) + (16 * 5) + 4;
|
||||
static const int _itemCount = 7;
|
||||
|
||||
static const double _targetHeight = 4 + (48 * _itemCount) + (16 * (_itemCount - 1)) + 4;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -117,6 +120,6 @@ class _AppBarFilterDialogState extends State<AppBarFilterDialog> {
|
||||
}
|
||||
|
||||
void _showPlainSearchModal(BuildContext context) {
|
||||
//TODO showDialog<void>(context: context, builder: (BuildContext context) => FilterModalSearchPlain());
|
||||
showDialog<void>(context: context, builder: (BuildContext context) => FilterModalSearchPlain());
|
||||
}
|
||||
}
|
||||
|
60
flutter/lib/components/modals/filter_modal_searchplain.dart
Normal file
60
flutter/lib/components/modals/filter_modal_searchplain.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:simplecloudnotifier/pages/message_list/message_filter_chiplet.dart';
|
||||
import 'package:simplecloudnotifier/state/app_events.dart';
|
||||
|
||||
class FilterModalSearchPlain extends StatefulWidget {
|
||||
@override
|
||||
_FilterModalSearchPlainState createState() => _FilterModalSearchPlainState();
|
||||
}
|
||||
|
||||
class _FilterModalSearchPlainState extends State<FilterModalSearchPlain> {
|
||||
final _controller = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Search'),
|
||||
content: Container(
|
||||
child: TextField(
|
||||
autofocus: true,
|
||||
controller: _controller,
|
||||
decoration: InputDecoration(hintText: "Search..."),
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(textStyle: Theme.of(context).textTheme.labelLarge),
|
||||
child: const Text('Apply'),
|
||||
onPressed: _onOkay,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
void _onOkay() {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
List<MessageFilterChiplet> chiplets = [];
|
||||
if (_controller.text.isNotEmpty) {
|
||||
chiplets.add(MessageFilterChiplet(
|
||||
label: _controller.text,
|
||||
value: _controller.text,
|
||||
type: MessageFilterChipletType.plainSearch,
|
||||
));
|
||||
}
|
||||
|
||||
AppEvents().notifyFilterListeners([MessageFilterChipletType.plainSearch], chiplets);
|
||||
}
|
||||
}
|
@@ -73,15 +73,13 @@ class _FilterModalSendernameState extends State<FilterModalSendername> {
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(textStyle: Theme.of(context).textTheme.labelLarge),
|
||||
child: const Text('Apply'),
|
||||
onPressed: () {
|
||||
onOkay();
|
||||
},
|
||||
onPressed: _onOkay,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
void onOkay() {
|
||||
void _onOkay() {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
final chiplets = _selectedEntries
|
||||
|
Reference in New Issue
Block a user