Skip to content

Commit

Permalink
add timer picker
Browse files Browse the repository at this point in the history
  • Loading branch information
tyluffy committed Feb 24, 2022
1 parent 92976e5 commit ac3aaa4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"produce": "Produce",
"producer": "Producer",
"producerList": "Producer List",
"timePick": "Please choose the time",
"refresh": "Refresh",
"searchByMessageId": "Search by MessageId, type is ledgerId entryId, submit with enter key",
"searchByMessageIdWithHint": "Search by MessageId, single search type should be ledgerId entryId, multi search type should be ledgerId entryId entryId, submit with enter key",
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/intl_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"produce": "生产",
"producer": "生产者",
"producerList": "生产者列表",
"timePick": "请选择时间",
"refresh": "刷新",
"searchByMessageId": "通过messageId查询消息,格式ledgerId entryId,按enter键进行查询。",
"searchByMessageIdWithHint": "通过messageId查询消息,单条查询格式ledgerId entryId,范围查询格式位ledgerId entryId entryId,按enter键进行查询。",
Expand Down
13 changes: 13 additions & 0 deletions lib/ui/pulsar/widget/pulsar_topic_consume.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import 'package:paas_dashboard_flutter/ui/util/exception_util.dart';
import 'package:paas_dashboard_flutter/ui/util/spinner_util.dart';
import 'package:paas_dashboard_flutter/vm/pulsar/pulsar_topic_consume_view_model.dart';
import 'package:provider/provider.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';

class PulsarTopicConsumeWidget extends StatefulWidget {
PulsarTopicConsumeWidget();
Expand Down Expand Up @@ -92,6 +93,18 @@ class PulsarTopicConsumeWidgetState extends State<PulsarTopicConsumeWidget> {

var body = ListView(
children: <Widget>[
Container(
margin: EdgeInsetsDirectional.only(top: 10),
child: TextButton(
onPressed: () {
DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
print("change $date");
}, onConfirm: (date) {
searchMessageIdController.text = date.millisecondsSinceEpoch.toString();
}, currentTime: DateTime.now(), locale: LocaleType.zh);
},
child: Text(S.of(context).timePick),
)),
Container(
margin: EdgeInsetsDirectional.only(top: 10),
child: TextField(
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_datetime_picker:
dependency: "direct main"
description:
name: flutter_datetime_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
flutter_localizations:
dependency: "direct main"
description: flutter
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.4
flutter_datetime_picker: ^1.2.6
mongo_dart: ^0.7.4
mysql1: ^0.19.2
redis: ^2.2.0
Expand Down

0 comments on commit ac3aaa4

Please sign in to comment.