-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sidebar top (#244) * chore: refactor dir structure * feat: Sidebar top & updated default control color * feat(example): search results in top * chore: bump version, changelog * chore: run flutter pub upgrade * Update CHANGELOG.md * Update lib/src/layout/sidebar/sidebar.dart Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com> * chore: update issue templates * chore: update pr_prelaunch script Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com>
- Loading branch information
1 parent
1070730
commit fe01616
Showing
17 changed files
with
259 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c | ||
|
||
COCOAPODS: 1.10.2 | ||
COCOAPODS: 1.11.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:macos_ui/macos_ui.dart'; | ||
import 'package:macos_ui/src/library.dart'; | ||
|
||
/// A macOS style navigation-list item intended for use in a [Sidebar] | ||
/// | ||
/// See also: | ||
/// | ||
/// * [Sidebar], a side bar used alongside [MacosScaffold] | ||
/// * [SidebarItems], the widget that displays [SidebarItem]s vertically | ||
class SidebarItem with Diagnosticable { | ||
/// Creates a sidebar item. | ||
const SidebarItem({ | ||
this.leading, | ||
required this.label, | ||
this.selectedColor, | ||
this.unselectedColor, | ||
this.shape, | ||
this.focusNode, | ||
this.semanticLabel, | ||
this.disclosureItems, | ||
}); | ||
|
||
/// The widget before [label]. | ||
/// | ||
/// Typically an [Icon] | ||
final Widget? leading; | ||
|
||
/// Indicates what content this widget represents. | ||
/// | ||
/// Typically a [Text] | ||
final Widget label; | ||
|
||
/// The color to paint this widget as when selected. | ||
/// | ||
/// If null, [MacosThemeData.primaryColor] is used. | ||
final Color? selectedColor; | ||
|
||
/// The color to paint this widget as when unselected. | ||
/// | ||
/// Defaults to transparent. | ||
final Color? unselectedColor; | ||
|
||
/// The [shape] property specifies the outline (border) of the | ||
/// decoration. The shape must not be null. It's used alonside | ||
/// [selectedColor]. | ||
final ShapeBorder? shape; | ||
|
||
/// The focus node used by this item. | ||
final FocusNode? focusNode; | ||
|
||
/// The semantic label used by screen readers. | ||
final String? semanticLabel; | ||
|
||
/// The disclosure items. If null, there will be no disclosure items. | ||
/// | ||
/// If non-null and [leading] is null, a local animated icon is created | ||
final List<SidebarItem>? disclosureItems; | ||
|
||
@override | ||
void debugFillProperties(DiagnosticPropertiesBuilder properties) { | ||
super.debugFillProperties(properties); | ||
properties.add(ColorProperty('selectedColor', selectedColor)); | ||
properties.add(ColorProperty('unselectedColor', unselectedColor)); | ||
properties.add(StringProperty('semanticLabel', semanticLabel)); | ||
properties.add(DiagnosticsProperty<ShapeBorder>('shape', shape)); | ||
properties.add(DiagnosticsProperty<FocusNode>('focusNode', focusNode)); | ||
properties.add(IterableProperty<SidebarItem>( | ||
'disclosure items', | ||
disclosureItems, | ||
)); | ||
} | ||
} |
Oops, something went wrong.