diff --git a/.env.ci b/.env.ci new file mode 100644 index 00000000..4805044a --- /dev/null +++ b/.env.ci @@ -0,0 +1,3 @@ +FLUTTER_VERSION=3.27.1 +STARKNET_RPC=http://localhost:5050 +DEVNET_DUMP_PATH=/devnet-dump.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d291425f..558ec6c0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,11 +11,15 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: flutter-actions/setup-flutter@v3 with: - channel: stable - version: 3.24.3 + version: ${{ steps.load-env.outputs.flutter_version }} cache: true cache-sdk: true - uses: bluefireteam/melos-action@v3 @@ -26,11 +30,15 @@ jobs: test-unit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: flutter-actions/setup-flutter@v3 with: - channel: stable - version: 3.24.3 + version: ${{ steps.load-env.outputs.flutter_version }} cache: true cache-sdk: true - uses: bluefireteam/melos-action@v3 @@ -40,11 +48,15 @@ jobs: test-integration: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: flutter-actions/setup-flutter@v3 with: - channel: stable - version: 3.24.3 + version: ${{ steps.load-env.outputs.flutter_version }} cache: true cache-sdk: true - uses: bluefireteam/melos-action@v3 @@ -73,8 +85,12 @@ jobs: check-contracts-changes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - name: Check for changes uses: dorny/paths-filter@v3 id: changes @@ -84,8 +100,7 @@ jobs: - 'contracts/v2.6.2/**' - uses: flutter-actions/setup-flutter@v3 with: - channel: stable - version: 3.24.3 + version: ${{ steps.load-env.outputs.flutter_version }} cache: true cache-sdk: true - uses: bluefireteam/melos-action@v3 diff --git a/.github/workflows/code_health.yaml b/.github/workflows/code_health.yaml index f585f051..b73d1b91 100644 --- a/.github/workflows/code_health.yaml +++ b/.github/workflows/code_health.yaml @@ -21,9 +21,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.7 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: subosito/flutter-action@v2 with: - channel: "stable" + flutter-version: ${{ steps.load-env.outputs.flutter_version }} cache: true - uses: bluefireteam/melos-action@v3 - name: "Run Analyze" @@ -33,9 +38,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.7 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: subosito/flutter-action@v2 with: - channel: "stable" + flutter-version: ${{ steps.load-env.outputs.flutter_version }} cache: true - uses: bluefireteam/melos-action@v3 - name: "Pub Check" @@ -47,9 +57,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.7 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: subosito/flutter-action@v2 with: - channel: "stable" + flutter-version: ${{ steps.load-env.outputs.flutter_version }} cache: true - uses: bluefireteam/melos-action@v3 - name: "flutter pub get" diff --git a/.github/workflows/release-prepare.yaml b/.github/workflows/release-prepare.yaml index d8b3dcf9..9c394c53 100644 --- a/.github/workflows/release-prepare.yaml +++ b/.github/workflows/release-prepare.yaml @@ -19,7 +19,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ steps.load-env.outputs.flutter_version }} - uses: bluefireteam/melos-action@v3 with: run-versioning: ${{ inputs.prerelease == false }} diff --git a/.github/workflows/release-publish.yaml b/.github/workflows/release-publish.yaml index d56fea33..3a4bd1c4 100644 --- a/.github/workflows/release-publish.yaml +++ b/.github/workflows/release-publish.yaml @@ -13,7 +13,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ steps.load-env.outputs.flutter_version }} - uses: bluefireteam/melos-action@v3 with: publish: true diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml index 6c90cbff..fbc76343 100644 --- a/.github/workflows/release-tag.yaml +++ b/.github/workflows/release-tag.yaml @@ -15,7 +15,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Dotenv Action + id: load-env + uses: falti/dotenv-action@v1.1.4 + with: + path: .env.ci - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ steps.load-env.outputs.flutter_version }} - uses: bluefireteam/melos-action@v3 with: tag: true diff --git a/.gitignore b/.gitignore index fbb20a96..c8f3bddb 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ coverage/ .env .env.* +!.env.ci !.env.example !.env.mainnet.example !.env.devnet.example diff --git a/packages/secure_store/lib/src/biometrics_store.dart b/packages/secure_store/lib/src/biometrics_store.dart index c4d6b5e1..b42c5f2a 100644 --- a/packages/secure_store/lib/src/biometrics_store.dart +++ b/packages/secure_store/lib/src/biometrics_store.dart @@ -9,8 +9,13 @@ import 'package:secure_store/src/utils.dart'; class BiometricsStore implements SecureStore { final BiometricOptions? options; + static bool isSupportedPlatform() { + return !kIsWeb && + (Platform.isIOS || Platform.isMacOS || Platform.isAndroid); + } + BiometricsStore([this.options]) { - if (kIsWeb || !(Platform.isIOS || Platform.isMacOS || Platform.isAndroid)) { + if (!isSupportedPlatform()) { throw Exception('Biometric store not available'); } } diff --git a/packages/wallet_kit/lib/ui/button.dart b/packages/wallet_kit/lib/ui/button.dart index 83710f3c..8d826229 100644 --- a/packages/wallet_kit/lib/ui/button.dart +++ b/packages/wallet_kit/lib/ui/button.dart @@ -96,7 +96,7 @@ class CustomButton extends HookWidget { boxShadow: onPressed != null ? [ BoxShadow( - color: charcoal.withOpacity(shadowOpacity), + color: charcoal.withValues(alpha: shadowOpacity), offset: const Offset(0, 8), blurRadius: 24, ) diff --git a/packages/wallet_kit/lib/ui/input.dart b/packages/wallet_kit/lib/ui/input.dart index 80551711..80316c95 100644 --- a/packages/wallet_kit/lib/ui/input.dart +++ b/packages/wallet_kit/lib/ui/input.dart @@ -43,7 +43,7 @@ class TextInput extends StatelessWidget { borderRadius: BorderRadius.circular(8), boxShadow: [ BoxShadow( - color: charcoal.withOpacity(0.2), + color: charcoal.withValues(alpha: 0.2), offset: const Offset(0, 8), blurRadius: 24, ) diff --git a/packages/wallet_kit/lib/wallet_screens/protect_wallet_screen.dart b/packages/wallet_kit/lib/wallet_screens/protect_wallet_screen.dart index 4db70c24..4f017cb8 100644 --- a/packages/wallet_kit/lib/wallet_screens/protect_wallet_screen.dart +++ b/packages/wallet_kit/lib/wallet_screens/protect_wallet_screen.dart @@ -17,7 +17,9 @@ class ProtectWalletScreen extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final isLoading = useState(false); - final isBiometryAvailable = useFuture(BiometricsStore().isAvailable()).data; + final isBiometryAvailable = BiometricsStore.isSupportedPlatform() + ? useFuture(BiometricsStore().isAvailable()).data + : false; return Layout2( sideMargin: 32, children: [ diff --git a/packages/wallet_kit/lib/wallet_screens/settings_screen.dart b/packages/wallet_kit/lib/wallet_screens/settings_screen.dart index 57a392cc..97fff4f8 100644 --- a/packages/wallet_kit/lib/wallet_screens/settings_screen.dart +++ b/packages/wallet_kit/lib/wallet_screens/settings_screen.dart @@ -59,7 +59,7 @@ class _SettingsSection extends StatelessWidget { decoration: BoxDecoration( boxShadow: [ BoxShadow( - color: charcoal.withOpacity(0.1), + color: charcoal.withValues(alpha: 0.1), offset: const Offset(0, 8), blurRadius: 24, ), diff --git a/packages/wallet_kit/lib/widgets/nft_list.dart b/packages/wallet_kit/lib/widgets/nft_list.dart index 588a8818..9dce5d2a 100644 --- a/packages/wallet_kit/lib/widgets/nft_list.dart +++ b/packages/wallet_kit/lib/widgets/nft_list.dart @@ -78,7 +78,7 @@ class NftCard extends StatelessWidget { offset: const Offset(0, 4), blurStyle: BlurStyle.normal, blurRadius: 16, - color: Colors.black.withOpacity(0.10), + color: Colors.black.withValues(alpha: 0.10), ), ], ), @@ -141,7 +141,7 @@ class MarketplaceNftCard extends StatelessWidget { offset: const Offset(0, 4), blurStyle: BlurStyle.normal, blurRadius: 16, - color: Colors.black.withOpacity(0.10), + color: Colors.black.withValues(alpha: 0.10), ), ], ), diff --git a/packages/wallet_kit/lib/widgets/wallet_list.dart b/packages/wallet_kit/lib/widgets/wallet_list.dart index ea706f72..26b9c0e4 100644 --- a/packages/wallet_kit/lib/widgets/wallet_list.dart +++ b/packages/wallet_kit/lib/widgets/wallet_list.dart @@ -133,7 +133,7 @@ class WalletCell extends HookConsumerWidget { return ExpandableNotifier( child: Container( decoration: BoxDecoration( - color: Colors.grey.withOpacity(0.1), + color: Colors.grey.withValues(alpha: 0.1), borderRadius: BorderRadius.circular(16.0), ), child: Expandable( @@ -212,7 +212,8 @@ class AccountCell extends HookConsumerWidget { ), backgroundColor: WidgetStateProperty.all(Colors.white), side: WidgetStateProperty.all(BorderSide.none), - overlayColor: WidgetStateProperty.all(Colors.grey.withOpacity(0.05)), + overlayColor: + WidgetStateProperty.all(Colors.grey.withValues(alpha: 0.05)), shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0),