This commit is contained in:
2026-09-29 14:26:17 +02:00
parent 88a7c2eba0
commit 06fe43bba3
24 changed files with 985 additions and 174 deletions

View File

@@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
/// Vue 2 — squelette étape 3 ; détails complets à l’étape 4.
class ProfileScreen extends StatelessWidget {
const ProfileScreen({super.key, required this.user});
final Map<String, dynamic> user;
String? _imageUrl() {
final image = user['image'];
if (image is Map<String, dynamic>) {
final link = image['link'];
if (link is String && link.isNotEmpty) return link;
}
final url = user['image_url'];
if (url is String && url.isNotEmpty) return url;
return null;
}
@override
Widget build(BuildContext context) {
final login = user['login']?.toString() ?? '?';
final imageUrl = _imageUrl();
return Scaffold(
appBar: AppBar(
title: Text(login),
backgroundColor: const Color(0xFF00BABC),
foregroundColor: Colors.black,
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Center(
child: CircleAvatar(
radius: 56,
backgroundImage:
imageUrl != null ? NetworkImage(imageUrl) : null,
child: imageUrl == null
? Text(
login.isNotEmpty ? login[0].toUpperCase() : '?',
style: const TextStyle(fontSize: 32),
)
: null,
),
),
const SizedBox(height: 16),
Text(
login,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(height: 24),
Text(
'Étape 4 à venir : email, level, skills, projets (dont failed), etc.',
style: Theme.of(context).textTheme.bodyMedium,
),
const SizedBox(height: 8),
Text(
'ID Intra : ${user['id'] ?? '—'}',
style: Theme.of(context).textTheme.bodySmall,
),
],
),
),
);
}
}