Create by https://gist.github.com/CaiJingLong/a299d15b92edc2d09a8a06cf6dd5a1b0
Created
March 26, 2020 12:32
-
-
Save CaiJingLong/edc67433fe633fe0b938987ce8d806db to your computer and use it in GitHub Desktop.
FractionallySizedBox example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "package:flutter/material.dart"; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: Container( | |
color: Colors.red, | |
child: Stack( | |
children: [ | |
Align( | |
child: FractionallySizedBox( | |
child: Container( | |
color: Colors.blue, | |
), | |
widthFactor: 0.3, | |
heightFactor: 0.1, | |
), | |
alignment: Alignment(-0.5, 0), | |
), | |
], | |
), | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment