Я использую свойство transform
виджета Container
, чтобы повернуть его вокруг оси Z, вот так:
transform: Matrix4.rotationZ(10 * pi/180)
в следующем фрагменте:
Scaffold(
resizeToAvoidBottomInset: false,
body: Stack(
children: <Widget>[
Container(
// margin: EdgeInsets.symmetric(vertical: 20.0,horizontal: 10.0),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/img/women.png",
),
fit: BoxFit.scaleDown,
),
),
),
SingleChildScrollView(
child: Container(
width: deviceSize.width,
height: deviceSize.height,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Flexible(
child: Container(
margin: EdgeInsets.only(bottom: 90.0),
padding:
EdgeInsets.symmetric(vertical: 10.0, horizontal: 15),
transform: Matrix4.rotationZ(10 * pi / 180)
..translate(10.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: Colors.orange,
boxShadow: [
BoxShadow(
blurRadius: 20.0,
color: Colors.orange,
offset: Offset(5, 7),
)
],
),
child: Text(
'Shopping Universe',
style: TextStyle(
color: Colors.white,
fontSize: 60.0,
fontFamily: 'Piedra',
fontWeight: FontWeight.w200,
),
),
),
),
Flexible(
child: AuthCard(),
),
],
),
),
),
],
),
);
Как изменить точку вращения и установить ее на center of gravity
из container
?
После этого я мог бы изменить ее положение с помощью translate, что-то вроде этого Matrix4.rotationZ(15 * pi/180)..translate(10.0)
Но я не доволен этим методом,
Кто-нибудь может мне помочь, пожалуйста?
Любые предложения или советы будут оценены. Спасибо.