feat: v1.1.1 - avatar picker + feed user info
This commit is contained in:
parent
c433f183fa
commit
1e2afa6459
@ -19,36 +19,48 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
|
||||
'location': '人民公园',
|
||||
'participants': 12,
|
||||
'image': 'https://picsum.photos/seed/1/400/300',
|
||||
'creator': '王阿姨',
|
||||
'avatarSeed': 11,
|
||||
},
|
||||
{
|
||||
'title': '社区书法班开课啦',
|
||||
'location': '社区活动中心',
|
||||
'participants': 8,
|
||||
'image': 'https://picsum.photos/seed/2/400/500',
|
||||
'creator': '李老师',
|
||||
'avatarSeed': 22,
|
||||
},
|
||||
{
|
||||
'title': '广场舞队招新',
|
||||
'location': '中央广场',
|
||||
'participants': 25,
|
||||
'image': 'https://picsum.photos/seed/3/400/400',
|
||||
'creator': '张姐',
|
||||
'avatarSeed': 33,
|
||||
},
|
||||
{
|
||||
'title': '老年摄影兴趣小组',
|
||||
'location': '文化馆',
|
||||
'participants': 15,
|
||||
'image': 'https://picsum.photos/seed/4/400/350',
|
||||
'creator': '陈叔',
|
||||
'avatarSeed': 44,
|
||||
},
|
||||
{
|
||||
'title': '周三棋牌活动',
|
||||
'location': '社区会所',
|
||||
'participants': 20,
|
||||
'image': 'https://picsum.photos/seed/5/400/450',
|
||||
'creator': '赵大哥',
|
||||
'avatarSeed': 55,
|
||||
},
|
||||
{
|
||||
'title': '健康养生讲座',
|
||||
'location': '图书馆',
|
||||
'participants': 30,
|
||||
'image': 'https://picsum.photos/seed/6/400/380',
|
||||
'creator': '刘阿姨',
|
||||
'avatarSeed': 66,
|
||||
},
|
||||
];
|
||||
|
||||
@ -218,6 +230,38 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
'https://i.pravatar.cc/50?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]),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
activity['creator'],
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Color(0xFF999999),
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../services/auth_service.dart';
|
||||
import '../utils/constants.dart';
|
||||
import 'activity_list_screen.dart';
|
||||
@ -13,10 +17,19 @@ class _ProfileSetupScreenState extends State<ProfileSetupScreen> {
|
||||
final _pageController = PageController();
|
||||
int _currentStep = 0;
|
||||
final _nicknameController = TextEditingController();
|
||||
final ImagePicker _picker = ImagePicker();
|
||||
String? _gender;
|
||||
int? _birthYear;
|
||||
XFile? _avatar;
|
||||
final Set<String> _selectedInterests = {};
|
||||
|
||||
Future<void> _pickAvatar() async {
|
||||
final XFile? avatar = await _picker.pickImage(source: ImageSource.gallery, imageQuality: 85);
|
||||
if (avatar != null) {
|
||||
setState(() => _avatar = avatar);
|
||||
}
|
||||
}
|
||||
|
||||
void _nextStep() {
|
||||
if (_currentStep < 2) {
|
||||
setState(() => _currentStep++);
|
||||
@ -66,11 +79,12 @@ class _ProfileSetupScreenState extends State<ProfileSetupScreen> {
|
||||
const SizedBox(height: 32),
|
||||
Center(
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
onTap: _pickAvatar,
|
||||
child: CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundImage: _avatar != null ? FileImage(File(_avatar!.path)) : null,
|
||||
backgroundColor: const Color(0xFFE3F2FD),
|
||||
child: const Icon(Icons.camera_alt, size: 32, color: Color(0xFF1976D2)),
|
||||
child: _avatar == null ? const Icon(Icons.camera_alt, size: 32, color: Color(0xFF1976D2)) : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
name: banxiang_app
|
||||
description: 伴享
|
||||
version: 1.1.0+2
|
||||
version: 1.1.1+3
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user