🐛 Fix post metadata uses wrong key to deserialize

This commit is contained in:
2026-01-03 12:45:28 +08:00
parent 188b6821a2
commit 703335429a
7 changed files with 18 additions and 26 deletions

View File

@@ -1,7 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:island/models/embed.dart';
import 'package:island/utils/mapping.dart';
import 'package:island/widgets/content/embed/link.dart';
import 'package:island/widgets/poll/poll_submit.dart';
import 'package:island/widgets/wallet/fund_envelope.dart';
@@ -25,15 +24,8 @@ class EmbedListWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final normalizedEmbeds = embeds
.map((e) => convertMapKeysToSnakeCase(e as Map<String, dynamic>))
.toList();
final linkEmbeds = normalizedEmbeds
.where((e) => e['type'] == 'link')
.toList();
final otherEmbeds = normalizedEmbeds
.where((e) => e['type'] != 'link')
.toList();
final linkEmbeds = embeds.where((e) => e['type'] == 'link').toList();
final otherEmbeds = embeds.where((e) => e['type'] != 'link').toList();
return Column(
children: [