Showing
1 changed file
with
50 additions
and
43 deletions
@@ -17,52 +17,59 @@ class AvatarBottomSheet extends StatelessWidget { | @@ -17,52 +17,59 @@ class AvatarBottomSheet extends StatelessWidget { | ||
17 | return AnnotatedRegion<SystemUiOverlayStyle>( | 17 | return AnnotatedRegion<SystemUiOverlayStyle>( |
18 | value: SystemUiOverlayStyle.light, | 18 | value: SystemUiOverlayStyle.light, |
19 | child: Column( | 19 | child: Column( |
20 | - mainAxisSize: MainAxisSize.min, | ||
21 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
22 | - children: [ | ||
23 | - SizedBox(height: 12), | ||
24 | - SafeArea( | ||
25 | - bottom: false, | ||
26 | - child: AnimatedBuilder( | ||
27 | - animation: animation, | ||
28 | - builder: (context, child) => Transform.translate( | ||
29 | - offset: Offset(0, (1 - animation.value) * 100), | ||
30 | - child: Opacity( | ||
31 | - child: child, | ||
32 | - opacity: max(0, animation.value * 2 - 1))), | ||
33 | - child: Row( | ||
34 | - children: <Widget>[ | ||
35 | - SizedBox(width: 20), | ||
36 | - CircleAvatar( | ||
37 | - child: Text('JB'), | ||
38 | - radius: 32, | ||
39 | - ), | ||
40 | - ], | 20 | + mainAxisSize: MainAxisSize.min, |
21 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
22 | + children: [ | ||
23 | + SizedBox(height: 12), | ||
24 | + SafeArea( | ||
25 | + bottom: false, | ||
26 | + child: AnimatedBuilder( | ||
27 | + animation: animation, | ||
28 | + builder: (context, child) => Transform.translate( | ||
29 | + offset: Offset(0, (1 - animation.value) * 100), | ||
30 | + child: Opacity( | ||
31 | + child: child, opacity: max(0, animation.value * 2 - 1))), | ||
32 | + child: Row( | ||
33 | + children: <Widget>[ | ||
34 | + SizedBox(width: 20), | ||
35 | + CircleAvatar( | ||
36 | + child: Text( | ||
37 | + 'JB', | ||
38 | + style: TextStyle(color: Colors.black), | ||
39 | + ), | ||
40 | + radius: 32, | ||
41 | + backgroundColor: Colors.blueAccent, | ||
41 | ), | 42 | ), |
42 | - )), | ||
43 | - SizedBox(height: 12), | ||
44 | - Flexible( | ||
45 | - flex: 1, | ||
46 | - fit: FlexFit.loose, | ||
47 | - child: ClipRRect( | ||
48 | - borderRadius: BorderRadius.only( | ||
49 | - topLeft: Radius.circular(15), | ||
50 | - topRight: Radius.circular(15)), | ||
51 | - child: Container( | ||
52 | - decoration: BoxDecoration( | ||
53 | - color: Theme.of(context).scaffoldBackgroundColor, | ||
54 | - boxShadow: [ | ||
55 | - BoxShadow( | ||
56 | - blurRadius: 10, | ||
57 | - color: Colors.black12, | ||
58 | - spreadRadius: 5) | ||
59 | - ]), | ||
60 | - width: double.infinity, | ||
61 | - child: MediaQuery.removePadding( | ||
62 | - context: context, removeTop: true, child: child)), | 43 | + ], |
63 | ), | 44 | ), |
64 | ), | 45 | ), |
65 | - ]), | 46 | + ), |
47 | + SizedBox(height: 12), | ||
48 | + Flexible( | ||
49 | + flex: 1, | ||
50 | + fit: FlexFit.loose, | ||
51 | + child: ClipRRect( | ||
52 | + borderRadius: BorderRadius.only( | ||
53 | + topLeft: Radius.circular(15), topRight: Radius.circular(15)), | ||
54 | + child: Container( | ||
55 | + decoration: BoxDecoration( | ||
56 | + color: Theme.of(context).scaffoldBackgroundColor, | ||
57 | + boxShadow: [ | ||
58 | + BoxShadow( | ||
59 | + blurRadius: 10, | ||
60 | + color: Colors.black12, | ||
61 | + spreadRadius: 5, | ||
62 | + ), | ||
63 | + ], | ||
64 | + ), | ||
65 | + width: double.infinity, | ||
66 | + child: MediaQuery.removePadding( | ||
67 | + context: context, removeTop: true, child: child), | ||
68 | + ), | ||
69 | + ), | ||
70 | + ), | ||
71 | + ], | ||
72 | + ), | ||
66 | ); | 73 | ); |
67 | } | 74 | } |
68 | } | 75 | } |
-
Please register or login to post a comment