Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1f95c44
feat: add pay invoice button and update trade state handling for sellers
chebizarro May 13, 2025
dcb9855
refactor: rename trade state fields and implement FSM-driven action b…
chebizarro May 14, 2025
be19c5d
refactor: consolidate order notifiers into single OrderNotifier and m…
chebizarro May 14, 2025
51c056b
refactor: consolidate provider imports and improve session management…
chebizarro May 15, 2025
66bf71c
refactor: migrate order state management from MostroMessage to OrderS…
chebizarro May 19, 2025
28e6b90
Merge remote-tracking branch 'origin/main' into issue-77
chebizarro May 27, 2025
664be52
refactor: update background service notification handling and improve…
chebizarro May 28, 2025
46dc305
refactor: streamline OrderState updates and improve session handling …
chebizarro May 28, 2025
fa214e3
refactor: adjust TradeDetailScreen to use OrderState
chebizarro May 28, 2025
23b90aa
fix: update trade detail actions and navigation flow for better UX
chebizarro May 30, 2025
0595ae2
feat: add order state actions map and release button for sellers
chebizarro May 30, 2025
f6c693c
refactor: update order state management and session handling in FSM
chebizarro May 31, 2025
0e3ffe1
refactor: migrate order notifiers to use new state management pattern
chebizarro May 31, 2025
963ddd1
refactor: optimize order deletion flow and add soft delete filter to …
chebizarro May 31, 2025
fc01b10
refactor: replace dispose() calls with ref.invalidateSelf() for prope…
chebizarro May 31, 2025
28cc133
fix: update ref.read to ref.watch for reactive order state updates
chebizarro Jun 1, 2025
fa8828b
refactor: consolidate trade state logic into order state model
chebizarro Jun 1, 2025
5fdfe7b
feat: add peer handling to OrderState and improve action flow management
chebizarro Jun 1, 2025
e0bab49
feat: add cancel action to newOrder state in order workflow
chebizarro Jun 1, 2025
bea2f00
feat: enhance order state management and error handling in MostroService
chebizarro Jun 4, 2025
ced7293
Add integration tests for order creation and update test helpers
chebizarro Jun 8, 2025
3aa6566
Merge branch 'main' into issue-77
chebizarro Jun 8, 2025
aadce3b
fix: downgrade intl package version to resolve compatibility issues
chebizarro Jun 8, 2025
e0c9906
refactor: remove system tray dependency and update packages to latest…
chebizarro Jun 8, 2025
894b5b0
feat: enhance key management and session handling with new error hand…
chebizarro Jun 10, 2025
39cc5e3
fix: ensure storage is cleared before storing new master key from mne…
chebizarro Jun 10, 2025
3027464
fix: ensure requestId and tradeIndex are properly converted to intege…
chebizarro Jun 10, 2025
e1d7fd1
fix: ensure tradeIndex and requestId are properly handled in fromJson…
chebizarro Jun 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,23 @@ jobs:
- name: Set Up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.29.0'
flutter-version: '3.32.2'
channel: 'stable'

- name: Cache Dart & Pub artifacts
uses: actions/cache@v3
with:
path: |
~/.pub-cache
.dart_tool
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.yaml') }}

- name: Install Dependencies
run: flutter pub get

- name: Generate localization and other required files
run: dart run build_runner build -d

- name: Extract version from pubspec.yaml
id: extract_version
run: |
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ This project is a mobile interface that facilitates peer-to-peer bitcoin trading
flutter pub get
```

3. Generate localization and other required files:

```bash
dart run build_runner build -d
```

> **Note:**
> These commands generate files needed by `flutter_intl` and any other code generators. You must run them after installing dependencies and whenever you update localization files or code generation sources. If you skip this step, you may encounter missing file errors when running the app.

## Running the App

### On Emulator/Simulator
Expand Down
5 changes: 2 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@
</application>

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.INTERNET" />

<queries>
Expand Down
87 changes: 87 additions & 0 deletions integration_test/new_order_with_mocks_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:flutter/material.dart';
import 'test_helpers.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Create Orders with mocked providers', () {
testWidgets('User creates BUY order with VES=100 at premium 1', (tester) async {
await pumpTestApp(tester);

final createOrderButton = find.byKey(const Key('addOrderButton'));
expect(createOrderButton, findsOneWidget);
await tester.tap(createOrderButton);
await tester.pumpAndSettle();

final buyButton = find.byKey(const Key('buyButton'));
expect(buyButton, findsOneWidget);
await tester.tap(buyButton);
await tester.pumpAndSettle();

final fiatCodeDropdown = find.byKey(const Key('fiatCodeDropdown'));
await tester.tap(fiatCodeDropdown);
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('currency_VES')));
await tester.pumpAndSettle();

await tester.enterText(find.byKey(const Key('fiatAmountField')), '100');
await tester.pumpAndSettle();

// Skipping tap on 'fixedSwitch' because default is already market and premium slider is visible
final premiumSlider = find.byKey(const Key('premiumSlider'));
await tester.drag(premiumSlider, const Offset(50, 0));
await tester.pumpAndSettle();

//final paymentMethodField = find.byKey(const Key('paymentMethodField'));
//await tester.enterText(paymentMethodField, 'face to face');
//await tester.pumpAndSettle();

await tester.tap(find.byKey(const Key('submitOrderButton')));
await tester.pumpAndSettle();

expect(find.byKey(const Key('homeButton')), findsOneWidget);
});

testWidgets('User creates SELL order with VES=100 at premium 1', (tester) async {
await pumpTestApp(tester);

final createOrderButton = find.byKey(const Key('addOrderButton'));
expect(createOrderButton, findsOneWidget);
await tester.tap(createOrderButton);
await tester.pumpAndSettle();

final sellButton = find.byKey(const Key('sellButton'));
expect(sellButton, findsOneWidget);
await tester.tap(sellButton);
await tester.pumpAndSettle();

final fiatCodeDropdown = find.byKey(const Key('fiatCodeDropdown'));
await tester.tap(fiatCodeDropdown);
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('currency_VES')));
await tester.pumpAndSettle();

await tester.enterText(find.byKey(const Key('fiatAmountField')), '100');
await tester.pumpAndSettle();

final fixedSwitch = find.byKey(const Key('fixedSwitch'));
await tester.tap(fixedSwitch);
await tester.pumpAndSettle();

final premiumSlider = find.byKey(const Key('premiumSlider'));
await tester.drag(premiumSlider, const Offset(50, 0));
await tester.pumpAndSettle();

final paymentMethodField = find.byKey(const Key('paymentMethodField'));
await tester.enterText(paymentMethodField, 'face to face');
await tester.pumpAndSettle();

await tester.tap(find.text('SUBMIT'));
await tester.pumpAndSettle();

expect(find.byKey(const Key('homeButton')), findsOneWidget);
});
});
}
Loading