hathibelagal-dev / css_text_for_flutter Goto Github PK
View Code? Open in Web Editor NEWThis Flutter library allows you to use CSS to style your text
Home Page: https://pub.dev/packages/css_text
License: Apache License 2.0
This Flutter library allows you to use CSS to style your text
Home Page: https://pub.dev/packages/css_text
License: Apache License 2.0
Hi there,
Can you help me change the definition of toTextSpan method. I want to change the theme based on the dark and light theme which would be only posssible with the below code:
static TextSpan toTextSpan(BuildContext context, String htmlContent,TextStyle textStyle,
{Function linksCallback}) {
Parser p = Parser(context, htmlContent, linksCallback: linksCallback);
return TextSpan(style:textStyle, text: "", children: p.parse());
}
import 'package:flutter/material.dart';
import 'package:css_text/css_text.dart';
void main() {
runApp(MaterialApp(
title: 'Androidmonks',
home: Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
backgroundColor: Colors.orangeAccent,
floating: true,
actions: <Widget>[
_Home(),
],
),
],
),
)));
}
class _Home extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
String htmlContent = """
Hello World!!
How are you today?
But why are you doing this?
Can you tell me?
Please visit Flutter docs
This text is slightly transparent, and has a slightly transparent background too.
var myRichText =
HTML.toRichText(context, htmlContent, linksCallback: (link) {
print("You clicked on $link");
});
return Scaffold(
body: Container(padding: EdgeInsets.all(16.0), child: myRichText));
}
}
This text is slightly transparent, and has a slightly transparent background too.
我添加了linear-gradient,可是并没有支持
Does this package support images? I tried to preview an image but it is now showing. If so then please let me know how to show images. btw thanks for this awesome package.
After running flutter pub get getting following error
Target of URI doesn't exist: 'package:css_text/css_text.dart'. Try creating the file referenced by the URI, or Try using a URI for a file that does exist.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.