Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
4bg0P authored Feb 14, 2025
2 parents c6be69a + 89cf512 commit d0d9299
Show file tree
Hide file tree
Showing 34 changed files with 397 additions and 318 deletions.
2 changes: 1 addition & 1 deletion .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.24.2
flutter-version: 3.27.1

- name: Get ID Token
uses: actions/github-script@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
- name: Set up Flutter
uses: subosito/flutter-action@ea686d7c56499339ad176e9f19c516ff6cf05a31
with:
flutter-version: 3.24.2
flutter-version: 3.27.1
cache: true

- name: Set up environment paths
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/clean-azure-blob.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: clean-azure-blob
name: Clean Widgetbook Azure Blob
on:
workflow_dispatch:

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
id-token: write
contents: read

jobs:
deploy_widgetbook_azure:
clean-azure-blob:
runs-on: ubuntu-latest

steps:
Expand All @@ -21,8 +21,20 @@ jobs:
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Clean widgetbook blob folder
- name: List blobs before cleanup
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob delete-batch --source mews-ui-widgetbook --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login
az storage blob list --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login --container-name mews-ui-widgetbook --output table
- name: Clean Widgetbook blob folder
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob delete-batch --source mews-ui-widgetbook --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login --pattern "*"
- name: List blobs after cleanup
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob list --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login --container-name mews-ui-widgetbook --output table
18 changes: 15 additions & 3 deletions .github/workflows/deploy-widgetbook-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ permissions:

jobs:
deploy_widgetbook_azure:
name: Build and deploy optimus_widgetbook to Azure
runs-on: ubuntu-latest

steps:
Expand All @@ -32,7 +33,7 @@ jobs:

- name: Build Web
run: |
melos exec --scope="optimus_widgetbook" -- "flutter build web"
melos exec --scope="optimus_widgetbook" -- "flutter build web --base-href '/app/'"
- name: Modify manifest.json
run: |
Expand All @@ -44,8 +45,19 @@ jobs:
inlineScript: |
az storage blob upload --overwrite true --container-name mews-ui-widgetbook --file optimus_widgetbook/build/web/manifest.json --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login
- name: Upload to blob storage release folder
- name: Upload index.html to the release folder
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob upload-batch --overwrite true --destination mews-ui-widgetbook/release --source optimus_widgetbook/build/web --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login
az storage blob upload --overwrite true --container-name mews-ui-widgetbook --file optimus_widgetbook/build/web/index.html --name release/index.html --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login
- name: Remove uploaded files before the batch upload
run: |
rm optimus_widgetbook/build/web/manifest.json
rm optimus_widgetbook/build/web/index.html
- name: Upload assets to the app folder
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob upload-batch --overwrite true --destination mews-ui-widgetbook/release/app --source optimus_widgetbook/build/web --account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --auth-mode login
2 changes: 1 addition & 1 deletion kiosk_mode/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mews_pedantic: ^0.34.0
mews_pedantic: ^0.35.0
flutter:
uses-material-design: true
2 changes: 1 addition & 1 deletion kiosk_mode/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mews_pedantic: ^0.34.0
mews_pedantic: ^0.35.0
flutter:
plugin:
platforms:
Expand Down
6 changes: 6 additions & 0 deletions mews_pedantic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.35.0

> Note: This release has breaking changes.
- **BREAKING** **FEAT**: [DX-3716] Upgrade to DCM 1.26.0.

## 0.34.0

> Note: This release has breaking changes.
Expand Down
2 changes: 1 addition & 1 deletion mews_pedantic/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: mews_pedantic
description: Dart and Flutter static analysis and lint rules incorporated in Mews.
version: 0.34.0
version: 0.35.0
repository: https://github.com/MewsSystems/mews-flutter

environment:
Expand Down
4 changes: 4 additions & 0 deletions optimus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.38.3+1

- **FIX**: Fix linter issues.

## 0.38.3

- **FEAT**: [DX-3575] Add groups support to OptimusSelectInputFormField (#715).
Expand Down
2 changes: 1 addition & 1 deletion optimus/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mews_pedantic: ^0.34.0
mews_pedantic: ^0.35.0
6 changes: 6 additions & 0 deletions optimus/lib/src/avatar/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class OptimusAvatar extends StatelessWidget {
this.badgeUrl,
this.isIndicatorVisible = false,
this.size = OptimusWidgetSize.medium,
this.alignment = AlignmentDirectional.center,
});

/// The title of the avatar. The title is displayed when the image is not
Expand All @@ -38,6 +39,10 @@ class OptimusAvatar extends StatelessWidget {
/// The size of the avatar.
final OptimusWidgetSize size;

/// The alignment of th Avatar inside its Stack. Defaults to
/// [AlignmentDirectional.center].
final AlignmentDirectional alignment;

bool get _isVisibleForSize =>
size == OptimusWidgetSize.medium || size == OptimusWidgetSize.large;

Expand All @@ -57,6 +62,7 @@ class OptimusAvatar extends StatelessWidget {

return Stack(
clipBehavior: Clip.none,
alignment: alignment,
children: <Widget>[
_CircleImage(
imageUrl: imageUrl,
Expand Down
2 changes: 1 addition & 1 deletion optimus/lib/src/common/field_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ class _ColoredTransitionState extends State<_ColoredTransition> {
color: widget.state == OptimusStatusBarState.empty
? _previousState
.getStatusBarColor(context.tokens)
.withOpacity(0.5)
.withValues(alpha: 0.5)
: widget.state.getStatusBarColor(context.tokens),
),
);
Expand Down
10 changes: 7 additions & 3 deletions optimus/lib/src/common/gesture_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ class AllowMultipleRawGestureDetector extends RawGestureDetector {
AllowMultipleRawGestureDetector({
super.key,
GestureTapCallback? onTap,
GestureTapDownCallback? onTapDown,
super.behavior = HitTestBehavior.opaque,
super.child,
}) : super(
behavior: HitTestBehavior.opaque,
gestures: <Type, GestureRecognizerFactory>{
AllowMultipleGestureRecognizer:
GestureRecognizerFactoryWithHandlers<
AllowMultipleGestureRecognizer>(
AllowMultipleGestureRecognizer.new,
(AllowMultipleGestureRecognizer instance) =>
instance.onTap = onTap,
(AllowMultipleGestureRecognizer instance) {
instance
..onTap = onTap
..onTapDown = onTapDown;
},
),
},
);
Expand Down
30 changes: 0 additions & 30 deletions optimus/lib/src/common/state_property.dart

This file was deleted.

20 changes: 18 additions & 2 deletions optimus/lib/src/dropdown/dropdown_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class DropdownSelect<T> extends StatefulWidget {
State<DropdownSelect<T>> createState() => _DropdownSelectState<T>();
}

class _DropdownSelectState<T> extends State<DropdownSelect<T>> {
class _DropdownSelectState<T> extends State<DropdownSelect<T>>
with WidgetsBindingObserver {
final _fieldBoxKey = GlobalKey();

FocusNode? _focusNode;
Expand All @@ -111,6 +112,7 @@ class _DropdownSelectState<T> extends State<DropdownSelect<T>> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
_effectiveFocusNode.addListener(_onFocusChanged);
}

Expand All @@ -120,8 +122,22 @@ class _DropdownSelectState<T> extends State<DropdownSelect<T>> {
}
}

@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
switch (state) {
case AppLifecycleState.paused:
case AppLifecycleState.detached:
_removeOverlay();
case AppLifecycleState.resumed:
case AppLifecycleState.inactive:
case AppLifecycleState.hidden:
}
}

@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
_effectiveFocusNode.removeListener(_onFocusChanged);
_focusNode?.dispose();
_controller?.dispose();
Expand Down Expand Up @@ -262,7 +278,7 @@ class _DropdownSelectState<T> extends State<DropdownSelect<T>> {
}
}

return GestureDetector(
return AllowMultipleRawGestureDetector(
key: const Key('OptimusDropdownOverlay'),
behavior: HitTestBehavior.translucent,
onTapDown: handleTapDown,
Expand Down
Loading

0 comments on commit d0d9299

Please sign in to comment.