[Flutter] fix dependency

This commit is contained in:
Christian Pauly 2019-10-04 09:44:32 +00:00
parent 97d3f1ece3
commit 846cc4b0fa
16 changed files with 97 additions and 154 deletions

View file

@ -14,10 +14,8 @@ coverage:
coverage: '/^\s+lines.+: (\d+.\d*%)/'
dependencies: []
script:
- sudo apt-get update -qq && sudo apt-get install -qq apt-transport-https curl gnupg lcov git
- ./scripts/test.sh
- ./scripts/coverage.sh
- flutter pub pub publish --dry-run
- flutter pub get
- flutter pub run test
code_analyze:
image: cirrusci/flutter

View file

@ -33,7 +33,6 @@ The Detail part of the pattern should be a short description of what the branch
## Commit Messages
Commit Messages should get written in this pattern: `[[Module Name]] [Commit Message]`.
That means for example: "[users] add fetch users endpoint".

View file

@ -28,7 +28,6 @@ import 'dart:core';
import 'package:famedlysdk/src/Room.dart';
import 'package:famedlysdk/src/RoomList.dart';
import 'package:famedlysdk/src/utils/MatrixFile.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:mime_type/mime_type.dart';
@ -46,13 +45,7 @@ enum HTTPType { GET, POST, PUT, DELETE }
class Connection {
final Client client;
Connection(this.client) {
WidgetsBinding.instance
?.addObserver(_LifecycleEventHandler(resumeCallBack: () {
_sync();
return;
}));
}
Connection(this.client);
static String syncFilters = '{"room":{"state":{"lazy_load_members":true}}}';
@ -134,11 +127,11 @@ class Connection {
///
/// Sends [LoginState.logged] to [onLoginStateChanged].
void connect(
{@required String newToken,
@required String newHomeserver,
@required String newUserID,
@required String newDeviceName,
@required String newDeviceID,
{String newToken,
String newHomeserver,
String newUserID,
String newDeviceName,
String newDeviceID,
List<String> newMatrixVersions,
bool newLazyLoadMembers,
String newPrevBatch}) async {
@ -505,27 +498,4 @@ class Connection {
}
}
typedef _FutureVoidCallback = Future<void> Function();
class _LifecycleEventHandler extends WidgetsBindingObserver {
_LifecycleEventHandler({this.resumeCallBack, this.suspendingCallBack});
final _FutureVoidCallback resumeCallBack;
final _FutureVoidCallback suspendingCallBack;
@override
Future<Null> didChangeAppLifecycleState(AppLifecycleState state) async {
switch (state) {
case AppLifecycleState.inactive:
case AppLifecycleState.paused:
case AppLifecycleState.suspending:
if (suspendingCallBack != null) await suspendingCallBack();
break;
case AppLifecycleState.resumed:
if (resumeCallBack != null) await resumeCallBack();
break;
}
}
}
enum LoginState { logged, loggedOut }

View file

@ -20,7 +20,6 @@
* You should have received a copy of the GNU General Public License
* along with famedly. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:flutter/widgets.dart';
import 'package:json_annotation/json_annotation.dart';
part 'SetPushersRequest.g.dart';
@ -48,13 +47,13 @@ class SetPushersRequest {
bool append;
SetPushersRequest({
@required this.lang,
@required this.device_display_name,
@required this.app_display_name,
@required this.app_id,
@required this.kind,
@required this.pushkey,
@required this.data,
this.lang,
this.device_display_name,
this.app_display_name,
this.app_id,
this.kind,
this.pushkey,
this.data,
this.profile_tag,
this.append,
});

View file

@ -8,13 +8,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.36.3"
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
args:
dependency: transitive
description:
@ -148,16 +141,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.9"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
front_end:
dependency: transitive
description:
@ -207,13 +190,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.3"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
io:
dependency: transitive
description:
@ -284,6 +260,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.4"
multi_server_socket:
dependency: transitive
description:
name: multi_server_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
node_preamble:
dependency: transitive
description:
name: node_preamble
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.8"
package_config:
dependency: transitive
description:
@ -312,13 +302,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
pool:
dependency: transitive
description:
@ -354,6 +337,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.5"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
shelf_static:
dependency: transitive
description:
name: shelf_static
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.8"
shelf_web_socket:
dependency: transitive
description:
@ -361,11 +358,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
@ -373,6 +365,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.4+2"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.5"
source_maps:
dependency: transitive
description:
name: source_maps
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.8"
source_span:
dependency: transitive
description:
@ -415,13 +421,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
test:
dependency: "direct dev"
description:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.5"
version: "0.2.8"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.10"
timing:
dependency: transitive
description:
@ -436,13 +456,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
vector_math:
vm_service:
dependency: transitive
description:
name: vector_math
name: vm_service
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.1"
watcher:
dependency: transitive
description:
@ -457,13 +477,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.13"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
yaml:
dependency: transitive
description:
@ -472,4 +485,4 @@ packages:
source: hosted
version: "2.1.16"
sdks:
dart: ">=2.4.0 <3.0.0"
dart: ">=2.3.0-dev.0.1 <3.0.0"

View file

@ -8,21 +8,12 @@ environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+2
mime_type: ^0.2.4
#intl: ^0.16.0
json_annotation: ^2.4.0
dev_dependencies:
flutter_test:
sdk: flutter
test: ^1.0.0
build_runner: ^1.5.2
json_serializable: ^3.0.0
pedantic: ^1.5.0 # DO NOT UPDATE AS THIS WOULD CAUSE FLUTTER TO FAIL
flutter:
pedantic: ^1.5.0 # DO NOT UPDATE AS THIS WOULD CAUSE FLUTTER TO FAIL

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
if [ -d "coverage" ]
then
ls -A ./coverage
if [ -z "$(ls -A ./coverage)" ]; then
exit 0
else
if [ -f "coverage/lcov.info" ]
then
genhtml -o coverage coverage/lcov.info || exit 0
else
exit 0
fi
fi
else
exit 0
fi

View file

@ -1,11 +0,0 @@
#!/usr/bin/env bash
if [ -d test ]
then
if [ -z "$(ls -A test)" ]; then
exit 0
else
flutter test --coverage
fi
else
exit 0
fi

View file

@ -21,7 +21,7 @@
* along with famedlysdk. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
import 'package:famedlysdk/src/utils/ChatTime.dart';
void main() {

View file

@ -35,7 +35,7 @@ import 'package:famedlysdk/src/sync/EventUpdate.dart';
import 'package:famedlysdk/src/sync/RoomUpdate.dart';
import 'package:famedlysdk/src/sync/UserUpdate.dart';
import 'package:famedlysdk/src/utils/MatrixFile.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
import 'FakeMatrixApi.dart';
@ -50,15 +50,12 @@ void main() {
group("FluffyMatrix", () {
/// Check if all Elements get created
final create = (WidgetTester tester) {
matrix = Client("testclient", debug: true);
matrix.connection.httpClient = FakeMatrixApi();
matrix = Client("testclient", debug: true);
matrix.connection.httpClient = FakeMatrixApi();
roomUpdateListFuture = matrix.connection.onRoomUpdate.stream.toList();
eventUpdateListFuture = matrix.connection.onEvent.stream.toList();
userUpdateListFuture = matrix.connection.onUserEvent.stream.toList();
};
testWidgets('should get created', create);
roomUpdateListFuture = matrix.connection.onRoomUpdate.stream.toList();
eventUpdateListFuture = matrix.connection.onEvent.stream.toList();
userUpdateListFuture = matrix.connection.onUserEvent.stream.toList();
test('Login', () async {
Future<ErrorResponse> errorFuture =
@ -250,9 +247,13 @@ void main() {
expect(eventUpdateList[1].type == "account_data", true);
});
testWidgets('should get created', create);
test('Login', () async {
matrix = Client("testclient", debug: true);
matrix.connection.httpClient = FakeMatrixApi();
roomUpdateListFuture = matrix.connection.onRoomUpdate.stream.toList();
eventUpdateListFuture = matrix.connection.onEvent.stream.toList();
userUpdateListFuture = matrix.connection.onUserEvent.stream.toList();
final bool checkResp =
await matrix.checkServer("https://fakeServer.notExisting");

View file

@ -25,7 +25,7 @@ import 'dart:convert';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:famedlysdk/src/RoomState.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
import 'FakeMatrixApi.dart';

View file

@ -21,7 +21,7 @@
* along with famedlysdk. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
import 'package:famedlysdk/src/Client.dart';
import 'package:famedlysdk/src/utils/MxContent.dart';

View file

@ -27,7 +27,7 @@ import 'package:famedlysdk/src/User.dart';
import 'package:famedlysdk/src/sync/EventUpdate.dart';
import 'package:famedlysdk/src/sync/RoomUpdate.dart';
import 'package:famedlysdk/src/utils/ChatTime.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
void main() {
/// All Tests related to the MxContent

View file

@ -29,7 +29,7 @@ import 'package:famedlysdk/src/Timeline.dart';
import 'package:famedlysdk/src/User.dart';
import 'package:famedlysdk/src/utils/ChatTime.dart';
import 'package:famedlysdk/src/utils/MatrixFile.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
import 'FakeMatrixApi.dart';

View file

@ -21,7 +21,7 @@
* along with famedlysdk. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
import 'package:famedlysdk/src/Client.dart';
import 'package:famedlysdk/src/Room.dart';
import 'package:famedlysdk/src/Timeline.dart';

View file

@ -23,7 +23,7 @@
import 'package:famedlysdk/src/RoomState.dart';
import 'package:famedlysdk/src/User.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:test/test.dart';
void main() {
/// All Tests related to the Event