Replace usage of FractionalOffset with Alignment (#12348)

Alignment will eventually replace FractionalOffset.
This commit is contained in:
Adam Barth
2017-10-02 00:06:24 -07:00
committed by GitHub
parent 2b126bcd0d
commit 0044ea2dbb
28 changed files with 62 additions and 62 deletions

View File

@@ -44,7 +44,7 @@ class _MyHomePageState extends State<MyHomePage> {
return new Scaffold(
body: new Stack(
fit: StackFit.expand,
alignment: FractionalOffset.bottomCenter,
alignment: Alignment.bottomCenter,
children: <Widget>[
new LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {

View File

@@ -224,7 +224,7 @@ class CardCollectionState extends State<CardCollection> {
flexibleSpace: new Container(
padding: const EdgeInsets.only(left: 72.0),
height: 128.0,
alignment: const FractionalOffset(0.0, 0.75),
alignment: const Alignment(-1.0, 0.5),
child: new Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.title),
),
);
@@ -330,8 +330,8 @@ class CardCollectionState extends State<CardCollection> {
Shader _createShader(Rect bounds) {
return new LinearGradient(
begin: FractionalOffset.topLeft,
end: FractionalOffset.bottomLeft,
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
stops: <double>[0.1, 0.35],
)

View File

@@ -64,8 +64,8 @@ class GradientRow extends StatelessWidget {
height: 100.0,
decoration: new BoxDecoration(
gradient: new LinearGradient(
begin: FractionalOffset.topLeft,
end: FractionalOffset.bottomRight,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[ leftColor, rightColor ],
),
),