【直播】更新直播列表,视频列表,图文列表

master
laiiihz 5 years ago
parent 2882c191d9
commit 15433de10a

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

@ -344,9 +344,21 @@ class R {
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/live/add_video.png)
static const String ASSETS_LIVE_ADD_VIDEO_PNG = 'assets/live/add_video.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/live/favorite.png)
static const String ASSETS_LIVE_FAVORITE_PNG = 'assets/live/favorite.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/live/favorite_black.png)
static const String ASSETS_LIVE_FAVORITE_BLACK_PNG = 'assets/live/favorite_black.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/live/on_stream.png)
static const String ASSETS_LIVE_ON_STREAM_PNG = 'assets/live/on_stream.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/live/recook_fab.png)
static const String ASSETS_LIVE_RECOOK_FAB_PNG = 'assets/live/recook_fab.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/live/stream_play_back.png)
static const String ASSETS_LIVE_STREAM_PLAY_BACK_PNG = 'assets/live/stream_play_back.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/live/user.png)
static const String ASSETS_LIVE_USER_PNG = 'assets/live/user.png';

@ -1,7 +1,12 @@
import 'package:flutter/material.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/constants/styles.dart';
import 'package:recook/pages/business/recommend/child_recommend_page.dart';
import 'package:recook/pages/live/sub_page/image_text_page.dart';
import 'package:recook/pages/live/sub_page/live_stream_page.dart';
import 'package:recook/pages/live/sub_page/video_page.dart';
import 'package:recook/pages/live/widget/round_tab_bar_indicator.dart';
import 'package:recook/widgets/cache_tab_bar_view.dart';
import 'package:recook/widgets/custom_image_button.dart';
class DiscoveryPage extends StatefulWidget {
@ -83,7 +88,16 @@ class _DiscoveryPageState extends State<DiscoveryPage>
],
),
),
)
),
Expanded(
child: CacheTabBarView(
controller: _tabController,
children: [
LiveStreamPage(),
VideoPage(),
RecommendPage(),
],
)),
],
),
);

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
class ImageTextPage extends StatefulWidget {
ImageTextPage({Key key}) : super(key: key);
@override
_ImageTextPageState createState() => _ImageTextPageState();
}
class _ImageTextPageState extends State<ImageTextPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
);
}
}

@ -0,0 +1,269 @@
import 'package:flutter/material.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/widgets/custom_image_button.dart';
class LiveStreamPage extends StatefulWidget {
LiveStreamPage({Key key}) : super(key: key);
@override
_LiveStreamPageState createState() => _LiveStreamPageState();
}
class _LiveStreamPageState extends State<LiveStreamPage> {
@override
Widget build(BuildContext context) {
return Column(
children: [
_buildAttentions(),
Expanded(
child: _buildLiveUsers(),
),
],
);
}
_buildAttentions() {
return Container(
height: rSize(102),
child: Row(
children: [
Expanded(
child: ListView.separated(
padding: EdgeInsets.symmetric(
horizontal: rSize(20),
vertical: rSize(15),
),
separatorBuilder: (context, index) {
return SizedBox(width: rSize(16));
},
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return _buildAttentionBox('user $index');
},
itemCount: 20,
),
),
Container(
width: rSize(52),
child: CustomImageButton(
height: rSize(102),
onPressed: () {},
child: Text(
'全部\n关注',
style: TextStyle(
color: Color(0xFFDB2D2D),
fontSize: rSP(11),
),
),
),
),
],
),
);
}
_buildAttentionBox(String nickName) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Stack(
children: [
CircleAvatar(
radius: rSize(52 / 2),
),
Positioned(
right: rSize(3),
bottom: 0,
child: Image.asset(
R.ASSETS_LIVE_ON_STREAM_PNG,
height: rSize(12),
width: rSize(12),
),
),
],
),
SizedBox(height: rSize(4)),
Text(
nickName,
style: TextStyle(
color: Color(0xFF666666),
fontSize: rSP(11),
),
),
],
);
}
_buildLiveUsers() {
return GridView.builder(
padding: EdgeInsets.symmetric(
horizontal: rSize(16),
vertical: rSize(5),
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 165 / 249,
crossAxisSpacing: rSize(15),
mainAxisSpacing: rSize(15),
),
itemBuilder: (context, index) {
return _buildGridCard();
},
itemCount: 20,
);
}
_buildGridCard() {
return ClipRRect(
borderRadius: BorderRadius.circular(rSize(10)),
child: Container(
color: Colors.white,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Stack(
children: [
AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.blueGrey,
child: Placeholder(),
),
),
Positioned(
left: rSize(10),
top: rSize(10),
child: Container(
height: rSize(15),
decoration: BoxDecoration(
color: Color(0xFF050505).withOpacity(0.18),
borderRadius: BorderRadius.circular(rSize(2)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(R.ASSETS_LIVE_ON_STREAM_PNG),
Text(
'1234人观看',
style: TextStyle(
color: Colors.white,
fontSize: rSP(10),
),
),
SizedBox(width: rSize(2)),
],
),
),
),
Positioned(
right: rSize(10),
bottom: rSize(2),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
R.ASSETS_LIVE_FAVORITE_PNG,
width: rSize(10),
height: rSize(10),
),
Text(
'334',
style: TextStyle(
color: Colors.white,
fontSize: rSP(10),
),
),
SizedBox(width: rSize(2)),
],
),
),
],
),
Expanded(
child: Padding(
padding: EdgeInsets.all(rSize(10)),
child: Row(
children: [
Expanded(
child: Column(
children: [
Expanded(
child: Text(
'年中厨具福利专场年中厨具福利专场…',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF333333),
fontSize: rSP(13),
fontWeight: FontWeight.w600,
),
),
),
Row(
children: [
CircleAvatar(
radius: rSize(10),
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: rSize(6),
),
child: Text(
'NAME NAME NAME',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: rSP(13),
color: Color(0xFF333333),
),
),
),
),
],
),
],
),
),
SizedBox(width: rSize(10)),
AspectRatio(
aspectRatio: 50 / 64,
child: ClipRRect(
borderRadius: BorderRadius.circular(rSize(5)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.blue,
child: Placeholder(),
),
),
Expanded(
child: Container(
alignment: Alignment.center,
color: Color(0xFFF7F7F7),
child: Text(
'¥244',
style: TextStyle(
color: Color(0xFF333333),
fontSize: rSP(10),
),
),
),
),
],
),
),
),
],
),
),
),
],
),
),
);
}
}

@ -0,0 +1,101 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:recook/const/resource.dart';
import 'package:recook/constants/constants.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
class VideoPage extends StatefulWidget {
VideoPage({Key key}) : super(key: key);
@override
_VideoPageState createState() => _VideoPageState();
}
class _VideoPageState extends State<VideoPage> {
@override
Widget build(BuildContext context) {
return WaterfallFlow.builder(
padding: EdgeInsets.all(rSize(15)),
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: rSize(15),
mainAxisSpacing: rSize(15),
),
itemBuilder: (context, index) {
//TODO: TEST ONLY
final randomHeight = 50 + Random().nextDouble() * 150;
return ClipRRect(
borderRadius: BorderRadius.circular(rSize(10)),
child: Container(
color: Colors.white,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: randomHeight,
child: Placeholder(),
),
Container(
padding: EdgeInsets.all(rSize(10)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'更有3档风速可调风大风小随你掌控更有3档风速可调风大风小随你掌控',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF333333),
fontWeight: FontWeight.w600,
fontSize: rSP(13),
),
),
SizedBox(height: rSize(6)),
Row(
children: [
CircleAvatar(
radius: rSize(9),
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: rSize(4),
),
child: Text(
'NAME NAME NAME',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF666666),
fontSize: rSP(12),
),
),
),
),
Image.asset(
R.ASSETS_LIVE_FAVORITE_BLACK_PNG,
height: rSize(14),
width: rSize(14),
),
SizedBox(width: rSize(2)),
Text(
'${Random().nextInt(100)}',
style: TextStyle(
color: Color(0xFF666666),
fontSize: rSP(12),
),
),
],
),
],
),
),
],
),
),
);
},
);
}
}

@ -246,6 +246,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.3"
extended_list_library:
dependency: transitive
description:
name: extended_list_library
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
extended_text:
dependency: "direct main"
description:
@ -1033,6 +1040,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.7+15"
waterfall_flow:
dependency: "direct main"
description:
name: waterfall_flow
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.3"
web_socket_channel:
dependency: transitive
description:

@ -179,6 +179,8 @@ dependencies:
#腾讯直播
#瀑布流
waterfall_flow: 2.0.3
dev_dependencies:
flutter_test:

Loading…
Cancel
Save