Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-App
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
reason
2021-12-28 23:08:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c0413e67a4e243509657c28c76983ca2afe42e6d
c0413e67
1 parent
68e1c8e9
update tiktok
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
76 deletions
lib/poem/page/poem_detail.dart
lib/poem/page/poem_page.dart
lib/tiktok/widgets/tiktok_video.dart
lib/tiktok/widgets/tiktok_video_poem.dart
lib/poem/page/poem_detail.dart
View file @
c0413e6
import
'package:flutter/material.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
class
PoemDetailPage
extends
StatefulWidget
{
...
...
@@ -16,7 +17,11 @@ class PoemDetailPage extends StatefulWidget {
class
_PoemDetailPageState
extends
State
<
PoemDetailPage
>{
@override
Widget
build
(
BuildContext
context
)
{
// TODO: implement build
throw
UnimplementedError
();
return
const
Scaffold
(
appBar:
MyAppBar
(
title:
'一言|译解|临境'
,
),
body:
Text
(
"题 破山此后禅院"
),
);
}
}
\ No newline at end of file
...
...
lib/poem/page/poem_page.dart
View file @
c0413e6
...
...
@@ -10,6 +10,7 @@ import 'package:one_poem/tiktok/widgets/tiktok_scaffold.dart';
import
'package:one_poem/tiktok/widgets/tiktok_top_info.dart'
;
import
'package:one_poem/tiktok/widgets/tiktok_video.dart'
;
import
'package:one_poem/tiktok/widgets/tiktok_video_button_column.dart'
;
import
'package:one_poem/tiktok/widgets/tiktok_video_poem.dart'
;
import
'package:video_player/video_player.dart'
;
class
PoemPage
extends
StatefulWidget
{
...
...
@@ -20,12 +21,12 @@ class PoemPage extends StatefulWidget {
}
class
_PoemPageState
extends
State
<
PoemPage
>
with
WidgetsBindingObserver
{
TikTokScaffoldController
tkController
=
TikTokScaffoldController
();
final
PageController
_pageController
=
PageController
();
final
TikTokVideoListController
_videoListController
=
TikTokVideoListController
();
final
TikTokVideoListController
_videoListController
=
TikTokVideoListController
();
/// 记录点赞
Map
<
int
,
bool
>
favoriteMap
=
{};
...
...
@@ -118,7 +119,6 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
rightPage:
userPage
,
enableGesture:
true
,
page:
Stack
(
// index: currentPage == null ? 0 : 1,
children:
<
Widget
>[
PageView
.
builder
(
key:
const
Key
(
'home'
),
...
...
@@ -137,15 +137,14 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
tkController
.
animateToPage
(
TikTokPagePosition
.
right
);
},
onFavorite:
()
{
setState
(()
{
});
// showAboutDialog(context: context);
setState
(()
{});
},
onShare:
()
{},
);
Widget
topInfo
=
const
TikTokTopInfoColumn
(
info:
"早安"
Widget
poem
=
const
TikTokVidePoem
(
desc:
"清晨入古寺,初日照高林。
\n
竹径通幽处,禅房花木深。"
,
);
Widget
topInfo
=
const
TikTokTopInfoColumn
(
info:
"早安"
);
// video
Widget
currentVideo
=
Center
(
child:
AspectRatio
(
...
...
@@ -161,10 +160,6 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
key:
Key
(
data
.
url
+
'
$i
'
),
tag:
data
.
url
,
bottomPadding:
hasBottomPadding
?
16.0
:
16.0
,
userInfoWidget:
VideoUserInfo
(
desc:
data
.
desc
,
bottomPadding:
hasBottomPadding
?
16.0
:
50.0
,
),
onSingleTap:
()
async
{
if
(
player
.
controller
.
value
.
isPlaying
)
{
await
player
.
pause
();
...
...
@@ -179,6 +174,7 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
});
},
rightButtonColumn:
buttons
,
leftPoemArea:
poem
,
topInfo:
topInfo
,
video:
currentVideo
,
);
...
...
lib/tiktok/widgets/tiktok_video.dart
View file @
c0413e6
...
...
@@ -18,6 +18,7 @@ class TikTokVideoPage extends StatelessWidget {
final
double
bottomPadding
;
final
Widget
?
rightButtonColumn
;
final
Widget
?
leftPoemArea
;
final
Widget
?
topInfo
;
final
Widget
?
userInfoWidget
;
...
...
@@ -38,16 +39,13 @@ class TikTokVideoPage extends StatelessWidget {
this
.
video
,
this
.
aspectRatio
=
9
/
16.0
,
this
.
hidePauseIcon
=
false
,
this
.
leftPoemArea
,
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
// 右边的按钮列表
Widget
rightButtons
=
rightButtonColumn
??
Container
();
// 用户信息
Widget
userInfo
=
userInfoWidget
??
VideoUserInfo
(
bottomPadding:
bottomPadding
,
);
Widget
leftPoem
=
leftPoemArea
??
Container
();
// 视频加载的动画
// Widget videoLoading = VideoLoadingPlaceHolder(tag: tag);
// 视频播放页
...
...
@@ -98,14 +96,14 @@ class TikTokVideoPage extends StatelessWidget {
Container
(
height:
double
.
infinity
,
width:
double
.
infinity
,
alignment:
Alignment
.
bottom
Righ
t
,
child:
rightButtons
,
alignment:
Alignment
.
bottom
Lef
t
,
child:
leftPoem
,
),
Container
(
height:
double
.
infinity
,
width:
double
.
infinity
,
alignment:
Alignment
.
bottom
Lef
t
,
child:
userInfo
,
alignment:
Alignment
.
bottom
Righ
t
,
child:
rightButtons
,
),
],
);
...
...
@@ -151,56 +149,4 @@ class VideoLoadingPlaceHolder extends StatelessWidget {
),
);
}
}
class
VideoUserInfo
extends
StatelessWidget
{
final
String
?
desc
;
// final Function onGoodGift;
const
VideoUserInfo
({
Key
?
key
,
required
this
.
bottomPadding
,
// @required this.onGoodGift,
this
.
desc
,
})
:
super
(
key:
key
);
final
double
bottomPadding
;
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
padding:
EdgeInsets
.
only
(
left:
12
,
bottom:
bottomPadding
,
),
margin:
const
EdgeInsets
.
only
(
right:
80
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
const
Text
(
'每日一言'
,
style:
StandardTextStyle
.
big
,
),
Container
(
height:
6
),
Text
(
desc
??
'#一言 临境'
,
style:
StandardTextStyle
.
normal
,
),
Container
(
height:
6
),
Row
(
children:
const
<
Widget
>[
// Icon(Icons.music_note, size: 14),
Expanded
(
child:
Text
(
'宜 · 安静/看书/喝茶'
,
maxLines:
9
,
style:
StandardTextStyle
.
normal
,
),
)
],
)
],
),
);
}
}
}
\ No newline at end of file
...
...
lib/tiktok/widgets/tiktok_video_poem.dart
0 → 100644
View file @
c0413e6
import
'package:flutter/material.dart'
;
import
'package:one_poem/tiktok/style/style.dart'
;
class
TikTokVidePoem
extends
StatelessWidget
{
final
double
?
bottomPadding
;
final
Function
?
onShowDetail
;
final
String
?
desc
;
const
TikTokVidePoem
({
Key
?
key
,
this
.
bottomPadding
,
this
.
onShowDetail
,
this
.
desc
,
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
SysSize
.
avatar
,
margin:
EdgeInsets
.
only
(
bottom:
bottomPadding
??
50
,
right:
12
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
children:
<
Widget
>[
InkWell
(
child:
Text
(
desc
??
'#一言 临境'
,
style:
StandardTextStyle
.
normal
,
),
onTap:
(){},
),
Container
(
width:
SysSize
.
avatar
,
height:
SysSize
.
avatar
,
margin:
const
EdgeInsets
.
only
(
top:
10
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
SysSize
.
avatar
/
2.0
),
// color: Colors.black.withOpacity(0.8),
),
)
],
),
);
}
}
\ No newline at end of file
Please
register
or
login
to post a comment