Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.8k stars 876 forks source link

V3 context.style.markerContent replacement #1430

Open vlowe85 opened 4 months ago

vlowe85 commented 4 months ago

Hi,

In v2, i could use customRender on li and get the marker like this Text((extensionContext.style.markerContent as Text).data!,. what is the alternative in v3?

              extensions: [
                TagExtension(
                  tagsToExtend: {"li"},
                  builder: (extensionContext) {
                    return Padding(
                      padding: const EdgeInsets.symmetric(vertical: 8.0),
                      child: Container(
                          decoration: BoxDecoration(
                              color: context.col.oldColourIconChosenBackground,
                              borderRadius: const BorderRadius.all(Radius.circular(8))
                          ),
                          child: Padding(
                            padding: const EdgeInsets.all(12.0),
                            child: Row(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Padding(
                                  padding: const EdgeInsets.only(right: 8.0),
                                  child: Text((extensionContext.style.markerContent as Text).data!,
                                    style: textStyleBodyLarge.copyWith(color: context.col.oldColourStandardSelectedAlternate),
                                  ),
                                ),
                                Expanded(child: Text(extensionContext.element!.innerHtml,
                                    style: textStyleBodyLarge.copyWith(color: context.col.oldColourTextInsightsMoodEmptyBody)
                                ),
                                )],
                            ),
                          )
                      ),
                    );
                  },
                ),
              ],