Я хотел бы сделать хорошие эффекты тени, показанные ниже,
Все примеры найдены на inte rnet не мог даже приблизиться к вышеупомянутым проектам.
После долгих проб и ошибок я мог сделать следующее. Все еще не мог сделать внутреннюю тень. Было бы замечательно, если бы кто-нибудь помог мне понять, как расшифровать этот дизайн.
Код, использованный для создания кнопки выше,
Widget buildBackButton() {
double size = 47;
return Stack(
children: <Widget>[
Container(
width: size,
height: size,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.black26,
offset: Offset(20, 20),
blurRadius: 40,
),
BoxShadow(
color: Colors.white,
offset: Offset(-20, -20),
blurRadius: 25,
)
]),
child: Material(
color: Color(0xffe0eafb),
borderRadius: BorderRadius.circular(size),
elevation: 10,
child: Padding(
padding: const EdgeInsets.all(3.0),
child: ClipOval(
clipper: MClipper(),
),
),
),
),
Container(
width: 45.0,
height: 45.0,
padding: EdgeInsets.only(left: 2, top: 2),
child: new RawMaterialButton(
shape: new CircleBorder(),
fillColor: Color(0xffe0eafb),
elevation: 10.0,
child: Icon(
Icons.arrow_back,
color: Colors.black,
),
onPressed: () {},
)),
],
);
}
class MClipper extends CustomClipper<Rect> {
@override
Rect getClip(Size size) {
return Rect.fromCircle(
center: Offset(size.width / 2, size.height / 2),
radius: min(size.width, size.height) / 2);
}
@override
bool shouldReclip(CustomClipper<Rect> oldClipper) {
return true;
}
}
Заранее спасибо.