feat: v1.1.4+6 - waterfall card visual upgrade

This commit is contained in:
Ubuntu 2026-02-17 18:12:47 +08:00
parent 81a00bd79b
commit 85c69671e8
3 changed files with 49 additions and 72 deletions

View File

@ -3,7 +3,6 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'publish_screen.dart';
import 'activity_detail_screen.dart';
import 'friends_screen.dart';
import 'dart:math';
class ActivityListScreen extends StatefulWidget {
@override
@ -127,23 +126,24 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
return RefreshIndicator(
onRefresh: _refreshActivities,
child: Padding(
padding: EdgeInsets.all(8),
padding: EdgeInsets.all(12),
child: MasonryGridView.count(
crossAxisCount: 2,
mainAxisSpacing: 8,
crossAxisSpacing: 8,
mainAxisSpacing: 10,
crossAxisSpacing: 10,
itemCount: activities.length,
itemBuilder: (context, index) {
return _buildActivityCard(activities[index]);
return _buildActivityCard(activities[index], index);
},
),
),
);
}
Widget _buildActivityCard(Map<String, dynamic> activity) {
final random = Random(activity['title'].hashCode);
final height = 200.0 + random.nextInt(100);
Widget _buildActivityCard(Map<String, dynamic> activity, int index) {
final imageHeight = index.isOdd ? 160.0 : 210.0;
final coverUrl =
'https://picsum.photos/seed/${activity['title'].hashCode.abs()}/400/300';
return GestureDetector(
onTap: () {
@ -161,8 +161,8 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.08),
blurRadius: 8,
color: Colors.black.withOpacity(0.06),
blurRadius: 6,
offset: Offset(0, 2),
),
],
@ -173,36 +173,29 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
//
ClipRRect(
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
child: Container(
height: height,
width: double.infinity,
color: Colors.grey[200],
child: Stack(
children: [
Center(
child: Icon(Icons.image, size: 40, color: Colors.grey[400]),
),
Image.network(
activity['image'],
height: height,
child: SizedBox(
height: imageHeight,
width: double.infinity,
child: Image.network(
coverUrl,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {
return Container(
color: Colors.grey[200],
child: Center(
child: Icon(Icons.image, size: 40, color: Colors.grey[400]),
alignment: Alignment.center,
child: Icon(
Icons.image_outlined,
size: 40,
color: Colors.grey[400],
),
);
},
),
],
),
),
),
//
Padding(
padding: EdgeInsets.all(12),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -210,57 +203,31 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
activity['title'],
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.bold,
color: Color(0xFF333333),
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
SizedBox(height: 8),
Row(
children: [
Icon(Icons.location_on, size: 14, color: Color(0xFF999999)),
SizedBox(width: 4),
Expanded(
child: Text(
activity['location'],
style: TextStyle(
fontSize: 12,
color: Color(0xFF999999),
),
overflow: TextOverflow.ellipsis,
),
),
],
),
SizedBox(height: 4),
Row(
children: [
Icon(Icons.people, size: 14, color: Color(0xFF999999)),
SizedBox(width: 4),
Text(
'${activity['participants']}人报名',
style: TextStyle(
fontSize: 12,
color: Color(0xFF999999),
),
),
],
),
SizedBox(height: 8),
Row(
children: [
SizedBox(
width: 24,
height: 24,
width: 32,
height: 32,
child: ClipOval(
child: Image.network(
'https://i.pravatar.cc/50?img=${activity['avatarSeed']}',
'https://i.pravatar.cc/40?img=${activity['avatarSeed']}',
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {
return Container(
color: Colors.grey[200],
child: Icon(Icons.person, size: 14, color: Colors.grey[500]),
alignment: Alignment.center,
child: Icon(
Icons.person,
size: 16,
color: Colors.grey[500],
),
);
},
),
@ -268,15 +235,25 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
),
SizedBox(width: 8),
Expanded(
flex: 3,
child: Text(
activity['creator'],
style: TextStyle(
fontSize: 12,
color: Color(0xFF999999),
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
Spacer(flex: 1),
Text(
'${activity['participants']}',
style: TextStyle(
fontSize: 12,
color: Color(0xFFFF6B35),
),
),
],
),
],

View File

@ -1,6 +1,6 @@
name: banxiang_app
description: 伴享
version: 1.1.3+5
version: 1.1.4+6
environment:
sdk: '>=3.0.0 <4.0.0'

Binary file not shown.