From 9c8ed13f835ad11b3b3beac0c129df2502520e19 Mon Sep 17 00:00:00 2001 From: Reuben Turner Date: Thu, 7 Jul 2022 17:10:36 -0400 Subject: [PATCH] 1.5.1 & Update actions (#280) * 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 * 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 * 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 * 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 Co-authored-by: Minas Giannekas * 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 https://github.com/GroovinChip/macos_ui/issues/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 * fix: Correct the placement of the leading widget in disclosure sidebar items (#272) * chore: Update changelog * test: fix issues with date_picker_test * Account for cases where the month and the day are the same * Fix offstage warnings by removing tester taps that disabled the caret controls * Update Actions (#279) * Update flutter_analysis.yml * Update dart_code_metrics.yaml * Update gh_pages.yml * Update pana_analysis.yml * Update codecov.yaml * fix syntax issue Co-authored-by: Minas Giannekas Co-authored-by: Jon Saw --- .github/workflows/codecov.yaml | 6 +++--- .github/workflows/dart_code_metrics.yaml | 20 +++++++++----------- .github/workflows/flutter_analysis.yml | 14 +++++++------- .github/workflows/gh_pages.yml | 6 +++--- .github/workflows/pana_analysis.yml | 4 ++-- CHANGELOG.md | 4 ++++ example/lib/main.dart | 1 + example/pubspec.lock | 2 +- lib/src/layout/sidebar/sidebar_items.dart | 11 ++++++----- pubspec.yaml | 2 +- test/selectors/date_picker_test.dart | 21 +++++++-------------- 11 files changed, 44 insertions(+), 47 deletions(-) diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 9604fb88..048861f0 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -14,7 +14,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@master - - uses: subosito/flutter-action@v1 + - uses: subosito/flutter-action@v2 with: channel: stable - name: Get flutter packages @@ -24,7 +24,7 @@ jobs: - name: Upload coverage to Codecov run: curl -s https://codecov.io/bash shell: bash - - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v3 with: token: ${{secrets.CODECOV_TOKEN}} - file: ./coverage/lcov.info \ No newline at end of file + files: ./coverage/lcov.info diff --git a/.github/workflows/dart_code_metrics.yaml b/.github/workflows/dart_code_metrics.yaml index b01bb1a1..964933df 100644 --- a/.github/workflows/dart_code_metrics.yaml +++ b/.github/workflows/dart_code_metrics.yaml @@ -6,15 +6,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install Flutter - uses: subosito/flutter-action@master - with: - channel: stable + - uses: actions/checkout@v3 - - name: Check directory - run: ls - - name: Install Code Metrics - run: flutter pub global activate dart_code_metrics - - name: Run Code Metrics - run: flutter pub global run dart_code_metrics:metrics --reporter=github lib \ No newline at end of file + - name: Run Dart Code Metrics + uses: dart-code-checker/dart-code-metrics-action@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + pull_request_comment: true + fatal_warnings: true + fatal_performance: true + fatal_style: true diff --git a/.github/workflows/flutter_analysis.yml b/.github/workflows/flutter_analysis.yml index 86ff212a..a9686ffd 100644 --- a/.github/workflows/flutter_analysis.yml +++ b/.github/workflows/flutter_analysis.yml @@ -6,21 +6,21 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Flutter - uses: subosito/flutter-action@master + uses: subosito/flutter-action@v2 with: channel: stable - - name: install dependencies + - name: Install dependencies run: flutter pub get - - name: format code + - name: Format code run: flutter format --set-exit-if-changed . - - name: analyze code - run: flutter analyze . + - name: Analyze code + run: flutter analyze --fatal-infos . - - name: test code + - name: Test code run: flutter test diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index e09c0abc..27e9df09 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -13,8 +13,8 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} steps: - - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v1 + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 with: channel: stable - name: Install Dependencies @@ -33,4 +33,4 @@ jobs: git checkout -b gh-pages git add . git commit -m "update" - git push --force secure-origin gh-pages \ No newline at end of file + git push --force secure-origin gh-pages diff --git a/.github/workflows/pana_analysis.yml b/.github/workflows/pana_analysis.yml index afbd2949..a32d6cb3 100644 --- a/.github/workflows/pana_analysis.yml +++ b/.github/workflows/pana_analysis.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: axel-op/dart-package-analyzer@v3 # set an id for the current step @@ -33,4 +33,4 @@ jobs: env: JSON_OUTPUT: ${{ steps.analysis.outputs.json_output }} run: | - TOTAL_SCORE=$(jq -r '.scores.grantedPoints' <<< "$JSON_OUTPUT") \ No newline at end of file + TOTAL_SCORE=$(jq -r '.scores.grantedPoints' <<< "$JSON_OUTPUT") diff --git a/CHANGELOG.md b/CHANGELOG.md index b19a3aa1..b4911245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.5.1] +* Correct the placement of the leading widget in disclosure sidebar items [#268](https://github.com/GroovinChip/macos_ui/issues/268) +* Improve the sizing of the disclosure item indicator + ## [1.5.0] * Adds `endSidebar` to `MacosWindow` diff --git a/example/lib/main.dart b/example/lib/main.dart index 29c401ef..e12ac6d1 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -188,6 +188,7 @@ class _WidgetGalleryState extends State { label: Text('Fields'), ), SidebarItem( + leading: Icon(CupertinoIcons.folder), label: Text('Disclosure'), disclosureItems: [ SidebarItem( diff --git a/example/pubspec.lock b/example/pubspec.lock index f652e649..a5c70a7e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -87,7 +87,7 @@ packages: path: ".." relative: true source: path - version: "1.5.0" + version: "1.5.1" matcher: dependency: transitive description: diff --git a/lib/src/layout/sidebar/sidebar_items.dart b/lib/src/layout/sidebar/sidebar_items.dart index ffd788d9..e05ddb07 100644 --- a/lib/src/layout/sidebar/sidebar_items.dart +++ b/lib/src/layout/sidebar/sidebar_items.dart @@ -338,20 +338,21 @@ class __DisclosureSidebarItemState extends State<_DisclosureSidebarItem> label: widget.item.label, leading: Row( children: [ - if (widget.item.leading != null) - Padding( - padding: EdgeInsets.only(right: spacing), - child: widget.item.leading!, - ), RotationTransition( turns: _iconTurns, child: Icon( CupertinoIcons.chevron_right, + size: 12.0, color: theme.brightness == Brightness.light ? MacosColors.black : MacosColors.white, ), ), + if (widget.item.leading != null) + Padding( + padding: EdgeInsets.only(left: spacing), + child: widget.item.leading!, + ), ], ), unselectedColor: MacosColors.transparent, diff --git a/pubspec.yaml b/pubspec.yaml index 66ec750a..ed1c8632 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: macos_ui description: Flutter widgets and themes implementing the current macOS design language. -version: 1.5.0 +version: 1.5.1 homepage: "https://macosui.dev" repository: "https://github.com/GroovinChip/macos_ui" diff --git a/test/selectors/date_picker_test.dart b/test/selectors/date_picker_test.dart index fedf0fac..98086010 100644 --- a/test/selectors/date_picker_test.dart +++ b/test/selectors/date_picker_test.dart @@ -31,9 +31,14 @@ void main() { ); expect(find.text('/'), findsNWidgets(2)); - expect(find.text('${today.day}'), findsOneWidget); - expect(find.text('${today.month}'), findsOneWidget); expect(find.text('${today.year}'), findsOneWidget); + if (today.month == today.day) { + expect(find.text('${today.day}'), findsNWidgets(2)); + expect(find.text('${today.month}'), findsNWidgets(2)); + } else { + expect(find.text('${today.day}'), findsOneWidget); + expect(find.text('${today.month}'), findsOneWidget); + } }, ); @@ -71,14 +76,10 @@ void main() { await tester.pumpAndSettle(); day++; expect(day, today.day + 1); - await tester.tap(dayFieldElement); - await tester.pumpAndSettle(); await tester.tap(downCaretControl); await tester.pumpAndSettle(); day--; expect(day, today.day); - await tester.tap(dayFieldElement); - await tester.pumpAndSettle(); await tester.tap(downCaretControl); await tester.pumpAndSettle(); day--; @@ -120,14 +121,10 @@ void main() { await tester.pumpAndSettle(); month++; expect(month, today.month + 1); - await tester.tap(monthFieldElement); - await tester.pumpAndSettle(); await tester.tap(downCaretControl); await tester.pumpAndSettle(); month--; expect(month, today.month); - await tester.tap(monthFieldElement); - await tester.pumpAndSettle(); await tester.tap(downCaretControl); await tester.pumpAndSettle(); month--; @@ -169,14 +166,10 @@ void main() { await tester.pumpAndSettle(); year++; expect(year, today.year + 1); - await tester.tap(yearFieldElement); - await tester.pumpAndSettle(); await tester.tap(downCaretControl); await tester.pumpAndSettle(); year--; expect(year, today.year); - await tester.tap(yearFieldElement); - await tester.pumpAndSettle(); await tester.tap(downCaretControl); await tester.pumpAndSettle(); year--;