Showing
6 changed files
with
26 additions
and
28 deletions
... | @@ -26,7 +26,7 @@ class UserVideo { | ... | @@ -26,7 +26,7 @@ class UserVideo { |
26 | 26 | ||
27 | static List<UserVideo> fetchVideo() { | 27 | static List<UserVideo> fetchVideo() { |
28 | List<UserVideo> list = videoList | 28 | List<UserVideo> list = videoList |
29 | - .map((e) => UserVideo(image: '', url: 'https://static.ybhospital.net/$e', desc: 'test_video_desc')) | 29 | + .map((e) => UserVideo(image: '', url: 'https://static.ybhospital.net/$e', desc: '清晨入古寺,初日照高林。\n竹径通幽处,禅房花木深。')) |
30 | .toList(); | 30 | .toList(); |
31 | return list; | 31 | return list; |
32 | } | 32 | } | ... | ... |
... | @@ -4,7 +4,7 @@ import 'package:one_poem/tiktok/style/style.dart'; | ... | @@ -4,7 +4,7 @@ import 'package:one_poem/tiktok/style/style.dart'; |
4 | class SelectText extends StatelessWidget { | 4 | class SelectText extends StatelessWidget { |
5 | const SelectText({ | 5 | const SelectText({ |
6 | Key? key, | 6 | Key? key, |
7 | - this.isSelect: true, | 7 | + this.isSelect = true, |
8 | this.title, | 8 | this.title, |
9 | }) : super(key: key); | 9 | }) : super(key: key); |
10 | 10 | ||
... | @@ -14,7 +14,7 @@ class SelectText extends StatelessWidget { | ... | @@ -14,7 +14,7 @@ class SelectText extends StatelessWidget { |
14 | @override | 14 | @override |
15 | Widget build(BuildContext context) { | 15 | Widget build(BuildContext context) { |
16 | return Container( | 16 | return Container( |
17 | - padding: EdgeInsets.symmetric(vertical: 12), | 17 | + padding: const EdgeInsets.symmetric(vertical: 12), |
18 | color: Colors.black.withOpacity(0), | 18 | color: Colors.black.withOpacity(0), |
19 | child: Text( | 19 | child: Text( |
20 | title ?? '??', | 20 | title ?? '??', | ... | ... |
... | @@ -51,7 +51,7 @@ class _TikTokHeaderState extends State<TikTokHeader> { | ... | @@ -51,7 +51,7 @@ class _TikTokHeaderState extends State<TikTokHeader> { |
51 | padding: const EdgeInsets.all(4), | 51 | padding: const EdgeInsets.all(4), |
52 | alignment: Alignment.centerLeft, | 52 | alignment: Alignment.centerLeft, |
53 | child: Icon( | 53 | child: Icon( |
54 | - Icons.search, | 54 | + Icons.star, |
55 | color: Colors.white.withOpacity(0.66), | 55 | color: Colors.white.withOpacity(0.66), |
56 | ), | 56 | ), |
57 | ), | 57 | ), |
... | @@ -73,7 +73,7 @@ class _TikTokHeaderState extends State<TikTokHeader> { | ... | @@ -73,7 +73,7 @@ class _TikTokHeaderState extends State<TikTokHeader> { |
73 | padding: const EdgeInsets.all(4), | 73 | padding: const EdgeInsets.all(4), |
74 | alignment: Alignment.centerRight, | 74 | alignment: Alignment.centerRight, |
75 | child: Icon( | 75 | child: Icon( |
76 | - Icons.tv, | 76 | + Icons.ios_share, |
77 | color: Colors.white.withOpacity(0.66), | 77 | color: Colors.white.withOpacity(0.66), |
78 | ), | 78 | ), |
79 | ), | 79 | ), | ... | ... |
... | @@ -27,15 +27,15 @@ class TikTokVideoPage extends StatelessWidget { | ... | @@ -27,15 +27,15 @@ class TikTokVideoPage extends StatelessWidget { |
27 | 27 | ||
28 | const TikTokVideoPage({ | 28 | const TikTokVideoPage({ |
29 | Key? key, | 29 | Key? key, |
30 | - this.bottomPadding: 16, | 30 | + this.bottomPadding = 16, |
31 | this.tag, | 31 | this.tag, |
32 | this.rightButtonColumn, | 32 | this.rightButtonColumn, |
33 | this.userInfoWidget, | 33 | this.userInfoWidget, |
34 | this.onAddFavorite, | 34 | this.onAddFavorite, |
35 | this.onSingleTap, | 35 | this.onSingleTap, |
36 | this.video, | 36 | this.video, |
37 | - this.aspectRatio: 9 / 16.0, | 37 | + this.aspectRatio = 9 / 16.0, |
38 | - this.hidePauseIcon: false, | 38 | + this.hidePauseIcon = false, |
39 | }) : super(key: key); | 39 | }) : super(key: key); |
40 | @override | 40 | @override |
41 | Widget build(BuildContext context) { | 41 | Widget build(BuildContext context) { |
... | @@ -170,21 +170,21 @@ class VideoUserInfo extends StatelessWidget { | ... | @@ -170,21 +170,21 @@ class VideoUserInfo extends StatelessWidget { |
170 | crossAxisAlignment: CrossAxisAlignment.start, | 170 | crossAxisAlignment: CrossAxisAlignment.start, |
171 | children: <Widget>[ | 171 | children: <Widget>[ |
172 | const Text( | 172 | const Text( |
173 | - '@朱二旦的枯燥生活', | 173 | + '每日一言', |
174 | style: StandardTextStyle.big, | 174 | style: StandardTextStyle.big, |
175 | ), | 175 | ), |
176 | Container(height: 6), | 176 | Container(height: 6), |
177 | Text( | 177 | Text( |
178 | - desc ?? '#原创 有钱人的生活就是这么朴实无华,且枯燥 #短视频', | 178 | + desc ?? '#一言 临境', |
179 | style: StandardTextStyle.normal, | 179 | style: StandardTextStyle.normal, |
180 | ), | 180 | ), |
181 | Container(height: 6), | 181 | Container(height: 6), |
182 | Row( | 182 | Row( |
183 | children: const <Widget>[ | 183 | children: const <Widget>[ |
184 | - Icon(Icons.music_note, size: 14), | 184 | + // Icon(Icons.music_note, size: 14), |
185 | Expanded( | 185 | Expanded( |
186 | child: Text( | 186 | child: Text( |
187 | - '朱二旦的枯燥生活创作的原声', | 187 | + '宜 · 安静/看书/喝茶', |
188 | maxLines: 9, | 188 | maxLines: 9, |
189 | style: StandardTextStyle.normal, | 189 | style: StandardTextStyle.normal, |
190 | ), | 190 | ), | ... | ... |
... | @@ -15,7 +15,7 @@ class TikTokButtonColumn extends StatelessWidget { | ... | @@ -15,7 +15,7 @@ class TikTokButtonColumn extends StatelessWidget { |
15 | this.onFavorite, | 15 | this.onFavorite, |
16 | this.onComment, | 16 | this.onComment, |
17 | this.onShare, | 17 | this.onShare, |
18 | - this.isFavorite: false, | 18 | + this.isFavorite = false, |
19 | this.onAvatar, | 19 | this.onAvatar, |
20 | }) : super(key: key); | 20 | }) : super(key: key); |
21 | 21 | ||
... | @@ -32,7 +32,7 @@ class TikTokButtonColumn extends StatelessWidget { | ... | @@ -32,7 +32,7 @@ class TikTokButtonColumn extends StatelessWidget { |
32 | crossAxisAlignment: CrossAxisAlignment.end, | 32 | crossAxisAlignment: CrossAxisAlignment.end, |
33 | children: <Widget>[ | 33 | children: <Widget>[ |
34 | Tapped( | 34 | Tapped( |
35 | - child: TikTokAvatar(), | 35 | + child: const TikTokAvatar(), |
36 | onTap: onAvatar, | 36 | onTap: onAvatar, |
37 | ), | 37 | ), |
38 | FavoriteIcon( | 38 | FavoriteIcon( |
... | @@ -97,7 +97,7 @@ class TikTokAvatar extends StatelessWidget { | ... | @@ -97,7 +97,7 @@ class TikTokAvatar extends StatelessWidget { |
97 | Widget avatar = Container( | 97 | Widget avatar = Container( |
98 | width: SysSize.avatar, | 98 | width: SysSize.avatar, |
99 | height: SysSize.avatar, | 99 | height: SysSize.avatar, |
100 | - margin: EdgeInsets.only(bottom: 10), | 100 | + margin: const EdgeInsets.only(bottom: 10), |
101 | decoration: BoxDecoration( | 101 | decoration: BoxDecoration( |
102 | border: Border.all( | 102 | border: Border.all( |
103 | color: Colors.white, | 103 | color: Colors.white, |
... | @@ -120,7 +120,7 @@ class TikTokAvatar extends StatelessWidget { | ... | @@ -120,7 +120,7 @@ class TikTokAvatar extends StatelessWidget { |
120 | borderRadius: BorderRadius.circular(10), | 120 | borderRadius: BorderRadius.circular(10), |
121 | color: ColorPlate.orange, | 121 | color: ColorPlate.orange, |
122 | ), | 122 | ), |
123 | - child: Icon( | 123 | + child: const Icon( |
124 | Icons.add, | 124 | Icons.add, |
125 | size: 16, | 125 | size: 16, |
126 | ), | 126 | ), |
... | @@ -128,7 +128,7 @@ class TikTokAvatar extends StatelessWidget { | ... | @@ -128,7 +128,7 @@ class TikTokAvatar extends StatelessWidget { |
128 | return Container( | 128 | return Container( |
129 | width: SysSize.avatar, | 129 | width: SysSize.avatar, |
130 | height: 66, | 130 | height: 66, |
131 | - margin: EdgeInsets.only(bottom: 6), | 131 | + margin: const EdgeInsets.only(bottom: 6), |
132 | child: Stack( | 132 | child: Stack( |
133 | alignment: Alignment.bottomCenter, | 133 | alignment: Alignment.bottomCenter, |
134 | children: <Widget>[avatar, addButton], | 134 | children: <Widget>[avatar, addButton], |
... | @@ -183,7 +183,7 @@ class _IconButton extends StatelessWidget { | ... | @@ -183,7 +183,7 @@ class _IconButton extends StatelessWidget { |
183 | shadows: [ | 183 | shadows: [ |
184 | Shadow( | 184 | Shadow( |
185 | color: Colors.black.withOpacity(0.15), | 185 | color: Colors.black.withOpacity(0.15), |
186 | - offset: Offset(0, 1), | 186 | + offset: const Offset(0, 1), |
187 | blurRadius: 1, | 187 | blurRadius: 1, |
188 | ), | 188 | ), |
189 | ], | 189 | ], |
... | @@ -197,7 +197,7 @@ class _IconButton extends StatelessWidget { | ... | @@ -197,7 +197,7 @@ class _IconButton extends StatelessWidget { |
197 | Container(height: 2), | 197 | Container(height: 2), |
198 | Text( | 198 | Text( |
199 | text ?? '??', | 199 | text ?? '??', |
200 | - style: TextStyle( | 200 | + style: const TextStyle( |
201 | fontWeight: FontWeight.normal, | 201 | fontWeight: FontWeight.normal, |
202 | fontSize: SysSize.small, | 202 | fontSize: SysSize.small, |
203 | color: ColorPlate.white, | 203 | color: ColorPlate.white, |
... | @@ -206,7 +206,7 @@ class _IconButton extends StatelessWidget { | ... | @@ -206,7 +206,7 @@ class _IconButton extends StatelessWidget { |
206 | ], | 206 | ], |
207 | ); | 207 | ); |
208 | return Container( | 208 | return Container( |
209 | - padding: EdgeInsets.symmetric(vertical: 10), | 209 | + padding: const EdgeInsets.symmetric(vertical: 10), |
210 | child: DefaultTextStyle( | 210 | child: DefaultTextStyle( |
211 | child: body, | 211 | child: body, |
212 | style: shadowStyle, | 212 | style: shadowStyle, | ... | ... |
... | @@ -23,7 +23,7 @@ class TikTokVideoGesture extends StatefulWidget { | ... | @@ -23,7 +23,7 @@ class TikTokVideoGesture extends StatefulWidget { |
23 | } | 23 | } |
24 | 24 | ||
25 | class _TikTokVideoGestureState extends State<TikTokVideoGesture> { | 25 | class _TikTokVideoGestureState extends State<TikTokVideoGesture> { |
26 | - GlobalKey _key = GlobalKey(); | 26 | + final GlobalKey _key = GlobalKey(); |
27 | 27 | ||
28 | // 内部转换坐标点 | 28 | // 内部转换坐标点 |
29 | Offset _p(Offset p) { | 29 | Offset _p(Offset p) { |
... | @@ -57,7 +57,6 @@ class _TikTokVideoGestureState extends State<TikTokVideoGesture> { | ... | @@ -57,7 +57,6 @@ class _TikTokVideoGestureState extends State<TikTokVideoGesture> { |
57 | onTapDown: (detail) { | 57 | onTapDown: (detail) { |
58 | setState(() { | 58 | setState(() { |
59 | if (canAddFavorite) { | 59 | if (canAddFavorite) { |
60 | - print('添加爱心,当前爱心数量:${icons.length}'); | ||
61 | icons.add(_p(detail.globalPosition)); | 60 | icons.add(_p(detail.globalPosition)); |
62 | widget.onAddFavorite?.call(); | 61 | widget.onAddFavorite?.call(); |
63 | justAddFavorite = true; | 62 | justAddFavorite = true; |
... | @@ -79,7 +78,7 @@ class _TikTokVideoGestureState extends State<TikTokVideoGesture> { | ... | @@ -79,7 +78,7 @@ class _TikTokVideoGestureState extends State<TikTokVideoGesture> { |
79 | canAddFavorite = true; | 78 | canAddFavorite = true; |
80 | }, | 79 | }, |
81 | onTapCancel: () { | 80 | onTapCancel: () { |
82 | - print('onTapCancel'); | 81 | + // |
83 | }, | 82 | }, |
84 | child: Stack( | 83 | child: Stack( |
85 | children: <Widget>[ | 84 | children: <Widget>[ |
... | @@ -100,7 +99,7 @@ class TikTokFavoriteAnimationIcon extends StatefulWidget { | ... | @@ -100,7 +99,7 @@ class TikTokFavoriteAnimationIcon extends StatefulWidget { |
100 | Key? key, | 99 | Key? key, |
101 | this.onAnimationComplete, | 100 | this.onAnimationComplete, |
102 | this.position, | 101 | this.position, |
103 | - this.size: 100, | 102 | + this.size = 100, |
104 | }) : super(key: key); | 103 | }) : super(key: key); |
105 | 104 | ||
106 | @override | 105 | @override |
... | @@ -119,7 +118,6 @@ class _TikTokFavoriteAnimationIconState | ... | @@ -119,7 +118,6 @@ class _TikTokFavoriteAnimationIconState |
119 | 118 | ||
120 | @override | 119 | @override |
121 | void didChangeDependencies() { | 120 | void didChangeDependencies() { |
122 | - print('didChangeDependencies'); | ||
123 | super.didChangeDependencies(); | 121 | super.didChangeDependencies(); |
124 | } | 122 | } |
125 | 123 | ||
... | @@ -128,7 +126,7 @@ class _TikTokFavoriteAnimationIconState | ... | @@ -128,7 +126,7 @@ class _TikTokFavoriteAnimationIconState |
128 | _animationController = AnimationController( | 126 | _animationController = AnimationController( |
129 | lowerBound: 0, | 127 | lowerBound: 0, |
130 | upperBound: 1, | 128 | upperBound: 1, |
131 | - duration: Duration(milliseconds: 1600), | 129 | + duration: const Duration(milliseconds: 1600), |
132 | vsync: this, | 130 | vsync: this, |
133 | ); | 131 | ); |
134 | 132 | ||
... | @@ -183,8 +181,8 @@ class _TikTokFavoriteAnimationIconState | ... | @@ -183,8 +181,8 @@ class _TikTokFavoriteAnimationIconState |
183 | child: content, | 181 | child: content, |
184 | blendMode: BlendMode.srcATop, | 182 | blendMode: BlendMode.srcATop, |
185 | shaderCallback: (Rect bounds) => RadialGradient( | 183 | shaderCallback: (Rect bounds) => RadialGradient( |
186 | - center: Alignment.topLeft.add(Alignment(0.66, 0.66)), | 184 | + center: Alignment.topLeft.add(const Alignment(0.66, 0.66)), |
187 | - colors: [ | 185 | + colors: const [ |
188 | Color(0xffEF6F6F), | 186 | Color(0xffEF6F6F), |
189 | Color(0xffF03E3E), | 187 | Color(0xffF03E3E), |
190 | ], | 188 | ], | ... | ... |
-
Please register or login to post a comment