Skip to content

Commit e3d4de9

Browse files
committed
撤回dialog修改
1 parent 57fa806 commit e3d4de9

File tree

2 files changed

+20
-32
lines changed

2 files changed

+20
-32
lines changed

lib/pages/search/search_page.dart

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SearchPage extends StatefulWidget {
1919

2020
class _SearchPageState extends State<SearchPage> {
2121
final SearchController searchController = SearchController();
22-
String _currentSort = 'match';
22+
String _currentSort = '';
2323

2424
/// Don't use modular singleton here. We may have multiple search pages.
2525
/// Use a new instance of SearchPageController for each search page.
@@ -88,7 +88,7 @@ class _SearchPageState extends State<SearchPage> {
8888
),
8989
ButtonSegment(
9090
value: 'match',
91-
label: Text('匹配'),
91+
label: Text('准确'),
9292
icon: Icon(Icons.search),
9393
),
9494
],
@@ -167,19 +167,14 @@ class _SearchPageState extends State<SearchPage> {
167167
),
168168
floatingActionButton: FloatingActionButton.extended(
169169
onPressed: () async {
170-
showDialog(
170+
showModalBottomSheet(
171+
isScrollControlled: true,
172+
useSafeArea: true,
173+
clipBehavior: Clip.antiAlias,
174+
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
171175
context: context,
172-
barrierDismissible: true,
173176
builder: (context) {
174-
return Dialog(
175-
insetPadding: const EdgeInsets.symmetric(horizontal: 10),
176-
child: ConstrainedBox(
177-
constraints: const BoxConstraints(
178-
maxWidth: 300,
179-
),
180-
child: showSearchOptionsDialog(),
181-
),
182-
);
177+
return showSearchOptionsDialog();
183178
},
184179
);
185180
},

lib/pages/timeline/timeline_page.dart

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class _TimelinePageState extends State<TimelinePage>
5454
navigationBarState.updateSelectedIndex(0);
5555
Modular.to.navigate('/tab/popular/');
5656
}
57-
String _currentSort = 'match';
57+
String _currentSort = 'time';
5858
DateTime generateDateTime(int year, String season) {
5959
switch (season) {
6060
case '冬':
@@ -363,18 +363,13 @@ class _TimelinePageState extends State<TimelinePage>
363363
selected: {_currentSort},
364364
onSelectionChanged: (Set<String> value) {
365365
final sort = value.first;
366-
367-
setInnerState(() {
368-
_currentSort = sort;
369-
});
370-
366+
setInnerState(() {_currentSort = sort;});
371367
int type;
372368
sort == 'heat'
373369
? type = 3
374370
: sort == 'rank'
375371
? type = 2
376372
: type = 1;
377-
378373
timelineController.changeSortType(type);
379374
},
380375
),
@@ -451,20 +446,18 @@ class _TimelinePageState extends State<TimelinePage>
451446
),
452447
floatingActionButton: FloatingActionButton(
453448
onPressed: () async {
454-
showDialog(
449+
KazumiDialog.showBottomSheet(
450+
backgroundColor: Theme.of(context).colorScheme.surface,
451+
shape: const RoundedRectangleBorder(
452+
borderRadius: BorderRadius.vertical(top: Radius.circular(28)),
453+
),
454+
isScrollControlled: true,
455+
useSafeArea: true,
456+
clipBehavior: Clip.antiAlias,
455457
context: context,
456-
barrierDismissible: true,
457458
builder: (context) {
458-
return Dialog(
459-
insetPadding: const EdgeInsets.symmetric(horizontal: 10),
460-
child: ConstrainedBox(
461-
constraints: const BoxConstraints(
462-
maxWidth: 300,
463-
),
464-
child: showTimelineOptionsDialog(),
465-
),
466-
);
467-
},
459+
return showTimelineOptionsDialog();
460+
}
468461
);
469462
},
470463
child: const Icon(Icons.tune),

0 commit comments

Comments
 (0)