Skip to content

Commit

Permalink
chore(cat-voices): update flutter version (#1775)
Browse files Browse the repository at this point in the history
* chore: update flutter constraints

* chore: address warnings

* chore: bump ci version for testing

* fix: segments button icon color

* chore: test update ci

* chore: test

* chore: bump ci ver

* chore: use latest ci version

---------

Co-authored-by: Oleksandr Prokhorenko <djminikin@gmail.com>
  • Loading branch information
damian-molinski and minikin authored Feb 5, 2025
1 parent 2784783 commit 6cc4285
Show file tree
Hide file tree
Showing 66 changed files with 135 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flutter-publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.24.1
flutter-version: 3.27.3
- uses: bluefireteam/melos-action@v3
with:
run-versioning: true
Expand Down
6 changes: 3 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.31 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.31 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.31 AS postgresql-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.35 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.35 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.35 AS postgresql-ci

FROM debian:stable-slim

Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.31 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.35 AS rust-ci
IMPORT ../ AS repo-ci

#cspell: words rustfmt toolsets USERARCH stdcfgs
Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/event-db/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# the database and its associated software.
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.34 AS postgresql-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.35 AS postgresql-ci

# cspell: words

Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/tests/Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION 0.8
IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.2.31 AS spectral-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.2.35 AS spectral-ci
IMPORT .. AS gateway

# INSTALL_SCYLLA - Installs scylla for bookworm-slim/debian
Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/tests/api_tests/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.2.31 AS python-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.2.35 AS python-ci

builder:
FROM python-ci+python-base
Expand Down
4 changes: 2 additions & 2 deletions catalyst_voices/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
VERSION 0.8

IMPORT ../catalyst-gateway AS catalyst-gateway
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.33 AS flutter-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.35 AS flutter-ci


# repo-catalyst-voices - Creates artifacts of all configuration files,
# packages and folders related to catalyst_voices frontend.
Expand Down Expand Up @@ -76,7 +77,6 @@ code-generator:
# restore current working directory to the root of the project
WORKDIR /frontend


# Runs static analysis on the code.
check-static-analysis:
FROM +code-generator
Expand Down
2 changes: 1 addition & 1 deletion catalyst_voices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This repository contains the Catalyst Voices app and packages.

## Requirements

* flutter: 3.24.1+
* flutter: 3.27.3+
* Dart: 3.5.0+
* Ruby: 2.5+
* Xcode: 15.0+
Expand Down
4 changes: 2 additions & 2 deletions catalyst_voices/apps/voices/lib/common/ext/space_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ extension SpaceExt on Space {

Color backgroundColor(BuildContext context) => switch (this) {
Space.discovery =>
Theme.of(context).colors.iconsSecondary.withOpacity(0.16),
Theme.of(context).colors.iconsSecondary.withValues(alpha: 0.16),
Space.workspace => Theme.of(context).colorScheme.primaryContainer,
Space.voting => Theme.of(context).colors.warningContainer,
Space.fundedProjects =>
Theme.of(context).colors.iconsSecondary.withOpacity(0.16),
Theme.of(context).colors.iconsSecondary.withValues(alpha: 0.16),
Space.treasury => Theme.of(context).colors.successContainer,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _CampaignStatusIndicator extends StatelessWidget {
decoration: BoxDecoration(
color: currentStatus == campaignStatus
? theme.colors.success
: theme.colors.onSurfaceNeutral012.withOpacity(.12),
: theme.colors.onSurfaceNeutral012.withValues(alpha: .12),
borderRadius: BorderRadius.circular(8),
),
child: Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ final class _BackgroundColor implements WidgetStateProperty<Color?> {
@override
Color? resolve(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return colors.onSurfacePrimaryContainer.withOpacity(0.12);
return colors.onSurfacePrimaryContainer.withValues(alpha: 0.12);
}

return Colors.transparent;
Expand All @@ -181,7 +181,7 @@ final class _ForegroundColor implements WidgetStateProperty<Color?> {
@override
Color? resolve(Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return colors.textOnPrimaryLevel0.withOpacity(0.3);
return colors.textOnPrimaryLevel0.withValues(alpha: 0.3);
}

return colors.textOnPrimaryLevel0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CampaignCategoryCard extends StatelessWidget {
color: context.colors.elevationsOnSurfaceNeutralLv1White,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: context.colors.outlineBorderVariant.withOpacity(.38),
color: context.colors.outlineBorderVariant.withValues(alpha: .38),
),
),
clipBehavior: Clip.antiAlias,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CommentCard extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: Theme.of(context).colorScheme.outline.withOpacity(.38),
color: Theme.of(context).colorScheme.outline.withValues(alpha: .38),
width: 1,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class _FundsAndComments extends StatelessWidget {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
decoration: BoxDecoration(
color: Theme.of(context).colors.success.withOpacity(0.08),
color: Theme.of(context).colors.success.withValues(alpha: 0.08),
borderRadius: BorderRadius.circular(8),
),
child: Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final class _ProposalBorderColor extends WidgetStateColor {
required this.publishStage,
required this.colors,
required this.colorScheme,
}) : super(colors.outlineBorder.value);
}) : super(colors.outlineBorder.toARGB32());

@override
Color resolve(Set<WidgetState> states) {
Expand Down Expand Up @@ -291,7 +291,7 @@ class _FundsAndDuration extends StatelessWidget {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primary.withOpacity(0.12),
color: Theme.of(context).colorScheme.primary.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(8),
),
child: SizedBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ class _DisplayingValueAsSegmentedButton extends StatelessWidget {
selectedBackgroundColor: value
? Theme.of(context).colors.success
: Theme.of(context).colors.iconsError,
iconColor: value
? Theme.of(context).colors.successContainer
: Colors.transparent,
),
showSelectedIcon: false,
selected: {value},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:catalyst_voices/common/ext/document_property_schema_ext.dart';
import 'package:catalyst_voices/widgets/dropdown/voices_dropdown.dart';
import 'package:catalyst_voices_models/catalyst_voices_models.dart';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localized_locales/flutter_localized_locales.dart';

Expand Down Expand Up @@ -38,7 +37,7 @@ class _LanguageCodeWidgetState extends State<LanguageCodeWidget> {
? DropdownMenuEntry(value: e, label: label)
: null;
})
.whereNotNull()
.nonNulls
.toList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class _Background extends StatelessWidget {
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.black.withOpacity(0),
Colors.black.withOpacity(0.4),
Colors.black.withOpacity(0.4),
Colors.black.withValues(alpha: 0),
Colors.black.withValues(alpha: 0.4),
Colors.black.withValues(alpha: 0.4),
],
stops: const [
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ final class _CellBackgroundColor extends WidgetStateProperty<Color?> {
@override
Color? resolve(Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return theme.colorScheme.onSurface.withOpacity(0.08);
return theme.colorScheme.onSurface.withValues(alpha: 0.08);
}

if (states.contains(WidgetState.focused)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ final class _CellBackgroundColor extends WidgetStateProperty<Color> {
@override
Color resolve(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return theme.colorScheme.primary.withOpacity(0.12);
return theme.colorScheme.primary.withValues(alpha: 0.12);
}

return theme.colorScheme.primary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class TimezoneDateTimeText extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Theme.of(context);
final textTheme = theme.textTheme;
final timezone = context.select<SessionCubit, TimezonePreferences>(
(value) => value.state.settings.timezone,
final timezone = context.select<SessionCubit?, TimezonePreferences>(
(value) => value?.state.settings.timezone ?? TimezonePreferences.local,
);

final effectiveData = switch (timezone) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@ class _VoicesTextFieldState extends State<VoicesTextField> {
case VoicesTextFieldStatus.none:
return null;
case VoicesTextFieldStatus.success:
return VoicesAssets.icons.checkCircle.buildIcon(color: color);
return VoicesAssets.icons.checkCircle.buildIcon(
color: color,
fit: BoxFit.scaleDown,
);
case VoicesTextFieldStatus.warning:
// TODO(dtscalac): this is not the right icon, it should be outlined
// & rounded, ask designers to provide it and update it
Expand Down
4 changes: 2 additions & 2 deletions catalyst_voices/apps/voices/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: none

environment:
sdk: ">=3.5.0 <4.0.0"
flutter: ">=3.24.1"
flutter: ">=3.27.3"

dependencies:
animated_text_kit: ^4.2.2
Expand All @@ -32,7 +32,7 @@ dependencies:
path: ../../packages/internal/catalyst_voices_shared
catalyst_voices_view_models:
path: ../../packages/internal/catalyst_voices_view_models
collection: ^1.18.0
collection: ^1.19.0
dotted_border: ^2.1.0
equatable: ^2.0.7
file_picker: ^8.0.7
Expand Down
4 changes: 2 additions & 2 deletions catalyst_voices/melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ command:
runPubGetInParallel: true
environment:
sdk: ">=3.5.0 <4.0.0"
flutter: ">=3.24.1"
flutter: ">=3.27.3"
dependencies:
asn1lib: ^1.5.3
bip39: ^1.0.6
bloc_concurrency: ^0.2.2
chopper: ^8.0.3
collection: ^1.18.0
collection: ^1.19.0
cryptography: ^2.7.0
dotted_border: ^2.1.0
ed25519_hd_key: ^2.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: none

environment:
sdk: ">=3.5.0 <4.0.0"
flutter: ">=3.24.1"
flutter: ">=3.27.3"

dependencies:
catalyst_voices_assets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: none

environment:
sdk: ">=3.5.0 <4.0.0"
flutter: ">=3.24.1"
flutter: ">=3.27.3"

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: none

environment:
sdk: ">=3.5.0 <4.0.0"
flutter: ">=3.24.1"
flutter: ">=3.27.3"

dependencies:
bloc_concurrency: ^0.2.2
Expand All @@ -25,7 +25,7 @@ dependencies:
path: ../catalyst_voices_shared
catalyst_voices_view_models:
path: ../catalyst_voices_view_models
collection: ^1.18.0
collection: ^1.19.0
equatable: ^2.0.7
flutter:
sdk: flutter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export 'brands/brand.dart';
export 'theme_builder/theme_builder.dart';
export 'theme_extensions/theme_extensions.dart';
export 'utils/color_ext.dart';
export 'utils/typedefs.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension TogglesTheme on ThemeData {
fillColor: WidgetStateProperty.resolveWith(
(states) {
if (states.contains(WidgetState.disabled)) {
return colors.iconsDisabled.withOpacity(0.32);
return colors.iconsDisabled.withValues(alpha: 0.32);
}

if (states.contains(WidgetState.selected)) {
Expand Down Expand Up @@ -114,7 +114,7 @@ extension TogglesTheme on ThemeData {
return colorScheme.primary;
}

return colors.outlineBorderVariant.withOpacity(0.38);
return colors.outlineBorderVariant.withValues(alpha: 0.38);
},
),
trackOutlineColor: WidgetStateProperty.resolveWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';

class VoicesDialogTheme extends DialogTheme {
VoicesDialogTheme({
super.key,
required VoicesColorScheme colors,
}) : super(
barrierColor: colors.overlay,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class VoicesSegmentedButtonTheme extends SegmentedButtonThemeData {
textStyle: textTheme.labelLarge,
).copyWith(
side: _Side(colors: voicesColors),
iconColor: _IconColor(colors: voicesColors),
),
);
}
Expand All @@ -38,3 +39,21 @@ class _Side extends WidgetStateBorderSide {
return BorderSide(color: colors.outlineBorder);
}
}

class _IconColor extends WidgetStateColor {
final VoicesColorScheme colors;

_IconColor({
required this.colors,
}) : super(
colors.iconsForeground.toARGB32(),
);

@override
Color resolve(Set<WidgetState> states) {
if (!states.contains(WidgetState.selected)) {
return colors.iconsForeground;
}
return colors.iconsBackground;
}
}
Loading

0 comments on commit 6cc4285

Please sign in to comment.