Browse Source

排版直播间页面

master
YakumoChen 4 months ago
parent
commit
14d9c2c0e3
23 changed files with 2007 additions and 121 deletions
  1. BIN
      assets/ad.png
  2. BIN
      assets/ali_pay.png
  3. BIN
      assets/arrow_r.png
  4. BIN
      assets/check.png
  5. BIN
      assets/close_arrow.png
  6. BIN
      assets/fire_icon.png
  7. BIN
      assets/first_pay.png
  8. BIN
      assets/gift1.png
  9. BIN
      assets/gift2.png
  10. BIN
      assets/gift3.png
  11. BIN
      assets/gift4.png
  12. BIN
      assets/gift5.png
  13. BIN
      assets/gift_icon.png
  14. BIN
      assets/mic_close.png
  15. BIN
      assets/mic_open.png
  16. BIN
      assets/rose_gift.png
  17. BIN
      assets/rose_white.png
  18. BIN
      assets/seat.png
  19. BIN
      assets/wechat_pay.png
  20. 249
      lib/pages/live_page.dart
  21. 1868
      lib/pages/live_room_page.dart
  22. 9
      lib/router/app_router.dart
  23. 2
      lib/router/route_paths.dart

BIN
assets/ad.png

Before After
Width: 294  |  Height: 650  |  Size: 102 KiB

BIN
assets/ali_pay.png

Before After
Width: 70  |  Height: 70  |  Size: 1.8 KiB

BIN
assets/arrow_r.png

Before After
Width: 64  |  Height: 64  |  Size: 672 B

BIN
assets/check.png

Before After
Width: 27  |  Height: 21  |  Size: 208 B

BIN
assets/close_arrow.png

Before After
Width: 57  |  Height: 56  |  Size: 501 B

BIN
assets/fire_icon.png

Before After
Width: 42  |  Height: 48  |  Size: 517 B

BIN
assets/first_pay.png

Before After
Width: 274  |  Height: 133  |  Size: 19 KiB

BIN
assets/gift1.png

Before After
Width: 164  |  Height: 176  |  Size: 23 KiB

BIN
assets/gift2.png

Before After
Width: 174  |  Height: 190  |  Size: 30 KiB

BIN
assets/gift3.png

Before After
Width: 210  |  Height: 210  |  Size: 30 KiB

BIN
assets/gift4.png

Before After
Width: 180  |  Height: 180  |  Size: 28 KiB

BIN
assets/gift5.png

Before After
Width: 160  |  Height: 160  |  Size: 23 KiB

BIN
assets/gift_icon.png

Before After
Width: 79  |  Height: 79  |  Size: 4.7 KiB

BIN
assets/mic_close.png

Before After
Width: 43  |  Height: 46  |  Size: 596 B

BIN
assets/mic_open.png

Before After
Width: 40  |  Height: 46  |  Size: 522 B

BIN
assets/rose_gift.png

Before After
Width: 86  |  Height: 86  |  Size: 9.5 KiB

BIN
assets/rose_white.png

Before After
Width: 56  |  Height: 102  |  Size: 921 B

BIN
assets/seat.png

Before After
Width: 146  |  Height: 144  |  Size: 8.6 KiB

BIN
assets/wechat_pay.png

Before After
Width: 70  |  Height: 70  |  Size: 1.7 KiB

249
lib/pages/live_page.dart

@ -1,8 +1,10 @@
import 'package:dating_touchme_app/components/home_appbar.dart';
import 'package:dating_touchme_app/provide/user_info.dart';
import 'package:dating_touchme_app/router/route_paths.dart';
import 'package:dating_touchme_app/utils/storage.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
class LivePage extends StatefulWidget {
@ -159,149 +161,154 @@ class LiveItem extends StatefulWidget {
class _LiveItemState extends State<LiveItem> {
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(20.w)),
child: Stack(
children: [
Container(
width: 343.w,
height: 343.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.w))
),
child: Image.network(
"https://picsum.photos/400",
return InkWell(
onTap: (){
context.pushNamed(RouteNames.liveRoom, queryParameters: {"id" : "0"});
},
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(20.w)),
child: Stack(
children: [
Container(
width: 343.w,
height: 343.w,
),
),
Positioned(
top: 0,
left: 0,
child: Stack(
children: [
Image.asset(
"assets/subscript.png",
width: 113.w,
height: 32.w,
),
SizedBox(
height: 32.w,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 10.w,),
Image.asset(
"assets/location_icon.png",
width: 12.w,
height: 14.w,
),
SizedBox(width: 6.w,),
Text(
"49.9km",
style: TextStyle(
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
)
],
),
)
],
),
),
if(widget.item["isNew"]) Positioned(
top: 19.w,
right: 17.w,
child: Container(
width: 79.w,
height: 26.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(26.w)),
color: const Color.fromRGBO(0, 0, 0, .3)
borderRadius: BorderRadius.all(Radius.circular(20.w))
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
child: Image.network(
"https://picsum.photos/400",
width: 343.w,
height: 343.w,
),
),
Positioned(
top: 0,
left: 0,
child: Stack(
children: [
Container(
width: 10.w,
height: 10.w,
margin: EdgeInsets.only(right: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.w)),
color: const Color.fromRGBO(255, 209, 43, 1)
),
Image.asset(
"assets/subscript.png",
width: 113.w,
height: 32.w,
),
Text(
"等待",
style: TextStyle(
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
SizedBox(
height: 32.w,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 10.w,),
Image.asset(
"assets/location_icon.png",
width: 12.w,
height: 14.w,
),
SizedBox(width: 6.w,),
Text(
"49.9km",
style: TextStyle(
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
)
],
),
)
],
),
),
),
Positioned(
left: 18.w,
bottom: 13.w,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 128.w,
child: Text(
"一直一直在等你一直一直在等你......",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
if(widget.item["isNew"]) Positioned(
top: 19.w,
right: 17.w,
child: Container(
width: 79.w,
height: 26.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(26.w)),
color: const Color.fromRGBO(0, 0, 0, .3)
),
SizedBox(height: 5.w,),
Row(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 10.w,
height: 10.w,
margin: EdgeInsets.only(right: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.w)),
color: const Color.fromRGBO(255, 209, 43, 1)
),
),
Text(
"福州 | 28岁",
"等待",
style: TextStyle(
fontSize: 22.w,
color: Colors.white,
fontWeight: FontWeight.w500
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
SizedBox(width: 11.w,),
if(widget.item["isNew"]) Container(
width: 65.w,
height: 21.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(21.w)),
color: const Color.fromRGBO(255, 206, 28, .8)
)
],
),
),
),
Positioned(
left: 18.w,
bottom: 13.w,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 128.w,
child: Text(
"一直一直在等你一直一直在等你......",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
child: Center(
child: Text(
"新人",
style: TextStyle(
fontSize: 16.w,
),
),
SizedBox(height: 5.w,),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"福州 | 28岁",
style: TextStyle(
fontSize: 22.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
)
],
)
],
),
)
],
SizedBox(width: 11.w,),
if(widget.item["isNew"]) Container(
width: 65.w,
height: 21.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(21.w)),
color: const Color.fromRGBO(255, 206, 28, .8)
),
child: Center(
child: Text(
"新人",
style: TextStyle(
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
)
],
)
],
),
)
],
),
),
);
}

1868
lib/pages/live_room_page.dart
File diff suppressed because it is too large
View File

9
lib/router/app_router.dart

@ -1,5 +1,6 @@
import 'package:dating_touchme_app/pages/complete_info.dart';
import 'package:dating_touchme_app/pages/home_page.dart';
import 'package:dating_touchme_app/pages/live_room_page.dart';
import 'package:dating_touchme_app/pages/login_page.dart';
import 'package:dating_touchme_app/pages/open_webview.dart';
import 'package:dating_touchme_app/pages/test_page.dart';
@ -58,6 +59,14 @@ class AppRouter {
return UserInfoPage(id: id,);
},
),
GoRoute(
name: RouteNames.liveRoom,
path: RoutePaths.liveRoom,
builder: (context, state) {
final id = int.parse(state.uri.queryParameters['id'] ?? '0');
return LiveRoomPage(id: id,);
},
),
GoRoute(
name: RouteNames.test,
path: RoutePaths.test,

2
lib/router/route_paths.dart

@ -5,6 +5,7 @@ class RouteNames {
static const webview = 'webview';
static const completeInfo = 'completeInfo';
static const userInfo = 'userInfo';
static const liveRoom = 'liveRoom';
static const test = 'test';
}
@ -14,5 +15,6 @@ class RoutePaths {
static const webview = '/webview';
static const completeInfo = '/completeInfo';
static const userInfo = '/userInfo';
static const liveRoom = '/liveRoom';
static const test = '/test';
}
Loading…
Cancel
Save