-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi!
I've tried to create my item for word cloud, replacing flutter hashtags. Color works but the font size no.
In file flutter_scatter/example/lib/screens/word_cloud.dart, at the line 35, "body1" is deprecated, I've tried to use "bodyText1", "bodyText2" and others, but nothing changed. What can I do?
Thanks.
There is my code:
class WordsCloudItem extends StatelessWidget {
final String text;
Color color;
double size;
int rotated;
final int index;
WordsCloudItem(
this.text,
this.index
){
setSizeAndColor();
this.rotated = Random().nextInt(2);
}
@OverRide
Widget build(BuildContext context) =>
RotatedBox(
quarterTurns: rotated,
child: Text(
this.text,
style: TextStyle(
fontSize: size,
color: color
)
),
);
void setSizeAndColor(){
if(index>81){color = Colors.red; size = 30.0;}
else if(index>61){color = Colors.orange; size = 28.0; }
else if(index>41){color = Colors.green; size = 26.0;}
else if(index>21){color = Colors.blue; size = 24.0;}
else color = Colors.purple; size = 22.0;
}
}