Skip to content

Commit

Permalink
latest from dev (#269)
Browse files Browse the repository at this point in the history
* 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

* Flutter 3 upgrade & MacosColor update (#248)

* chore: Update pubspec.yaml files to support Flutter 3

* chore: run dart fix --apply

* chore: migrate Scrollbar to Flutter 3

* chore: update flutter_lints & subsequent fixes

* feat: add missing functions to MacosColor

the Color class has a number of functions that MacosColor had not implemented

* chore: use super parameters

* chore: update changelog

* chore: tweak example app

Uses the new PlatformMenuBar. Also update product name.

* chore: small changelog tweak

* chore: run flutter format .

* chore: run dart fix --apply

* chore: run flutter format .

* chore: remove unused code in example

* chore: remove unused import

* chore: remove unused code

* Starter app (#251)

* chore: Update pubspec.yaml files to support Flutter 3

* chore: run dart fix --apply

* chore: migrate Scrollbar to Flutter 3

* chore: update flutter_lints & subsequent fixes

* feat: add missing functions to MacosColor

the Color class has a number of functions that MacosColor had not implemented

* chore: use super parameters

* chore: update changelog

* chore: tweak example app

Uses the new PlatformMenuBar. Also update product name.

* chore: small changelog tweak

* chore: run flutter format .

* chore: run dart fix --apply

* chore: run flutter format .

* chore: remove unused code in example

* chore: remove unused import

* feat: first pass at starter app brick

* chore: improve starter app brick

* chore: fix widget test in starter app

* feat: conditional prompts & running pub get

* chore: finalize brick

* chore: run flutter format

* chore: exclude starter app from analyzer

* Full screen opaque toolbar issue (closes #249) (#252)

* fix: don't show app window toolbar when in full screen

* chore: update README

* chore: update brick app window code

* chore: update pubspec and changelog

* chore: update actions

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

* Version 1.4.1 (#255)

* 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

* Flutter 3 upgrade & MacosColor update (#248)

* chore: Update pubspec.yaml files to support Flutter 3

* chore: run dart fix --apply

* chore: migrate Scrollbar to Flutter 3

* chore: update flutter_lints & subsequent fixes

* feat: add missing functions to MacosColor

the Color class has a number of functions that MacosColor had not implemented

* chore: use super parameters

* chore: update changelog

* chore: tweak example app

Uses the new PlatformMenuBar. Also update product name.

* chore: small changelog tweak

* chore: run flutter format .

* chore: run dart fix --apply

* chore: run flutter format .

* chore: remove unused code in example

* chore: remove unused import

* chore: remove unused code

* Starter app (#251)

* chore: Update pubspec.yaml files to support Flutter 3

* chore: run dart fix --apply

* chore: migrate Scrollbar to Flutter 3

* chore: update flutter_lints & subsequent fixes

* feat: add missing functions to MacosColor

the Color class has a number of functions that MacosColor had not implemented

* chore: use super parameters

* chore: update changelog

* chore: tweak example app

Uses the new PlatformMenuBar. Also update product name.

* chore: small changelog tweak

* chore: run flutter format .

* chore: run dart fix --apply

* chore: run flutter format .

* chore: remove unused code in example

* chore: remove unused import

* feat: first pass at starter app brick

* chore: improve starter app brick

* chore: fix widget test in starter app

* feat: conditional prompts & running pub get

* chore: finalize brick

* chore: run flutter format

* chore: exclude starter app from analyzer

* Full screen opaque toolbar issue (closes #249) (#252)

* fix: don't show app window toolbar when in full screen

* chore: update README

* chore: update brick app window code

* chore: update pubspec and changelog

* chore: update actions

Co-authored-by: Reuben Turner <groovinchip@gmail.com>

Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com>

* chore: repository, homepage fields

* chore: update readme

* feat(starter_app): Version 1.1.0

* feat(starter_app): multi-window support

* feat: starter_app 1.2.1

* chore: move brick to its own repo & go back to old pana action

* Expand remaining part of row in MacosListTile (#265)

* Expand remaining part of row #264

* Increment to version 1.4.2

* End sidebar (#267)

* chore: add missing trailing comma

* chore: improve MacosIconButton animation curve

* chore: remove false_secrets from pubspec.yaml

* feat: end sidebar

Also fixes the tests portion of the pr_prelaunch_tasks script

* feat: add "isEndSidebarShown" to MacosWindowScope

Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com>
Co-authored-by: Jon Saw <jon.saw@gmail.com>
  • Loading branch information
3 people authored Jun 30, 2022
1 parent aae8268 commit 75707a4
Show file tree
Hide file tree
Showing 58 changed files with 308 additions and 2,286 deletions.
46 changes: 24 additions & 22 deletions .github/workflows/pana_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,35 @@ name: Pana Analysis
on: [pull_request, workflow_dispatch]

jobs:
pana-analysis:
runs-on: macos-latest
package-analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Flutter
uses: subosito/flutter-action@master

- uses: axel-op/dart-package-analyzer@v3
# set an id for the current step
id: analysis
with:
channel: stable
githubToken: ${{ secrets.GITHUB_TOKEN }}

- name: Analyze package with Pana
# You can then use this id to retrieve the outputs in the next steps.
# The following step shows how to exit the workflow with an error if the total score in percentage is below 50:
- name: Check scores
env:
# NB: "analysis" is the id set above. Replace it with the one you used if different.
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
flutter pub global activate pana 0.21.5
REQUIRED_RATIO=1.0
TEMP_FILE=/tmp/pana_results.txt
# Run pana, piping the output to both stderr and into a grep to find the result in the last line.
pana --no-warning | tee /dev/stderr | tail -1 | grep -o -E '[0-9]+' > $TEMP_FILE
# Extract score and calculate ratio.
SCORE=$(cat $TEMP_FILE | head -1)
TOTAL=$(cat $TEMP_FILE | tail -1)
RATIO=$(echo "scale=2; $SCORE / $TOTAL" | bc -l)
MEETS_REQUIRED_RATIO=$(echo "$RATIO >= $REQUIRED_RATIO" | bc -l)
if [[ "$MEETS_REQUIRED_RATIO" != "1" ]]; then
echo "Score of $SCORE out of $TOTAL is a ratio of $RATIO, which is not sufficient to meet the required ratio of $REQUIRED_RATIO"
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 80 ))
then
echo Score too low!
exit 1
fi
# This step is useful for PR's coming from forks. It takes the raw JSON and formats a report from it.
- name: Format scores json
env:
JSON_OUTPUT: ${{ steps.analysis.outputs.json_output }}
run: |
TOTAL_SCORE=$(jq -r '.scores.grantedPoints' <<< "$JSON_OUTPUT")
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.5.0]
* Adds `endSidebar` to `MacosWindow`

## [1.4.2]
* Fixes RenderFlex overflowed in `MacosListTile` [#264](https://github.com/GroovinChip/macos_ui/issues/264)

## [1.4.1+1]
* Update `pubspec.yaml` with `repository` and new `homepage` field.

Expand Down
11 changes: 11 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ class _WidgetGalleryState extends State<WidgetGallery> {
subtitle: Text('tim@apple.com'),
),
),
endSidebar: Sidebar(
startWidth: 200,
minWidth: 200,
maxWidth: 300,
shownByDefault: false,
builder: (context, scrollController) {
return const Center(
child: Text('End Sidebar'),
);
},
),
child: IndexedStack(
index: pageIndex,
children: pages,
Expand Down
28 changes: 25 additions & 3 deletions example/lib/pages/buttons_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,35 @@ class _ButtonsPageState extends State<ButtonsPage> {
toolBar: ToolBar(
title: const Text('Buttons'),
titleWidth: 150.0,
leading: MacosTooltip(
message: 'Toggle Sidebar',
useMousePosition: false,
child: MacosIconButton(
icon: MacosIcon(
CupertinoIcons.sidebar_left,
color: MacosTheme.brightnessOf(context).resolve(
const Color.fromRGBO(0, 0, 0, 0.5),
const Color.fromRGBO(255, 255, 255, 0.5),
),
size: 20.0,
),
boxConstraints: const BoxConstraints(
minHeight: 20,
minWidth: 20,
maxWidth: 48,
maxHeight: 38,
),
onPressed: () => MacosWindowScope.of(context).toggleSidebar(),
),
),
actions: [
ToolBarIconButton(
label: 'Toggle Sidebar',
label: 'Toggle End Sidebar',
tooltipMessage: 'Toggle End Sidebar',
icon: const MacosIcon(
CupertinoIcons.sidebar_left,
CupertinoIcons.sidebar_right,
),
onPressed: () => MacosWindowScope.of(context).toggleSidebar(),
onPressed: () => MacosWindowScope.of(context).toggleEndSidebar(),
showLabel: false,
),
],
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.4.1+1"
version: "1.5.0"
matcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/buttons/icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MacosIconButtonState extends State<MacosIconButton>
vsync: this,
);
_opacityAnimation = _animationController
.drive(CurveTween(curve: Curves.decelerate))
.drive(CurveTween(curve: const Interval(0.0, 0.25)))
.drive(_opacityTween);
_setTween();
}
Expand Down
40 changes: 22 additions & 18 deletions lib/src/layout/macos_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,30 @@ class MacosListTile extends StatelessWidget {
children: [
if (leading != null) leading!,
SizedBox(width: leadingWhitespace),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DefaultTextStyle(
style: MacosTheme.of(context).typography.headline.copyWith(
fontWeight: FontWeight.bold,
),
child: title,
),
if (subtitle != null)
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DefaultTextStyle(
style:
MacosTheme.of(context).typography.subheadline.copyWith(
color: MacosTheme.brightnessOf(context).isDark
? MacosColors.systemGrayColor
: const MacosColor(0xff88888C),
),
child: subtitle!,
style: MacosTheme.of(context).typography.headline.copyWith(
fontWeight: FontWeight.bold,
),
child: title,
),
],
if (subtitle != null)
DefaultTextStyle(
style: MacosTheme.of(context)
.typography
.subheadline
.copyWith(
color: MacosTheme.brightnessOf(context).isDark
? MacosColors.systemGrayColor
: const MacosColor(0xff88888C),
),
child: subtitle!,
),
],
),
),
],
),
Expand Down
8 changes: 8 additions & 0 deletions lib/src/layout/sidebar/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Sidebar {
this.top,
this.bottom,
this.topOffset = 51.0,
this.shownByDefault = true,
}) : dragClosedBuffer = dragClosedBuffer ?? minWidth / 2;

/// The builder that creates a child to display in this widget, which will
Expand Down Expand Up @@ -111,4 +112,11 @@ class Sidebar {
///
/// Defaults to `51.0` which levels it up with the default height of the [TitleBar]
final double topOffset;

/// Whether the sidebar should be open by default or not.
///
/// Most useful for end sidebars.
///
/// Defaults to `true`.
final bool shownByDefault;
}
Loading

0 comments on commit 75707a4

Please sign in to comment.