Commit f52cbe81 authored by xster's avatar xster Committed by GitHub

round 1 (#9876)

parent 127545a3
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:ui' show ImageFilter;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
...@@ -10,18 +11,18 @@ import 'package:flutter/widgets.dart'; ...@@ -10,18 +11,18 @@ import 'package:flutter/widgets.dart';
const TextStyle _kCupertinoDialogTitleStyle = const TextStyle( const TextStyle _kCupertinoDialogTitleStyle = const TextStyle(
fontFamily: '.SF UI Display', fontFamily: '.SF UI Display',
inherit: false, inherit: false,
fontSize: 17.0, fontSize: 17.5,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: const Color(0xFF000000), color: const Color(0xFF000000),
height: 1.35, height: 1.25,
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
); );
const TextStyle _kCupertinoDialogContentStyle = const TextStyle( const TextStyle _kCupertinoDialogContentStyle = const TextStyle(
fontFamily: '.SF UI Text', fontFamily: '.SF UI Text',
inherit: false, inherit: false,
fontSize: 12.0, fontSize: 12.4,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w500,
color: const Color(0xFF000000), color: const Color(0xFF000000),
height: 1.35, height: 1.35,
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
...@@ -30,18 +31,18 @@ const TextStyle _kCupertinoDialogContentStyle = const TextStyle( ...@@ -30,18 +31,18 @@ const TextStyle _kCupertinoDialogContentStyle = const TextStyle(
const TextStyle _kCupertinoDialogActionStyle = const TextStyle( const TextStyle _kCupertinoDialogActionStyle = const TextStyle(
fontFamily: '.SF UI Text', fontFamily: '.SF UI Text',
inherit: false, inherit: false,
fontSize: 16.0, fontSize: 16.8,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: const Color(0xFF027AFF), color: const Color(0xFF027AFF),
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
); );
const double _kCupertinoDialogWidth = 270.0; const double _kCupertinoDialogWidth = 270.0;
const BoxDecoration _kCupertinoDialogDecoration = const BoxDecoration( const BoxDecoration _kCupertinoDialogFrontFillDecoration = const BoxDecoration(
// TODO(abarth): Rather than being opaque, this decoration should actually be color: const Color(0xCCFFFFFF),
// partially transparent and have a subtle background blur effect. );
color: const Color(0xFFF8F8F8), const BoxDecoration _kCupertinoDialogBackFill = const BoxDecoration(
borderRadius: const BorderRadius.all(const Radius.circular(15.0)), color: const Color(0x77FFFFFFF),
); );
/// An iOS-style dialog. /// An iOS-style dialog.
...@@ -68,11 +69,22 @@ class CupertinoDialog extends StatelessWidget { ...@@ -68,11 +69,22 @@ class CupertinoDialog extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Center( return new Center(
child: new Container( child: new ClipRRect(
margin: const EdgeInsets.all(10.0), borderRadius: const BorderRadius.all(const Radius.circular(12.0)),
width: _kCupertinoDialogWidth, child: new DecoratedBox(
decoration: _kCupertinoDialogDecoration, // To get the effect, 2 white fills are needed. One blended with the
child: child, // background before applying the blur and one overlayed on top of
// the blur.
decoration: _kCupertinoDialogBackFill,
child: new BackdropFilter(
filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container(
width: _kCupertinoDialogWidth,
decoration: _kCupertinoDialogFrontFillDecoration,
child: child,
),
),
),
), ),
); );
} }
...@@ -123,11 +135,11 @@ class CupertinoAlertDialog extends StatelessWidget { ...@@ -123,11 +135,11 @@ class CupertinoAlertDialog extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<Widget> children = <Widget>[]; final List<Widget> children = <Widget>[];
children.add(const SizedBox(height: 20.0)); children.add(const SizedBox(height: 18.0));
if (title != null) { if (title != null) {
children.add(new Padding( children.add(new Padding(
padding: const EdgeInsets.only(left: 20.0, right: 20.0, bottom: 12.0), padding: const EdgeInsets.only(left: 20.0, right: 20.0, bottom: 2.0),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: _kCupertinoDialogTitleStyle, style: _kCupertinoDialogTitleStyle,
textAlign: TextAlign.center, textAlign: TextAlign.center,
...@@ -150,7 +162,7 @@ class CupertinoAlertDialog extends StatelessWidget { ...@@ -150,7 +162,7 @@ class CupertinoAlertDialog extends StatelessWidget {
)); ));
} }
children.add(const SizedBox(height: 20.0)); children.add(const SizedBox(height: 22.0));
if (actions != null) { if (actions != null) {
children.add(new _CupertinoButtonBar( children.add(new _CupertinoButtonBar(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment