This commit is contained in:
Andrei Diaconu 2022-05-05 17:33:29 +03:00
Родитель cba2ffa856
Коммит 3b6d19f355
11 изменённых файлов: 14 добавлений и 37 удалений

Просмотреть файл

@ -1,6 +1,5 @@
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/companion_pane/data.dart';
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:flutter/material.dart';
class CompanionPane extends StatelessWidget {

Просмотреть файл

@ -1,6 +1,5 @@
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/dual_view_notepad/data.dart';
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:google_fonts/google_fonts.dart';

Просмотреть файл

@ -1,9 +1,6 @@
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/dual_view_restaurants/data.dart';
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'mock_widgets.dart';

Просмотреть файл

@ -1,8 +1,6 @@
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/dual_view_restaurants/data.dart';
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
/// Shows a summary of a restaurant.
///

Просмотреть файл

@ -1,7 +1,7 @@
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/dual_view_restaurants/data.dart';
import 'package:dual_screen_samples/dual_view_restaurants/dual_view_restaurants.dart';
import 'package:dual_screen_samples/dual_view_restaurants/mock_widgets.dart';
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:flutter/material.dart';
class ExtendedCanvas extends StatefulWidget {

Просмотреть файл

@ -1,5 +1,4 @@
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:flutter/material.dart';
class ListDetail extends StatefulWidget {

Просмотреть файл

@ -1,14 +0,0 @@
import 'dart:ui';
import 'package:flutter/widgets.dart';
/// Extension method that helps with working with the hinge specifically.
extension MediaQueryHinge on MediaQueryData {
DisplayFeature? get hinge {
for (final DisplayFeature e in displayFeatures) {
if (e.type == DisplayFeatureType.hinge)
return e;
}
return null;
}
}

Просмотреть файл

@ -1,4 +1,4 @@
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/two_page/data.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Просмотреть файл

@ -70,14 +70,14 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.0.2"
dual_screen:
dependency: "direct main"
description:
name: dual_screen
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2+2"
version: "1.0.3"
fake_async:
dependency: transitive
description:
@ -141,7 +141,7 @@ packages:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
version: "2.3.2"
http:
dependency: transitive
description:
@ -246,7 +246,7 @@ packages:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.12"
version: "2.0.13"
path_provider_ios:
dependency: transitive
description:
@ -405,14 +405,14 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.20"
version: "6.1.0"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.15"
version: "6.0.16"
url_launcher_ios:
dependency: transitive
description:
@ -475,7 +475,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.1"
version: "2.5.2"
wkt_parser:
dependency: transitive
description:

Просмотреть файл

@ -13,7 +13,7 @@ dependencies:
google_fonts: ^2.0.0
flutter_markdown: ^0.6.2
flutter_map: ^0.12.0
dual_screen: ^1.0.2+2
dual_screen: ^1.0.3
dev_dependencies:
flutter_test:

Просмотреть файл

@ -1,5 +1,4 @@
import 'package:dual_screen/dual_screen.dart';
import 'package:dual_screen_samples/mediaquery_hinge.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@ -13,18 +12,18 @@ void mockHingeAngleStream(List<double> multipleSensorValues) {
const StandardMethodCodec standardMethod = StandardMethodCodec();
String channelName = 'com.microsoft.flutterdualscreen/hinge_angle';
ServicesBinding.instance!.defaultBinaryMessenger
ServicesBinding.instance.defaultBinaryMessenger
.setMockMessageHandler(channelName, (ByteData? message) async {
final MethodCall methodCall = standardMethod.decodeMethodCall(message);
if (methodCall.method == 'listen') {
multipleSensorValues.forEach((element) {
ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage(
ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage(
channelName,
standardMethod.encodeSuccessEnvelope(element),
(ByteData? reply) {},
);
});
ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage(
ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage(
channelName,
null,
(ByteData? reply) {},
@ -38,7 +37,7 @@ void mockHingeAngleStream(List<double> multipleSensorValues) {
});
addTearDown(() {
ServicesBinding.instance!.defaultBinaryMessenger
ServicesBinding.instance.defaultBinaryMessenger
.setMockMessageHandler(channelName, null);
});
}