🎨 Continued to rearrange core folders content

This commit is contained in:
2026-02-06 00:57:17 +08:00
parent 862e3b451b
commit dfcbfcb31e
154 changed files with 259 additions and 269 deletions

View File

@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
class ProposalsSection extends StatelessWidget {
const ProposalsSection({
super.key,
required this.proposals,
required this.onProposalAction,
});
final List<Map<String, String>> proposals;
final void Function(BuildContext, Map<String, String>) onProposalAction;
@override
Widget build(BuildContext context) {
if (proposals.isEmpty) {
return const SizedBox.shrink();
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
spacing: 8,
runSpacing: 8,
children:
proposals.map((proposal) {
return ElevatedButton.icon(
onPressed: () => onProposalAction(context, proposal),
icon: Icon(switch (proposal['type']) {
'post_create' => Symbols.add,
_ => Symbols.lightbulb,
}, size: 16),
label: Text(switch (proposal['type']) {
'post_create' => 'Create Post',
_ => proposal['type'] ?? 'Action',
}),
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
foregroundColor:
Theme.of(context).colorScheme.onPrimaryContainer,
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
),
);
}).toList(),
),
],
);
}
}