Skip to content

Commit a913e64

Browse files
author
Maxeem
committed
refactor: place AutoSuggestBox to NavigationPane and migrate to fluent_ui to 3.7.0
1 parent 8821665 commit a913e64

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

lib/windows_search_delegate.dart

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,24 @@ class WindowsSearchDelegate extends AbstractPlatformSearchDelegate {
2121
@override
2222
Widget buildScaffold(Widget? body, BuildContext context) {
2323
return fluent.ScaffoldPage(
24-
content: Padding(
25-
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 32),
26-
child: Column(
27-
children: [
28-
fluent.AutoSuggestBox<String>(
29-
key: _autoSuggestBoxKey,
30-
placeholder: 'Search',
31-
onSelected: (item) => print(item),
32-
controller: queryTextController,
33-
items: _kPlatformNames,
34-
),
35-
Spacer(),
36-
],
24+
content: fluent.NavigationView(
25+
appBar: fluent.NavigationAppBar(
26+
title: Text("Search", style: TextStyle(fontSize: 22, fontWeight: fluent.FontWeight.bold)),
27+
),
28+
pane: fluent.NavigationPane(
29+
displayMode: fluent.PaneDisplayMode.compact,
30+
header: SizedBox.expand(),
31+
autoSuggestBoxReplacement: fluent.Icon(fluent.FluentIcons.search),
32+
autoSuggestBox: fluent.AutoSuggestBox(
33+
key: _autoSuggestBoxKey,
34+
placeholder: 'Search',
35+
onSelected: (item) => print(item),
36+
controller: queryTextController,
37+
items: _kPlatformNames,
38+
),
39+
),
40+
content: Container(
41+
color: fluent.Colors.white,
3742
),
3843
),
3944
);

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ packages:
6363
name: fluent_ui
6464
url: "https://pub.dartlang.org"
6565
source: hosted
66-
version: "3.6.0"
66+
version: "3.7.0"
6767
flutter:
6868
dependency: "direct main"
6969
description: flutter

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ environment:
2222
flutter: ">=2.8.0"
2323

2424
dependencies:
25-
fluent_ui: ^3.6.0
25+
fluent_ui: ^3.7.0
2626
flutter:
2727
sdk: flutter
2828

0 commit comments

Comments
 (0)