Giter Club home page Giter Club logo

fluent_ui's Introduction

fluent_ui


Design beautiful native Windows apps using Flutter

Unofficial implementation of Fluent UI for Flutter. It's written based on the official documentation.

Read the documentation


Content

Motivation and maintenance

Since Flutter has stable Windows support, it's necessary to have support to its UI guidelines to build apps with fidelity, the same way it has support for Material and Cupertino. See this for more info on the offical fluent ui support

See also:


This is an open-source package, which means that anyone can contribute to it. However, I, bdlukaa, am the only one actively maintaining it, so it may take some time to review and merge pull requests. If you want to support the project, you can become a patron:

Installation

Add the package to your dependencies:

dependencies:
  fluent_ui: ^4.4.0

OR

dependencies:
  fluent_ui:
    git: https://github.com/bdlukaa/fluent_ui.git

Finally, run dart pub get to download the package.

Projects using this library should use the stable channel of Flutter

Badge

Are you using this library on your app? You can use a badge to tell others:

Add the following code to your README.md or to your website:

<a title="Made with Fluent Design" href="https://github.com/bdlukaa/fluent_ui">
  <img
    src="https://img.shields.io/badge/fluent-design-blue?style=flat-square&color=gray&labelColor=0078D7"
  />
</a>

Accent color

Common controls use an accent color to convey state information. Learn more.

By default, the accent color is Colors.blue. However, you can also customize your app's accent color to reflect your brand:

FluentThemeData(
  accentColor: Colors.blue,
)

To use the system's accent color, you can use the plugin system_theme made by me :). It has support for (as of 21/01/2023) Android, Web, MacOS, Windows, Xbox and Linux (GTK 3+).

import 'package:system_theme/system_theme.dart';

FluentThemeData(
  accentColor: SystemTheme.accentColor.accent.toAccentColor(),
)

Localization

FluentUI widgets currently supports out-of-the-box an wide number of languages, including:

  • Arabic (@dmakwt)
  • Bahasa Indonesia (@ekasetiawans)
  • Belarusian (@superkeka)
  • Czech (@morning4coffe-dev)
  • Croatian (@ZeroMolecule)
  • Dutch (@h3x4d3c1m4l)
  • English
  • French (@WinXaito)
  • German (@larsb24)
  • Greek (@pana-g)
  • Hebrew (@yehudakremer)
  • Hindi (@alexmercerind)
  • Hungarian (@RedyAu)
  • Italian (@patricknicolosi)
  • Japanese (@chari8)
  • Korean (@dubh3)
  • Malay (@jonsaw)
  • Persian (@xmine64)
  • Polish (@madik7)
  • Portuguese (@bdlukaa)
  • Romanian (@antoniocranga)
  • Russian (@raitonoberu)
  • Simplified Chinese (@zacksleo, @rk0cc)
  • Tamil (@sarankumar-ns)
  • Traditional Chinese (@zacksleo, @rk0cc)
  • Thai (@lines-of-codes)
  • Turkish (@timurturbil)
  • Spanish (@henry2man)
  • Ukranian (@vadimbarda)
  • Urdu (@sherazahmad720)
  • Uzbek (@bobobekturdiyev)

If a language is not supported, your app may crash. You can add support for a new language or use a supported language. Learn more

Contribution

Feel free to file an issue if you find a problem or make pull requests.

All contributions are welcome :)

Contributing new localizations

In PR#216 we added support for new localizations in FluentUI Widgets.

If you want to contribute adding new localizations please follow this steps:

  • Fork the repo
  • Copy lib/l10n/intl_en.arb file into lib/l10n folder with a new language code, following this list of ISO 859-1 codes
  • Update the contents in the newly created file. Specially, please update the @locale value with the corresponding ISO code.
  • Run your project and code generation will take place or run command flutter gen-l10n
  • When you're done, make a new pull request

More about Localization in the Flutter Official Documentation

Acknowledgements

Irrespective of order, thanks to all the people below for contributing with the project. It means a lot to me :)

fluent_ui's People

Contributors

abbas1hussein avatar alesimula avatar alphamplyer avatar ascenio avatar bdlukaa avatar corvusye avatar demojameson avatar ekasetiawans avatar ellet0 avatar h2sxxa avatar h3x4d3c1m4l avatar henry2man avatar hrx03 avatar jtdlab avatar kapranov98 avatar klondikedragon avatar matej-hlatky avatar mstfkhazaal avatar nicolaverbeeck avatar nidetuzi avatar patricknicolosi avatar phorcys420 avatar rk0cc avatar robkri avatar sherazahmad720 avatar the-best-is-best avatar thitlwincoder avatar tobiasht avatar winxaito avatar yehudakremer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluent_ui's Issues

Open overlay when open compact display mode

Is your feature request related to a problem? Please describe.
When I press the "open navigation" button on the compact mode, it switches to the "open" display mode. When it switches, a lot of "overflow errors" are thrown.

Describe the solution you'd like
Open an overlay when the button is pressed, just like in the minimal display mode.

Reorder TabView by dragging

Currently, we can't reorder the tabs at any way. In the official docs, they can be reordered by dragging them.

add preview in readme

it would be much easier for people to have kind of brief preview for the package in readme like screenshots and gif.if u get time please consider adding it

Window transparency effect

Implement window transparency effect on the example app. This should be done with the help of an external plugin, because this library should not implement any platform code at all.

A example of this can be seen in Windows 10 Settings app:
| Dark Mode | Light Mode |
| acrylic settings | acrylic settings light |

Fix diagnostics tree

The following error is thrown when I try to open the devtools on the example app.

โ•โ•โ•ก EXCEPTION CAUGHT BY FLUTTER FRAMEWORK โ•žโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
The following _TypeError was thrown during a service extension callback for
"ext.flutter.inspector.getRootWidgetSummaryTree":
type 'Null' is not a subtype of type 'String' of 'function result'

When the exception was thrown, this was the stack:
#0      _Location.file (package:flutter/src/widgets/widget_inspector.dart)
#1      _Location.toJsonMap (package:flutter/src/widgets/widget_inspector.dart:2842:15)
#2      _Location.toJsonMap.<anonymous closure> (package:flutter/src/widgets/widget_inspector.dart:2851:44)
#3      MappedListIterable.elementAt (dart:_internal/iterable.dart:411:31)
#4      ListIterator.moveNext (dart:_internal/iterable.dart:340:26)
#5      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:188:27)
#6      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#7      new List.of (dart:core-patch/array_patch.dart:50:28)
#8      ListIterable.toList (dart:_internal/iterable.dart:211:44)
#9      _Location.toJsonMap (package:flutter/src/widgets/widget_inspector.dart:2851:57)
#10     InspectorSerializationDelegate.additionalNodeProperties (package:flutter/src/widgets/widget_inspector.dart:3166:53)
#11     DiagnosticsNode.toJsonMap.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:1592:21)
#12     DiagnosticsNode.toJsonMap (package:flutter/src/foundation/diagnostics.dart:1607:6)
#13     _ElementDiagnosticableTreeNode.toJsonMap (package:flutter/src/widgets/framework.dart:4219:45)
#14     WidgetInspectorService._nodeToJson (package:flutter/src/widgets/widget_inspector.dart:1499:18)
#15     WidgetInspectorService._getRootWidgetSummaryTree (package:flutter/src/widgets/widget_inspector.dart:1683:12)
#16     WidgetInspectorService._registerObjectGroupServiceExtension.<anonymous closure>
(package:flutter/src/widgets/widget_inspector.dart:793:58)
#17     WidgetInspectorService._registerObjectGroupServiceExtension.<anonymous closure>
(package:flutter/src/widgets/widget_inspector.dart:792:17)
#18     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:597:32)
<asynchronous suspension>
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Implement calendar and calendar popup

CalendarView

A calendar view lets a user view and interact with a calendar that they can navigate by month, year, or decade. A user can select a single date or a range of dates. It doesn't have a picker surface and the calendar is always visible.

Calendar Views Preview

  • Month View
  • Year View
  • Decade View

Calendar View Elements

Learn more

CalendarDatePicker

The calendar date picker is a drop down control that's optimized for picking a single date from a calendar view where contextual information like the day of the week or fullness of the calendar is important. You can modify the calendar to provide additional context or to limit available dates.

This is dependent on the CalendarView, mentioned above.

Learn more

Better popup math

Popups (ComboBox, TimePicker, Flyout, DatePicker, Tooltip) should have a better match calculation.

  • Flyout (#253)
    Flyouts should have the alignment property, that would define where the flyout should be in comparision to the child.
  • Combobox (#25)
  • TimePicker
  • DatePicker
    The highlighted tiles of these should be aligned to their child, if possible.
  • Tooltip (#26)
    Tooltip's position should be calculated according to the mouse position, not the child position.

Some of these popups use the Popup widget, that should be deleted because these popups should not share the same math code.

Progress Indicators

Currently, we only supported determinate progress indicators (ProgressBar and ProgressRing)


We should also support indeterminate progress indicators:


Remove back button from NavigationPane

I can't find a way to remove the back button from the NavigationPane. Seems like it is implemented for NavigationAppBar, but not for NavigationPane. Can you please add this functionality?

๐Ÿ› Flutter For Windows throws an exception when pressing any key on the window.

Press any key on the window (this includes pressing alt+tab to switch the focus to the Flutter window).

image

This problem can be temporarily alleviated by ending the process and restarting, but it is not sure when it will happen again.

environment:
  sdk: ">=2.12.0 <3.0.0"
dependencies:
  flutter:
    sdk: flutter
  fluent_ui:
    git: https://github.com/bdlukaa/fluent_ui.git
console outputs
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: 'package:flutter/src/services/hardware_keyboard.dart': Failed assertion: line 787 pos 16: 'false': Should never encounter KeyData when transitMode is rawKeyData.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
#2      KeyEventManager.handleKeyData (package:flutter/src/services/hardware_keyboard.dart:787:16)
#3      PlatformDispatcher._dispatchKeyData.<anonymous closure> (dart:ui/platform_dispatcher.dart:375:61)
#4      _invoke2.<anonymous closure> (dart:ui/hooks.dart:205:15)
#5      _rootRun (dart:async/zone.dart:1428:13)
#6      _CustomZone.run (dart:async/zone.dart:1328:19)
#7      _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#8      _invoke2 (dart:ui/hooks.dart:204:10)
#9      PlatformDispatcher._dispatchKeyData (dart:ui/platform_dispatcher.dart:373:5)
#10     _dispatchKeyData (dart:ui/hooks.dart:104:31)
flutter doctor -v
[โœ“] Flutter (Channel beta, 2.6.0-5.2.pre, on Microsoft Windows [Version 10.0.19043.1149], locale zh-CN)
    โ€ข Flutter version 2.6.0-5.2.pre at D:\SDK\Flutter
    โ€ข Upstream repository https://github.com/flutter/flutter.git
    โ€ข Framework revision 400608f101 (5 days ago), 2021-09-15 15:50:26 -0700
    โ€ข Engine revision 1d521d89d8
    โ€ข Dart version 2.15.0 (build 2.15.0-82.2.beta)
    โ€ข Pub download mirror https://pub.flutter-io.cn
    โ€ข Flutter download mirror https://storage.flutter-io.cn

[โœ“] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    โ€ข Android SDK at D:\SDK\Android
    โ€ข Platform android-31, build-tools 31.0.0
    โ€ข ANDROID_SDK_ROOT = D:\SDK\Android
    โ€ข Java binary at: D:\IDE\Android Studio\jre\bin\java
    โ€ข Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    โ€ข All Android licenses accepted.

[โœ“] Chrome - develop for the web
    โ€ข Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[โœ“] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.11.3)
    โ€ข Visual Studio at D:\IDE\Microsoft Visual Studio\2019\Enterprise
    โ€ข Visual Studio Enterprise 2019 version 16.11.31702.278
    โ€ข Windows 10 SDK version 10.0.19041.0

[โœ“] Android Studio (version 2021.1)
    โ€ข Android Studio at D:\IDE\Android Studio
    โ€ข Flutter plugin can be installed from:
      ๐Ÿ”จ https://plugins.jetbrains.com/plugin/9212-flutter
    โ€ข Dart plugin can be installed from:
      ๐Ÿ”จ https://plugins.jetbrains.com/plugin/6351-dart
    โ€ข Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)

[โœ“] IntelliJ IDEA Ultimate Edition (version 2021.2)
    โ€ข IntelliJ at D:\IDE\IDEA
    โ€ข Flutter plugin version 60.1.4
    โ€ข Dart plugin version 212.5284.31

[โœ“] Connected device (3 available)
    โ€ข Windows (desktop) โ€ข windows โ€ข windows-x64    โ€ข Microsoft Windows [Version 10.0.19043.1149]
    โ€ข Chrome (web)      โ€ข chrome  โ€ข web-javascript โ€ข Google Chrome 93.0.4577.82
    โ€ข Edge (web)        โ€ข edge    โ€ข web-javascript โ€ข Microsoft Edge 93.0.961.47

โ€ข No issues found!

Enable navigation using the keyboard

Currently, we can only navigate using the mouse. This can be achieved using the FocusManager class:

...state with WidgetsBindingObserver

  bool _hasPrimaryFocus = false;
  late FocusHighlightMode _focusHighlightMode;

  void _handleFocusHighlightModeChange(FocusHighlightMode mode) {
    if (!mounted) {
      return;
    }
    setState(() {
      _focusHighlightMode = mode;
    });
  }

  void _handleFocusChanged() {
    if (_hasPrimaryFocus != focusNode!.hasPrimaryFocus) {
      setState(() {
        _hasPrimaryFocus = focusNode!.hasPrimaryFocus;
      });
    }
  }

  @override
  void initState() {
    super.initState();
    focusNode!.addListener(_handleFocusChanged);
    final FocusManager focusManager = WidgetsBinding.instance!.focusManager;
    _focusHighlightMode = focusManager.highlightMode;
    focusManager.addHighlightModeListener(_handleFocusHighlightModeChange);
  }

  @override
  void dispose() {
    WidgetsBinding.instance!.removeObserver(this);
    WidgetsBinding.instance!.focusManager.removeHighlightModeListener(_handleFocusHighlightModeChange);
    focusNode!.removeListener(_handleFocusChanged);
    super.dispose();
  }

  bool get _showHighlight {
    switch (_focusHighlightMode) {
      case FocusHighlightMode.touch:
        return false;
      case FocusHighlightMode.traditional:
        return _hasPrimaryFocus;
    }
  }
This code is from flutter/dropdown

If _showHighlight is true, we should change the widget decoration.

error G76A9B1F6: The method '_FluentTextSelectionControls.buildHandle' has fewer positional arguments than those of overridden method

Describe the bug
First tried to build with my application then tried to run the example one and I get the same exact error.

To Reproduce
Steps to reproduce the behavior:

  1. Run the example project to windows
  2. See error before build finishes
[โˆš] Flutter (Channel beta, 2.5.0, on Microsoft Windows [Version 10.0.19043.1165], locale en-US)
    โ€ข Flutter version 2.5.0 at C:\Users\Elias\flutter
    โ€ข Upstream repository https://github.com/flutter/flutter.git
    โ€ข Framework revision 4cc385b4b8 (6 days ago), 2021-09-07 23:01:49 -0700
    โ€ข Engine revision f0826da7ef
    โ€ข Dart version 2.14.0

[โˆš] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    โ€ข Android SDK at C:\Users\Elias\AppData\Local\Android\sdk
    โ€ข Platform android-S, build-tools 30.0.3
    โ€ข ANDROID_HOME = C:\Users\Elias\AppData\Local\Android\sdk
    โ€ข Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    โ€ข Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    โ€ข All Android licenses accepted.

[โˆš] Chrome - develop for the web
    โ€ข Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[โˆš] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.4)
    โ€ข Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    โ€ข Visual Studio Community 2019 version 16.9.31205.134
    โ€ข Windows 10 SDK version 10.0.19041.0

[โˆš] Android Studio (version 2020.3)
    โ€ข Android Studio at C:\Program Files\Android\Android Studio
    โ€ข Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    โ€ข Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    โ€ข Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[โˆš] VS Code (version 1.60.0)
    โ€ข VS Code at C:\Users\Elias\AppData\Local\Programs\Microsoft VS Code
    โ€ข Flutter extension version 3.26.0

[โˆš] Connected device (3 available)
    โ€ข Windows (desktop) โ€ข windows โ€ข windows-x64    โ€ข Microsoft Windows [Version 10.0.19043.1165]
    โ€ข Chrome (web)      โ€ข chrome  โ€ข web-javascript โ€ข Google Chrome 93.0.4577.63
    โ€ข Edge (web)        โ€ข edge    โ€ข web-javascript โ€ข Microsoft Edge 93.0.961.47

โ€ข No issues found!
PS C:\Users\Elias\Downloads\fluent_ui-master\example> flutter run
Multiple devices found:
Windows (desktop) โ€ข windows โ€ข windows-x64    โ€ข Microsoft Windows [Version 10.0.19043.1165]
Chrome (web)      โ€ข chrome  โ€ข web-javascript โ€ข Google Chrome 93.0.4577.63
Edge (web)        โ€ข edge    โ€ข web-javascript โ€ข Microsoft Edge 93.0.961.47
[1]: Windows (windows)
[2]: Chrome (chrome)
[3]: Edge (edge)
Please choose one (To quit, press "q/Q"): 1
Launching lib\main.dart on Windows in debug mode...
../lib/src/controls/form/selection_controls.dart(50,10): error G76A9B1F6: The method '_FluentTextSelectionControls.buildHandle' has fewer positional arguments than those of overridden method 'TextSelectionControls.buildHandle'. [C:\Users\Elias\Downloads\fluent_ui-master\example\build\windows\flutter\flutter_assemble.vcxproj]
../lib/src/controls/form/selection_controls.dart(61,10): error G76A9B1F6: The method '_FluentTextSelectionControls.getHandleAnchor' has fewer 
positional arguments than those of overridden method 'TextSelectionControls.getHandleAnchor'. [C:\Users\Elias\Downloads\fluent_ui-master\example\build\windows\flutter\flutter_assemble.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(240,5): error MSB8066: Custom build for 'C:\Users\Elias\Downloads\fluent_ui-master\example\build\windows\CMakeFiles\d68200f278100e31c8ef127274f802e5\flutter_windows.dll.rule;C:\Users\Elias\Downloads\fluent_ui-master\example\build\windows\CMakeFiles\3ded2e916a2acf0c7491b781f0d55533\flutter_assemble.rule' exited with code 1. [C:\Users\Elias\Downloads\fluent_ui-master\example\build\windows\flutter\flutter_assemble.vcxproj]
Building Windows application...
Exception: Build process failed.

Improve inputs

Currently, several input widgets uses a HoverButton as backend. Currently, it only supports one button state at the time, but it should support multiple. For example, when pressing and hovering, it should provide both to the builder callback.

Web demo hosted on GitHub pages?

This library is a great addition to Flutter Material & Cupertino, thank you for such amazing work!

Currently to see it in action developers have to manually build & launch example app. It is even harder to show it to someone in the company: the application needs to be built and hosted somewhere.

Is it possible to host example app somewhere in Web (for example, on GitHub pages) to allow people to launch and see it in action just in a single button click?

๐Ÿ› Scrollbar This widget has been unmounted, so the State no longer has a context (and should be considered defunct).

I get the following error message using a NavigationBody (which contains two views):

The following assertion was thrown during a scheduler callback:
This widget has been unmounted, so the State no longer has a context (and should be considered defunct).

Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.
When the exception was thrown, this was the stack:
#0 State.context. (package:flutter/src/widgets/framework.dart:909:9)
#1 State.context (package:flutter/src/widgets/framework.dart:915:6)
#2 RawScrollbarState._maybeTriggerScrollbar. (package:flutter/src/widgets/scrollbar.dart:1236:98)
#3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1143:15)
#4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1088:9)
#5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:996:5)
#9 _invoke (dart:ui/hooks.dart:166:10)
#10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5)
#11 _drawFrame (dart:ui/hooks.dart:129:31)
(elided 3 frames from dart:async)

To be honest, I'm a little baffled. The error seems to be related to the NavigationBody (since I don't get the error when using a regular Material Scaffold). I tried adding AutomaticKeepAliveClientMixins to the views of the NavigationBody but that didn't help.

Have any of you ever experienced something similar?

PillButtonBar doesn't accept a list of 2 items๐Ÿ›

Describe the bug
It's not really a bug just a normal mistake. A PillButtonBar will need at least two items otherwise an assertion will be generated. As it states in the image of your code bellow, in the comments.
But in fact you have to put 3 items for it to work

To Reproduce
Steps to reproduce the behavior:

Make a PillButtonBar, have two items on it,
An assertion will fire.

Expected behavior
Allow a 2 items list, as stated in the comments of the code

Screenshots
image
It should be items.lenght>=2 instead of items.lenght>2

Nice Work!
Love the Design! Keep up the Work!

[Scrollbar] isPointerOverScrollbar() kind parameter

Last month, there was a commit that changes isPointerOverScrollbar() so that it requires an additional parameter for 'kind' (PointerDeviceKind).
As a result, on newer builds of Flutter that has this change (at the time of creating this issue, at least on the dev branch [2.3.0-0.1.pre]), builds will fail due to the expectation of having two parameters rather than one.
flutter/flutter@e02621b#diff-7ea53e627d4729db3a54ab440e8f6d2610cbfc44ac4f9718daef49b2b4645f2dL1177-R1213

Change Button style

More a question than an issue. I want to change the theme / color of a button.
The button should be blue with white text color (like a primary button for a dialog).

I think it's relativly easy, but i could not get it done.

Thanks for any help. Keep up the good work ๐Ÿ‘

FluentApp error while developing in debug

From time to time i got the following error:
Unbenannt

It seems that an"empty" constructor is missing.
A hot-reload resolves the problem but i think it should be possible to resolve this error entirely to not hot-reload each time.

Add a PaneButton to list of allowed widgets for NavigationPane

Is your feature request related to a problem?
I want to call a function when pressing a button in the NavigationPane. For example pressing Save, at the moment the button will just navigate to a new screen.
image

Describe the solution you'd like
Add a new type PaneButton to the list of allowed widgets for items and footerItems. When pressing this button a function will be called instead of navigating to a new page.

Describe alternatives you've considered
Add a commandBar, which can be changed based on the selectedTabIndex

Help me understand how I can contribute.

There is a small thing I need to change, make it dynamic, I want to change the border-radius so the value can be given by a user, see attached image, can you help me know how I can do it, this can help me starting to know where I can find things in the project.
Capture

see the border-radius near the left compact menu! @bdlukaa Thank you for your good work.

Navigation Panel rework

The current implementation for Navigation Panel lacks so much funcionalities, flexibility and fidelity.

  • Top navigation
    We currently only have left navigation. On top navigation, the default page transition should be horizontal instead of vertical
  • Minimal display mode
    This would also require to do some changes to the Scaffold widget
  • Automatic display mode
    The current implementation for automatic display mode can be broken easily and it's not flexible.
  • Selected indicators
    We currently only have one selected indicator: sliding horizontally. We must add more
  • Pane footer
    Currently only one tile can be added in the footer. In the official docs, there can be multiple tiles
  • Back button
    This also would required some changes to the Scaffold widget, as well as removing Window's top bar and implement a custom one.

Learn more:

Accessibility and Diagnosticable properties

Accessibility

Provide easy-accessibility to the widgets in this library. This can be achieved by using the widget Semantics:

  • Inputs
    • Button
    • Checkbox
    • IconButton
    • RadioButton
    • RatingBar
    • Slider
    • ToggleButton
    • ToggleSwitch
  • Navigation
    • TabView
    • NavigationPanel
  • ProgressBar
  • ProgressRing
  • Tooltip

Diagnosticable properties

Add debug fill properties to the widgets so they can be viewed in DevTools to help in development. This mostly apply to the Styles

๐Ÿ› The method '_FluentTextSelectionControls.buildHandle' has fewer positional arguments than those of overridden method 'TextSelectionControls.buildHandle'.

First of all: Thanks for your work.

The app that I tried to incorporate fluent_ui (3.1.0) into, fails to compile.
I get the following error messages:

../../flutter/.pub-cache/hosted/pub.dartlang.org/fluent_ui-3.1.0/lib/src/controls/form/selection_controls.dart:50:10: Error: The method '_FluentTextSelectionControls.buildHandle' has fewer positional arguments than those of overridden method 'TextSelectionControls.buildHandle'.
Widget buildHandle(

../../flutter/packages/flutter/lib/src/widgets/text_selection.dart:123:10: Context: This is the overridden method ('buildHandle').
Widget buildHandle(BuildContext context, TextSelectionHandleType type, double textLineHeight, [VoidCallback? onTap, double? startGlyphHeight, double? endGlyphHeight]);

../../flutter/.pub-cache/hosted/pub.dartlang.org/fluent_ui-3.1.0/lib/src/controls/form/selection_controls.dart:61:10: Error: The method '_FluentTextSelectionControls.getHandleAnchor' has fewer positional arguments than those of overridden method 'TextSelectionControls.getHandleAnchor'.
Offset getHandleAnchor(TextSelectionHandleType type, double textLineHeight) {

../../flutter/packages/flutter/lib/src/widgets/text_selection.dart:128:10: Context: This is the overridden method ('getHandleAnchor').
Offset getHandleAnchor(TextSelectionHandleType type, double textLineHeight, [double? startGlyphHeight, double? endGlyphHeight]);

Failed to compile

Error with upgrade from 2.0.3 to 2.2.1๐Ÿ›

Describe the bug
After updating the package from 2.0.3 to 2.2.1 i get the following error message:

โ•โ•โ•โ•โ•โ•โ•โ• Exception caught by rendering library โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Expected a value of type 'SkDeletable', but got one of type 'Null'
The relevant error-causing widget was
NavigationView
lib\app.dart:41

Exception caught by acrylic.dart._generateImageTileRects -> (something with the assignment of colorFilter to paint.colorFilter.
colorFilter is not in the correct internal state.

To Reproduce
I do not have the acrylic or system_theme packages.

FluentUI incompatible with system_theme Theme

When I use this code:

fluent.ThemeData(accentColor: SystemTheme.accentInstance.accent);

I get this error in VS Code:

The argument type 'Color' can't be assigned to the parameter type 'AccentColor?'.dart(argument_type_not_assignable)

Also, is there any possibility for usage like in Flutter Material UI, eg. like this:

material.ThemeData(brightness: material.Brightness.dark);

aka. using Brightness, and afterwards use it like this:

MaterialApp(theme: this.theme, darkTheme: this.darkTheme, themeMode: this.themeMode);

I know, that fluent_ui has themeMode argument, but it doesn't have theme and darkTheme args.

Is that possible?
Thanks

Mobile-focused widgets

We currently have widgets that are awesome for the desktop platform, but Flutter is cross-platform, that means the app can run on mobile devices too! Mobile Focused widgets should be implemented as well. The native implementation for the widgets below is open source, so we can get the values directly from its source.

Android

We can base ourselves on the fluent documentation for android

-ordered alphabetically-

  • Button
  • Chips

iOS

We can base ourselves on Fluent documentation for iOS

  • Chip
  • Button

Both

Widgets that apply to both platforms:

Implement menus and context menus

Menus and context menus display a list of commands or options when the user requests them. Use a menu flyout to show a single, inline menu. Use a menu bar to show a set of menus in a horizontal row, typically at the top of an app window. Each menu can have menu items and sub-menus.

Anatomy:

  • MenuBar
    - MenuBarItem (Essentially a button)
    - MenuFlyoutItem (Essentially a tappable list tile)

The animation is a SizeTransition combined with ease curve and faster duration.

More Windows 11 Updates

Continuation of #50

Note: I'll not do this updates, and if I do, it's not gonna be anytime soon

  • Update the typography (TextTheme)
  • Implement CalendarDatePicker and CalendarView
  • Implement MenuFlyout
  • Update ProgressBar
  • Implement ToggleSplitButton

Feel free to make pull requests with the implementation for the above.

๐Ÿ› Null check operator used on a null value When using Combobox

Describe the bug
Here is exception
======== Exception caught by widgets library =======================================================
The following _CastError was thrown building Combobox(dirty, dependencies: [MediaQuery], state: _ComboboxState#57f33):
Null check operator used on a null value

The relevant error-causing widget was:
Combobox file:///C:/Users/FengChendian/Documents/Code/Android/serialport_tool/lib/UI_components/title_combo_menu.dart:81:28
When the exception was thrown, this was the stack:
#0 FluentTheme.of (package:fluent_ui/src/styles/theme.dart:25:70)
#1 _ComboboxState._textStyle (package:fluent_ui/src/controls/form/combo_box.dart:1181:35)
#2 _ComboboxState.build (package:fluent_ui/src/controls/form/combo_box.dart:1320:13)
#3 StatefulElement.build (package:flutter/src/widgets/framework.dart:4691:27)
#4 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574:15)

====================================================================================================
If I replace Combobox by dropdownButton, excetion will disappear.
My code is :

  final values = <String>['Blue', 'Green', 'Yellow', 'Red'];
  String? comboBoxValue;
  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (_) => ComboMenuDataManager(
          comboBoxValue: defaultItem ?? items[0], items: items),
      child: Container(
        margin: EdgeInsets.symmetric(vertical: 8, horizontal: 6),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              '$title:',
              style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
            ),
            SizedBox(
              width: 100,
              child: Container(
                padding: EdgeInsets.all(4),
                child: Consumer<ComboMenuDataManager>(
                  builder: (_, combo, __) => SizedBox(
                    width: 200,
                    child: Combobox<String>(
                      // header: 'Colors',
                      placeholder: Text('Selected list item'),
                      isExpanded: true,
                      items: values
                          .map((e) => ComboboxItem<String>(
                        value: e,
                        child: Text(e),
                      ))
                          .toList(),
                      value: comboBoxValue,
                      onChanged: (value) {
                        print(value);
                        // if (value != null) setState(() => comboBoxValue = value);
                      },
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }

In FluentTheme.of (package:fluent_ui/src/styles/theme.dart:25:70), I found error code:

  static ThemeData of(BuildContext context) {
    return context.dependOnInheritedWidgetOfExactType<_FluentTheme>()!.data;
  }

showDialog method should return data.

When using showDialog i want to return data from the dialog to the "caller"-method that called showDialog.
The showDialog returns Future but should be Future<T?>showDialog(...).

Example "Caller":

showDialog(
      context: context,
      builder: (_) => LoginDialog(),
    ).then((result) => {
      print("Got result:"),
      print(result),
    });

Here i need the result to not be void.

Example LoginDialog:

onPressed: () => {
  Navigator.pop(context, {userController.text, passwordController.text})
},

I am passing the text values of two TextBoxes to the "caller".

If `NavigationAppBar` is null in `NavigationView` then the indicator is misaligned

fluent_ui: ^2.0.2

NavigationView(
      useAcrylic: false,
      // Uncomment this and indicator works fine.
      // appBar: NavigationAppBar(),
      content: NavigationBody(
        index: selectedIndex,
        children: [
          InputPage(),
          SettingsPage(),
          SettingsPage(),
        ],
      ),
      pane: NavigationPane(
        displayMode: PaneDisplayMode.compact,
        selected: selectedIndex,
        onChanged: (i) => setState(() => selectedIndex = i),
        items: [
          PaneItem(
            icon: const Icon(Icons.input),
            title: 'Inputs',
          ),
          PaneItem(
            icon: const Icon(Icons.format_align_center),
            title: 'Forms',
          ),
        ],
        footerItems: [
          PaneItemSeparator(),
          PaneItem(
            icon: const Icon(Icons.settings),
            title: 'About app',
          ),
        ],
      ),
    );

image

Update widgets documentation

We should update/add the widgets documentation. Classes, constructors, properties and methods should be documentated. We should also add tool snippets to some widgets.

All widgets should have their documentations reviewed and, if necessary, updated.

Match the new Windows Design System

Windows 11 marks a visual evolution of the operating system. We have evolved our design language alongside with Fluent to create a design which is human, universal and truly feels like Windows.

Learn more

Controls Preview

The following widgets needs to be updated (ordered alphabetically):

  • Button (#57)
  • Checkbox (#60)
  • ComboBox (#64)
  • ContentDialog (#54)
  • InfoBar (#63)
  • NavigationView (#52)
  • ProgressBar
  • RadioButton (#56)
  • Scrollbar (#62)
  • Slider
  • TextBox (#55)
  • ToggleButton (#57)
  • ToggleSwitch (#61)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.