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
2022-07-06 18:45:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0aa66a8d8f6f95bbc2d2a948ef02af9eeb12e254
0aa66a8d
1 parent
4c00d7fa
修改发布按钮动画效果
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
19 deletions
lib/poem/components/video_slides.dart
lib/poem/page/poem_complete_page.dart
lib/poem/page/poem_record_audio.dart
lib/poem/page/poem_record_video.dart
lib/poem/theme/tik_video_player.dart
lib/poem/components/video_slides.dart
View file @
0aa66a8
...
...
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import
'package:getwidget/getwidget.dart'
;
import
'package:path_provider/path_provider.dart'
;
import
'package:share_plus/share_plus.dart'
;
import
'../../events/trans_event.dart'
;
import
'../../net/dio_utils.dart'
;
import
'../../net/http_api.dart'
;
import
'../theme/tik_video_player.dart'
;
...
...
@@ -41,10 +42,10 @@ class VideoSlidesState extends State<VideoSlides> {
super
.
initState
();
isPraise
=
widget
.
isPraise
;
isCollect
=
widget
.
isCollect
;
reco
de
VideoPlayStatus
();
reco
rd
VideoPlayStatus
();
}
Future
<
void
>
reco
de
VideoPlayStatus
()
async
{
Future
<
void
>
reco
rd
VideoPlayStatus
()
async
{
String
url
=
'
${HttpApi.addView}
/
${widget.videoId}
'
;
// 统计观看数
DioUtils
.
instance
.
asyncRequestNetwork
(
...
...
@@ -125,7 +126,7 @@ class VideoSlidesState extends State<VideoSlides> {
child:
InkWell
(
onTap:
()
{
isPraise
=
isPraise
==
false
?
true
:
false
;
isPraise
==
false
?
true
:
false
;
setState
(()
{});
String
url
=
'
${HttpApi.praise}
/
${widget.videoId}
'
;
...
...
@@ -176,7 +177,7 @@ class VideoSlidesState extends State<VideoSlides> {
child:
InkWell
(
onTap:
()
async
{
isCollect
=
isCollect
==
false
?
true
:
false
;
isCollect
==
false
?
true
:
false
;
setState
(()
{});
String
url
=
'
${HttpApi.collect}
/
${widget.videoId}
'
;
...
...
@@ -242,14 +243,14 @@ class VideoSlidesState extends State<VideoSlides> {
),
child:
isSharing
?
GFProgressBar
(
percentage:
currentProgress
,
backgroundColor:
Colors
.
black26
,
progressBarColor:
GFColors
.
DANGER
)
percentage:
currentProgress
,
backgroundColor:
Colors
.
black26
,
progressBarColor:
GFColors
.
DANGER
)
:
const
Icon
(
Icons
.
share_rounded
,
color:
Colors
.
white
,
size:
20
,
),
Icons
.
share_rounded
,
color:
Colors
.
white
,
size:
20
,
),
),
),
),
...
...
@@ -278,6 +279,7 @@ class VideoSlidesState extends State<VideoSlides> {
icon:
const
Icon
(
Icons
.
video_call_outlined
),
buttonColor:
Colors
.
teal
,
onPress:
()
{
eventBus
.
fire
(
TransEvent
());
String
url
=
'
${PoemRouter.poemRecordVideoPage}
?id=
${widget.videoId}
&type=
${widget.poemType}
'
;
NavigatorUtils
.
push
(
...
...
@@ -289,6 +291,7 @@ class VideoSlidesState extends State<VideoSlides> {
icon:
const
Icon
(
Icons
.
mic_none_outlined
),
buttonColor:
Colors
.
green
,
onPress:
()
{
eventBus
.
fire
(
TransEvent
());
NavigatorUtils
.
push
(
context
,
'
${PoemRouter.poemRecordAudioPage}
?id=
${widget.videoId}
&type=
${widget.poemType}
'
,
...
...
@@ -319,10 +322,10 @@ class VideoSlidesState extends State<VideoSlides> {
tempVideoPath
=
"
$savePath$appName
"
;
Response
response
=
await
dio
.
download
(
url
,
tempVideoPath
,
onReceiveProgress:
(
received
,
total
)
{
if
(
total
!=
-
1
)
{
currentProgress
=
received
/
total
;
setState
(()
{});
}
});
if
(
total
!=
-
1
)
{
currentProgress
=
received
/
total
;
setState
(()
{});
}
});
}
}
...
...
lib/poem/page/poem_complete_page.dart
View file @
0aa66a8
...
...
@@ -73,7 +73,7 @@ class _PoemCompletePageState extends State<PoemCompletePage> {
onPressed:
()
{
NavigatorUtils
.
push
(
context
,
Routes
.
hom
e
,
Routes
.
navBarPag
e
,
clearStack:
true
,
);
},
...
...
lib/poem/page/poem_record_audio.dart
View file @
0aa66a8
...
...
@@ -164,7 +164,7 @@ class AudioToolBar extends StatefulWidget {
class
_AudioToolBarState
extends
State
<
AudioToolBar
>
{
late
final
PausableTimer
_timer
;
int
currentTimer
=
0
;
int
duration
=
10
*
1000
;
//TODO
60 * 1000;
int
duration
=
60
*
1000
;
Codec
_codec
=
Codec
.
aacMP4
;
//TODO why accMP4?
String
_mPath
=
'tau_file.mp4'
;
...
...
lib/poem/page/poem_record_video.dart
View file @
0aa66a8
...
...
@@ -51,7 +51,7 @@ class PoemRecordVideoPageState extends State<PoemRecordVideoPage>
late
final
PausableTimer
_timer
;
int
currentTimer
=
0
;
int
duration
=
10
*
1000
;
//TODO
60 * 1000;
int
duration
=
60
*
1000
;
@override
void
initState
()
{
...
...
lib/poem/theme/tik_video_player.dart
View file @
0aa66a8
import
'dart:async'
;
import
'package:Parlando/events/trans_event.dart'
;
import
'package:chewie/chewie.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
...
...
@@ -43,17 +46,23 @@ class TikVideoPlayer extends StatefulWidget {
class
_TikVideoPlayerState
extends
State
<
TikVideoPlayer
>
{
late
VideoPlayerController
_videoPlayerController
;
ChewieController
?
_chewieController
;
late
StreamSubscription
bus
;
@override
void
initState
()
{
initializePlayer
();
super
.
initState
();
bus
=
eventBus
.
on
<
TransEvent
>().
listen
((
event
)
{
_chewieController
!.
videoPlayerController
.
pause
();
});
}
@override
void
dispose
()
{
_videoPlayerController
.
dispose
();
_chewieController
!.
dispose
();
bus
.
cancel
();
super
.
dispose
();
}
...
...
Please
register
or
login
to post a comment