Skip to content

Commit

Permalink
Merge branch 'master' into fix/issue-228-unwrap-path
Browse files Browse the repository at this point in the history
  • Loading branch information
jhomlala authored Sep 29, 2024
2 parents db14e24 + 8a55c09 commit 555e914
Show file tree
Hide file tree
Showing 12 changed files with 618 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ class _AliceCallsListPageState extends State<AliceCallsListPage>

/// Called when save to file has been pressed. It saves data to file.
void _saveToFile() async {
if (!mounted) return;
final result = await aliceCore.saveCallsToFile(context);
if (result.success && result.path != null) {

if (result.success && result.path != null) {
AliceGeneralDialog.show(
context: context,
title: context.i18n(AliceTranslationKey.saveSuccessTitle),
Expand Down Expand Up @@ -309,7 +311,7 @@ class _AliceCallsListPageState extends State<AliceCallsListPage>
Future<void> _onSortPressed() async {
AliceSortDialogResult? result = await showDialog<AliceSortDialogResult>(
context: context,
builder: (BuildContext buildContext) => AliceSortDialog(
builder: (_) => AliceSortDialog(
sortOption: _sortOption,
sortAscending: _sortAscending,
),
Expand Down
2 changes: 1 addition & 1 deletion packages/alice/lib/ui/common/alice_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AliceGeneralDialog {
}) =>
showDialog<void>(
context: context,
builder: (BuildContext buildContext) {
builder: (BuildContext context) {
return Theme(
data: AliceTheme.getTheme(),
child: AlertDialog(
Expand Down
2 changes: 1 addition & 1 deletion packages/alice/lib/ui/common/alice_navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AliceNavigation {
return Navigator.push<void>(
context,
MaterialPageRoute(
builder: (context) => child,
builder: (_) => child,
),
);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/alice_chopper/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Added lint for trailing commas.
* General refactor of code base.
* Added support for form data.
* Added tests.

# 1.0.5

Expand Down
10 changes: 10 additions & 0 deletions packages/alice_chopper/lib/alice_chopper_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'dart:async' show FutureOr;
import 'dart:convert' show utf8;
import 'dart:io' show HttpHeaders;

import 'package:alice/model/alice_form_data_file.dart';
import 'package:alice/model/alice_from_data_field.dart';
import 'package:flutter/foundation.dart';
import 'package:alice/core/alice_adapter.dart';
import 'package:alice/core/alice_utils.dart';
Expand Down Expand Up @@ -65,6 +67,14 @@ class AliceChopperAdapter with AliceAdapter implements Interceptor {
..headers = chain.request.headers
..contentType =
chain.request.headers[HttpHeaders.contentTypeHeader] ?? 'unknown'
..formDataFields = chain.request.parts
.whereType<PartValue>()
.map((field) => AliceFormDataField(field.name, field.value))
.toList()
..formDataFiles = chain.request.parts
.whereType<PartValueFile>()
.map((file) => AliceFormDataFile(file.value, "", 0))
.toList()
..queryParameters = chain.request.parameters)
..response = AliceHttpResponse(),
);
Expand Down
8 changes: 8 additions & 0 deletions packages/alice_chopper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ dependencies:

dev_dependencies:
flutter_lints: ^4.0.0
test: ^1.25.2
alice_test: ^1.0.0
mocktail: ^1.0.4
build_runner: ^2.4.9
chopper_generator: ^8.0.0
json_serializable: ^6.8.0
json_annotation: ^4.9.0
equatable: ^2.0.5
Loading

0 comments on commit 555e914

Please sign in to comment.