iOS Dialog blur, brightness, and layout (#18381)

Rewrote CupertinoAlertDialog to look nearly identical to an alert dialog in iOS. This includes considerations for blur, translucent white background color, button sizing, gap dividers between buttons, and text scaling layout behavior. (#18381)
This commit is contained in:
matthew-carroll
2018-08-15 12:59:40 -07:00
committed by GitHub
parent 25ba90aafa
commit 21bc9f1b02
5 changed files with 2009 additions and 430 deletions

View File

@@ -273,6 +273,17 @@ abstract class WidgetController {
});
}
/// Dispatch a pointer down at the center of the given widget, assuming it is
/// exposed.
///
/// If the center of the widget is not exposed, this might send events to
/// another object.
Future<TestGesture> press(Finder finder, { int pointer }) {
return TestAsyncUtils.guard<TestGesture>(() {
return startGesture(getCenter(finder), pointer: pointer);
});
}
/// Dispatch a pointer down / pointer up sequence (with a delay of
/// [kLongPressTimeout] + [kPressTimeout] between the two events) at the
/// center of the given widget, assuming it is exposed.

View File

@@ -57,7 +57,7 @@ class TestAsyncUtils {
/// this one before this one has finished will throw an exception.
///
/// This method first calls [guardSync].
static Future<Null> guard(Future<Null> body()) {
static Future<T> guard<T>(Future<T> body()) {
guardSync();
final Zone zone = Zone.current.fork(
zoneValues: <dynamic, dynamic>{
@@ -66,8 +66,9 @@ class TestAsyncUtils {
);
final _AsyncScope scope = new _AsyncScope(StackTrace.current, zone);
_scopeStack.add(scope);
final Future<Null> result = scope.zone.run(body);
Future<Null> completionHandler(dynamic error, StackTrace stack) {
final Future<T> result = scope.zone.run<Future<T>>(body);
T resultValue; // This is set when the body of work completes with a result value.
Future<T> completionHandler(dynamic error, StackTrace stack) {
assert(_scopeStack.isNotEmpty);
assert(_scopeStack.contains(scope));
bool leaked = false;
@@ -102,11 +103,12 @@ class TestAsyncUtils {
throw new FlutterError(message.toString().trimRight());
}
if (error != null)
return new Future<Null>.error(error, stack);
return new Future<Null>.value(null);
return new Future<T>.error(error, stack);
return new Future<T>.value(resultValue);
}
return result.then<Null>(
(Null value) {
return result.then<T>(
(T value) {
resultValue = value;
return completionHandler(null, null);
},
onError: completionHandler