Closed tobiasht closed 1 year ago
I want to remove the color from a p-tag, so i use a customRenderer. But I am unsure how to use the matcher with the new customRenderer to achieve this. This is what i have tried so far.
MatcherExtension( matcher: (p0) { return p0.element?.localName == 'p'; }, builder: (extensionContext) { return Container( width: double.infinity, color: Theme.of(context).scaffoldBackgroundColor, child: Text( extensionContext.element!.text, style: const TextStyle( color: BaseScheme.foregroundPrimary, height: 1.5, fontSize: 16, fontWeight: FontWeight.w400, ), ), ); }, ),
TagExtension( tagsToExtend: {"p"}, builder: (extensionContext) { return Container( width: double.infinity, color: Theme.of(context).scaffoldBackgroundColor, child: Text( extensionContext.element!.text, style: const TextStyle( color: BaseScheme.foregroundPrimary, height: 1.5, fontSize: 16, fontWeight: FontWeight.w400, ), ), ); }, ),
Apparently it was working, i just had an error in my code. The second example is the correct way to do it.
I want to remove the color from a p-tag, so i use a customRenderer. But I am unsure how to use the matcher with the new customRenderer to achieve this. This is what i have tried so far.