Skip to content

Commit 1e9495d

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

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1515
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1616
# Read more about iOS versioning at
1717
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18-
version: 1.0.0+1
18+
version: 1.0.3+3
1919

2020
environment:
2121
sdk: ">=2.14.4 <3.0.0"
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)