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 1e9495d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 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
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
version: 1.0.3+3

environment:
sdk: ">=2.14.4 <3.0.0"
flutter: ">=2.8.0"

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

Expand Down

0 comments on commit 1e9495d

Please sign in to comment.