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-30 23:40:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d09f943ec945e306180fe6c60c5a4a6fed090152
d09f943e
1 parent
6990ec78
update
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
90 deletions
lib/account/page/account_page.dart
lib/category/widgets/category_item_page.dart
lib/poem/page/poem_detail.dart
lib/poem/page/poem_page.dart
lib/setting/page/account_manager_page.dart
lib/tiktok/widgets/tiktok_header.dart
lib/widgets/my_app_bar.dart
lib/account/page/account_page.dart
View file @
d09f943
...
...
@@ -148,7 +148,6 @@ class _AccountPageState extends State<AccountPage> {
);
return
Scaffold
(
appBar:
const
MyAppBar
(
centerTitle:
'我在'
,
),
body:
Container
(
decoration:
const
BoxDecoration
(
...
...
lib/category/widgets/category_item_page.dart
deleted
100644 → 0
View file @
6990ec7
File mode changed
lib/poem/page/poem_detail.dart
View file @
d09f943
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:one_poem/res/gaps.dart'
;
import
'package:one_poem/util/theme_utils.dart'
;
import
'package:one_poem/util/toast_utils.dart'
;
import
'package:one_poem/widgets/load_image.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
...
...
@@ -23,9 +25,11 @@ class _PoemDetailPageState extends State<PoemDetailPage> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
// extendBodyBehindAppBar: true,// appbar背景透明
appBar:
const
MyAppBar
(
title:
'一言'
,
actionName:
"返回"
,
appBar:
MyAppBar
(
isShowButtons:
true
,
funcLeft:
()
{
print
(
"xxxxx"
);
},
),
body:
Container
(
decoration:
const
BoxDecoration
(
...
...
lib/poem/page/poem_page.dart
View file @
d09f943
...
...
@@ -4,12 +4,13 @@ import 'package:one_poem/tiktok/controller/tiktok_video_list_controller.dart';
import
'package:one_poem/tiktok/mock/video.dart'
;
import
'package:one_poem/tiktok/pages/search_page.dart'
;
import
'package:one_poem/tiktok/style/physics.dart'
;
import
'package:one_poem/tiktok/widgets/tiktok_header.dart'
;
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:one_poem/util/toast_utils.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
import
'package:video_player/video_player.dart'
;
import
'poem_detail.dart'
;
...
...
@@ -28,10 +29,6 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
final
TikTokVideoListController
_videoListController
=
TikTokVideoListController
();
/// 记录点赞
Map
<
int
,
bool
>
favoriteMap
=
{};
List
<
UserVideo
>
videoDataList
=
[];
@override
...
...
@@ -95,12 +92,6 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
double
a
=
MediaQuery
.
of
(
context
).
size
.
aspectRatio
;
bool
hasBottomPadding
=
a
<
0.55
;
var
header
=
TikTokHeader
(
onSearch:
()
{
tkController
.
animateToLeft
();
},
);
var
detailPage
=
PoemDetailPage
(
onPop:
()
{
tkController
.
animateToMiddle
();
...
...
@@ -114,7 +105,9 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
// 组合
return
TikTokScaffold
(
controller:
tkController
,
header:
header
,
header:
MyAppBar
(
isBack:
false
,
),
leftPage:
searchPage
,
rightPage:
detailPage
,
enableGesture:
true
,
...
...
lib/setting/page/account_manager_page.dart
View file @
d09f943
...
...
@@ -20,7 +20,6 @@ class _AccountManagerPageState extends State<AccountManagerPage> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
const
MyAppBar
(
centerTitle:
'账号管理'
,
),
body:
Column
(
children:
<
Widget
>[
...
...
lib/tiktok/widgets/tiktok_header.dart
deleted
100644 → 0
View file @
6990ec7
import
'package:flutter/material.dart'
;
import
'package:tapped/tapped.dart'
;
class
TikTokHeader
extends
StatefulWidget
{
final
Function
?
onSearch
;
const
TikTokHeader
({
Key
?
key
,
this
.
onSearch
,
})
:
super
(
key:
key
);
@override
_TikTokHeaderState
createState
()
=>
_TikTokHeaderState
();
}
class
_TikTokHeaderState
extends
State
<
TikTokHeader
>
{
int
currentSelect
=
0
;
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Expanded
(
child:
Tapped
(
child:
Container
(
color:
Colors
.
black
.
withOpacity
(
0
),
padding:
const
EdgeInsets
.
all
(
4
),
alignment:
Alignment
.
centerLeft
,
child:
Icon
(
Icons
.
star
,
color:
Colors
.
white
.
withOpacity
(
0.66
),
),
),
onTap:
widget
.
onSearch
,
),
),
Expanded
(
child:
Tapped
(
child:
Container
(
color:
Colors
.
black
.
withOpacity
(
0
),
padding:
const
EdgeInsets
.
all
(
4
),
alignment:
Alignment
.
centerRight
,
child:
Icon
(
Icons
.
ios_share
,
color:
Colors
.
white
.
withOpacity
(
0.66
),
),
),
),
),
],
),
);
}
}
lib/widgets/my_app_bar.dart
View file @
d09f943
...
...
@@ -3,12 +3,10 @@ import 'package:flutter/services.dart';
import
'package:one_poem/util/theme_utils.dart'
;
import
'package:one_poem/res/resources.dart'
;
import
'my_button.dart'
;
/// 自定义AppBar
class
MyAppBar
extends
StatelessWidget
implements
PreferredSizeWidget
{
const
MyAppBar
(
{
Key
?
key
,
const
MyAppBar
(
{
Key
?
key
,
this
.
backgroundColor
,
this
.
title
=
''
,
this
.
centerTitle
=
''
,
...
...
@@ -16,8 +14,15 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
this
.
backImg
=
'assets/images/ic_back_black.png'
,
this
.
backImgColor
,
this
.
onPressed
,
this
.
isBack
=
true
})
:
super
(
key:
key
);
this
.
isBack
=
true
,
this
.
buttonLeft
,
this
.
funcLeft
,
this
.
buttonCenter
,
this
.
funcCenter
,
this
.
buttonRight
,
this
.
funcRight
,
this
.
isShowButtons
=
false
,
})
:
super
(
key:
key
);
final
Color
?
backgroundColor
;
final
String
title
;
...
...
@@ -27,6 +32,14 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
final
String
actionName
;
final
VoidCallback
?
onPressed
;
final
bool
isBack
;
final
bool
isShowButtons
;
final
String
?
buttonLeft
;
final
Function
?
funcLeft
;
final
String
?
buttonCenter
;
final
Function
?
funcCenter
;
final
String
?
buttonRight
;
final
Function
?
funcRight
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -89,31 +102,36 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
namesRoute:
true
,
header:
true
,
child:
Container
(
// decoration: new BoxDecoration(
// color: Colors.red,
// ),
alignment:
Alignment
.
center
,
width:
double
.
infinity
,
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
48.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
child:
isShowButtons
?
Row
(
children:
[
TextButton
(
onPressed:
()
{},
child:
const
Text
(
"一言"
,
style:
TextStyle
(
color:
Colors
.
white
),),
onPressed:
()
=>
funcLeft
!(),
child:
Text
(
buttonLeft
??
"一言"
,
style:
const
TextStyle
(
color:
Colors
.
white
),
),
),
const
Text
(
"|"
),
TextButton
(
onPressed:
()
{},
child:
const
Text
(
"译解"
,
style:
TextStyle
(
color:
Colors
.
white
),),
onPressed:
()
=>
funcCenter
!(),
child:
Text
(
buttonCenter
??
"译解"
,
style:
const
TextStyle
(
color:
Colors
.
white
),
),
),
const
Text
(
"|"
),
TextButton
(
onPressed:
()
{},
child:
const
Text
(
"临境"
,
style:
TextStyle
(
color:
Colors
.
white
),),
onPressed:
()
=>
funcRight
!(),
child:
Text
(
buttonRight
??
"临境"
,
style:
const
TextStyle
(
color:
Colors
.
white
),
),
],
),
],
)
:
Gaps
.
hGap10
,
),
);
...
...
Please
register
or
login
to post a comment