Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 284 - Added leading property for NavigationPane Widget #287

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Date format: DD/MM/YYYY
- Do not use duplicated `Scrollbar`s ([#279](https://github.com/bdlukaa/fluent_ui/pull/279/))
- Allow custom height on `NavigationPane` header. ([#260](https://github.com/bdlukaa/fluent_ui/pull/260/))
- Allow to define the minimal tab width ([#282](https://github.com/bdlukaa/fluent_ui/pull/282/))
- Allow applying custom leading Widget to NavigationPane([#286](https://github.com/bdlukaa/fluent_ui/pull/287/))

## [3.10.2] - [09/04/2022]

Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import 'package:url_strategy/url_strategy.dart';
import 'package:window_manager/window_manager.dart';

import 'screens/colors.dart';
import 'screens/commandbars.dart';
import 'screens/flyouts.dart';
import 'screens/forms.dart';
import 'screens/icons.dart';
import 'screens/inputs.dart';
import 'screens/mobile.dart';
import 'screens/commandbars.dart';
import 'screens/others.dart';
import 'screens/settings.dart';
import 'screens/typography.dart';
Expand Down
3 changes: 1 addition & 2 deletions example/lib/screens/forms.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// ignore_for_file: avoid_print

import 'package:fluent_ui/fluent_ui.dart';

import 'package:email_validator/email_validator.dart';
import 'package:fluent_ui/fluent_ui.dart';

class Forms extends StatefulWidget {
const Forms({Key? key}) : super(key: key);
Expand Down
3 changes: 1 addition & 2 deletions example/lib/screens/settings.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// ignore_for_file: constant_identifier_names

import 'package:flutter/foundation.dart';

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart';
import 'package:provider/provider.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/theme.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:system_theme/system_theme.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart';
import 'package:system_theme/system_theme.dart';

enum NavigationIndicators { sticky, end }

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.10.1"
version: "3.10.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down
53 changes: 21 additions & 32 deletions lib/fluent_ui.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
library fluent_ui;

export 'package:flutter/widgets.dart' hide TextBox;
export 'package:flutter/material.dart'
show
Brightness,
Expand Down Expand Up @@ -28,43 +27,41 @@ export 'package:flutter/material.dart'
TextSelectionTheme,
TextSelectionThemeData,
SelectableText;
export 'package:flutter/widgets.dart' hide TextBox;
export 'package:scroll_pos/scroll_pos.dart';

export 'src/app.dart';
export 'src/icons.dart';
export 'src/localization.dart';
export 'src/utils.dart';

export 'src/navigation/route.dart';

export 'src/controls/navigation/bottom_navigation.dart';
export 'src/layout/page.dart';

export 'src/controls/form/auto_suggest_box.dart';
export 'src/controls/form/combo_box.dart';
export 'src/controls/form/form_row.dart';
export 'src/controls/form/pickers/date_picker.dart';
export 'src/controls/form/pickers/time_picker.dart';
export 'src/controls/form/selection_controls.dart';
export 'src/controls/form/text_box.dart';
export 'src/controls/form/text_form_box.dart';
export 'src/controls/inputs/buttons/base.dart';
export 'src/controls/inputs/buttons/theme.dart';
export 'src/controls/inputs/buttons/button.dart';
export 'src/controls/inputs/buttons/icon_button.dart';
export 'src/controls/inputs/buttons/filled_button.dart';
export 'src/controls/inputs/buttons/icon_button.dart';
export 'src/controls/inputs/buttons/outlined_button.dart';
export 'src/controls/inputs/buttons/text_button.dart';

export 'src/controls/inputs/buttons/theme.dart';
export 'src/controls/inputs/checkbox.dart';
export 'src/controls/inputs/chip.dart';
export 'src/controls/inputs/dropdown_button.dart';
export 'src/controls/inputs/pill_button_bar.dart';
export 'src/controls/inputs/radio_button.dart';
export 'src/controls/inputs/rating.dart';
export 'src/controls/inputs/slider.dart';
export 'src/controls/inputs/split_button.dart';
export 'src/controls/inputs/toggle_button.dart';
export 'src/controls/inputs/toggle_switch.dart';
export 'src/controls/inputs/slider.dart';

export 'src/controls/navigation/bottom_navigation.dart';
export 'src/controls/navigation/navigation_view/view.dart';
export 'src/controls/navigation/tab_view.dart';
export 'src/controls/navigation/tree_view.dart';

export 'src/controls/surfaces/calendar/calendar_view.dart';
export 'src/controls/surfaces/bottom_sheet.dart';
export 'src/controls/surfaces/calendar/calendar_view.dart';
export 'src/controls/surfaces/card.dart';
export 'src/controls/surfaces/commandbar.dart';
export 'src/controls/surfaces/dialog.dart';
Expand All @@ -75,30 +72,22 @@ export 'src/controls/surfaces/list_tile.dart';
export 'src/controls/surfaces/progress_indicators.dart';
export 'src/controls/surfaces/snackbar.dart';
export 'src/controls/surfaces/tooltip.dart';

export 'src/controls/utils/divider.dart';
export 'src/controls/utils/hover_button.dart';
export 'src/controls/utils/info_badge.dart';
export 'src/controls/utils/scrollbar.dart';

export 'src/controls/form/auto_suggest_box.dart';
export 'src/controls/form/text_box.dart';
export 'src/controls/form/combo_box.dart';
export 'src/controls/form/pickers/date_picker.dart';
export 'src/controls/form/pickers/time_picker.dart';
export 'src/controls/form/text_form_box.dart';
export 'src/controls/form/form_row.dart';
export 'src/controls/form/selection_controls.dart';

export 'src/icons.dart';
export 'src/layout/dynamic_overflow.dart';

export 'src/styles/motion/page_transitions.dart';
export 'src/layout/page.dart';
export 'src/localization.dart';
export 'src/navigation/route.dart';
export 'src/styles/acrylic.dart';
export 'src/styles/color.dart' hide ColorConst;
export 'src/styles/focus.dart';
export 'src/styles/mica.dart';
export 'src/styles/motion/page_transitions.dart';
export 'src/styles/theme.dart';
export 'src/styles/typography.dart';

export 'src/styles/focus.dart';
export 'src/utils.dart';
export 'src/utils/horizontal_scroll_view.dart';
export 'src/utils/label.dart';
1 change: 1 addition & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/src/controls/form/auto_suggest_box.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:ui' as ui;
import 'package:fluent_ui/fluent_ui.dart';

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';

enum TextChangedReason {
Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/form/combo_box.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import 'dart:math' as math;
import 'dart:ui' show window;

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';

import 'package:fluent_ui/fluent_ui.dart';

import 'pickers/pickers.dart';

const Duration _kComboboxMenuDuration = Duration(milliseconds: 300);
Expand Down
1 change: 0 additions & 1 deletion lib/src/controls/form/pickers/date_picker.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:fluent_ui/fluent_ui.dart';

import 'package:fluent_ui/src/utils/popup.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
Expand Down
5 changes: 2 additions & 3 deletions lib/src/controls/form/pickers/time_picker.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/foundation.dart';

import 'package:fluent_ui/src/utils/popup.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';

import 'pickers.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/src/controls/form/text_form_box.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:ui' as ui;

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
import 'package:fluent_ui/fluent_ui.dart';

/// A [FormField] that contains a [TextBox].
///
Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/inputs/buttons/base.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// import 'package:flutter/material.dart' as m;
import 'package:flutter/foundation.dart';

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';

/// {@template fluent_ui.buttons.base}
/// Buttons give people a way to trigger an action. They’re typically found in
Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/inputs/buttons/theme.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'dart:ui' show lerpDouble;

import 'package:flutter/foundation.dart';

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';

class ButtonStyle with Diagnosticable {
const ButtonStyle({
Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/inputs/checkbox.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';

import 'package:fluent_ui/fluent_ui.dart';

/// A check box is used to select or deselect action items. It can
/// be used for a single item or for a list of multiple items that
/// a user can choose from. The control has three selection states:
Expand Down
1 change: 0 additions & 1 deletion lib/src/controls/inputs/chip.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:ui' show lerpDouble;

import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/foundation.dart';

const double _kChipSpacing = 6.0;
Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/inputs/pill_button_bar.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/foundation.dart';

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';

const double _kMinHeight = 28.0;
const double _kMaxHeight = 46.0;
Expand Down
1 change: 0 additions & 1 deletion lib/src/controls/inputs/radio_button.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';

Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/inputs/slider.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'dart:math' as math;

import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/material.dart' as m;
import 'package:flutter/rendering.dart';

/// A slider is a control that lets the user select from a
/// range of values by moving a thumb control along a track.
Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/inputs/split_button.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'dart:ui' show lerpDouble;

import 'package:flutter/foundation.dart';

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';

/// A Split Button has two parts that can be invoked separately.
/// One part behaves like a standard button and invokes an immediate action.
Expand Down
13 changes: 12 additions & 1 deletion lib/src/controls/navigation/navigation_view/pane.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class NavigationPane with Diagnosticable {
this.customPane,
this.menuButton,
this.scrollController,
this.leading,
this.indicator = const StickyNavigationIndicator(),
}) : assert(selected == null || selected >= 0);

Expand Down Expand Up @@ -168,6 +169,9 @@ class NavigationPane with Diagnosticable {
/// display mode is toggled.
final ScrollController? scrollController;

/// The leading Widget for the Pane
final Widget? leading;

/// A function called when building the navigation indicator
final Widget? indicator;

Expand Down Expand Up @@ -421,7 +425,14 @@ class _TopNavigationPane extends StatelessWidget {
child: Row(key: pane.paneKey, children: [
Expanded(
child: Row(children: [
if (appBar != null) NavigationAppBar.buildLeading(context, appBar!),
if (pane.leading != null)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0,
vertical: 6.0,
),
child: pane.leading!,
),
if (pane.header != null)
Padding(
padding: const EdgeInsets.symmetric(
Expand Down
7 changes: 1 addition & 6 deletions lib/src/controls/navigation/navigation_view/view.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';

part 'body.dart';

part 'indicators.dart';

part 'pane_items.dart';

part 'pane.dart';

part 'pane_items.dart';
part 'style.dart';

/// The default size used by the app top bar.
Expand Down
1 change: 0 additions & 1 deletion lib/src/controls/navigation/tab_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/controls/surfaces/info_bar.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:ui';

import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' show Icons;

Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/surfaces/tooltip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import 'dart:async';
import 'dart:math' as math;
import 'dart:ui' show lerpDouble;

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/services.dart';

/// A tooltip is a short description that is linked to another
Expand Down
1 change: 0 additions & 1 deletion lib/src/controls/utils/hover_button.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/rendering.dart';

typedef ButtonStateWidgetBuilder = Widget Function(
Expand Down
1 change: 0 additions & 1 deletion lib/src/controls/utils/scrollbar.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:ui' show lerpDouble;

import 'package:fluent_ui/fluent_ui.dart';

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';

Expand Down
3 changes: 1 addition & 2 deletions lib/src/styles/acrylic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import 'dart:math' as math;
import 'dart:ui' show ImageFilter;
import 'dart:ui' as ui show Image;

import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' as m;

import 'package:fluent_ui/fluent_ui.dart';

const double kBlurAmount = 30.0;

const double kDefaultAcrylicAlpha = 0.8;
Expand Down
Loading