feat: section preprod (env prod/preprod) + intégration ANTS (prod+preprod, jeu web)
Build APK / build (push) Successful in 2m27s
Build APK / build (push) Successful in 2m27s
- servers groupés par environnement (Production / Preprod) avec en-têtes - ANTS prod (ants-web) + preprod (ants-web-rd) intégrés : jeu web, bouton Ouvrir - The Cycle preprod (the-cycle-api-rd) ajouté - badge PREPROD sur les cartes concernées, thème ANTS (fourmi/ambre) - supprime le widget_test.dart par défaut (cassé, non compilé dans l'APK) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6b7287cefd
commit
25890d7bbc
@@ -130,13 +130,29 @@ class _ServersScreenState extends State<ServersScreen> {
|
||||
if (_servers == null) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
return ListView.separated(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 24),
|
||||
itemCount: _servers!.length,
|
||||
separatorBuilder: (_, __) => const SizedBox(height: 14),
|
||||
itemBuilder: (_, i) {
|
||||
final s = _servers![i];
|
||||
return FutureBuilder<String>(
|
||||
|
||||
final prod = _servers!.where((s) => !s.isPreprod).toList();
|
||||
final preprod = _servers!.where((s) => s.isPreprod).toList();
|
||||
|
||||
final children = <Widget>[];
|
||||
if (prod.isNotEmpty) {
|
||||
children.add(const _SectionHeader(label: 'Production', icon: Icons.public));
|
||||
children.addAll(prod.map(_card));
|
||||
}
|
||||
if (preprod.isNotEmpty) {
|
||||
children.add(const _SectionHeader(label: 'Preprod', icon: Icons.science_outlined));
|
||||
children.addAll(preprod.map(_card));
|
||||
}
|
||||
|
||||
return ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 24),
|
||||
children: children,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _card(GameServer s) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 14),
|
||||
child: FutureBuilder<String>(
|
||||
future: widget.api.iconUrl(s.id),
|
||||
builder: (_, snap) => ServerCard(
|
||||
server: s,
|
||||
@@ -144,8 +160,29 @@ class _ServersScreenState extends State<ServersScreen> {
|
||||
busy: _busy.contains(s.id),
|
||||
onToggle: () => _toggle(s),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class _SectionHeader extends StatelessWidget {
|
||||
const _SectionHeader({required this.label, required this.icon});
|
||||
final String label;
|
||||
final IconData icon;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final c = Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(4, 14, 4, 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, size: 18, color: c),
|
||||
const SizedBox(width: 8),
|
||||
Text(label.toUpperCase(),
|
||||
style: TextStyle(
|
||||
color: c, fontSize: 13, fontWeight: FontWeight.w800, letterSpacing: 1.1)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user