Skip to content

Commit

Permalink
refactor: place AutoSuggestBox to NavigationPane and migrate to fluen…
Browse files Browse the repository at this point in the history
…t_ui to 3.7.0
  • Loading branch information
Maxeem committed Jan 21, 2022
1 parent 8821665 commit a913e64
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
31 changes: 18 additions & 13 deletions lib/windows_search_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,24 @@ class WindowsSearchDelegate extends AbstractPlatformSearchDelegate {
@override
Widget buildScaffold(Widget? body, BuildContext context) {
return fluent.ScaffoldPage(
content: Padding(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 32),
child: Column(
children: [
fluent.AutoSuggestBox<String>(
key: _autoSuggestBoxKey,
placeholder: 'Search',
onSelected: (item) => print(item),
controller: queryTextController,
items: _kPlatformNames,
),
Spacer(),
],
content: fluent.NavigationView(
appBar: fluent.NavigationAppBar(
title: Text("Search", style: TextStyle(fontSize: 22, fontWeight: fluent.FontWeight.bold)),
),
pane: fluent.NavigationPane(
displayMode: fluent.PaneDisplayMode.compact,
header: SizedBox.expand(),
autoSuggestBoxReplacement: fluent.Icon(fluent.FluentIcons.search),
autoSuggestBox: fluent.AutoSuggestBox(
key: _autoSuggestBoxKey,
placeholder: 'Search',
onSelected: (item) => print(item),
controller: queryTextController,
items: _kPlatformNames,
),
),
content: Container(
color: fluent.Colors.white,
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ packages:
name: fluent_ui
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.0"
version: "3.7.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ environment:
flutter: ">=2.8.0"

dependencies:
fluent_ui: ^3.6.0
fluent_ui: ^3.7.0
flutter:
sdk: flutter

Expand Down

0 comments on commit a913e64

Please sign in to comment.