63 lines
1.6 KiB
Dart
63 lines
1.6 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_scatter/flutter_scatter.dart';
|
||
|
import 'package:konectar_events/widgets/flutter_hashtags.dart';
|
||
|
|
||
|
class ScatterItem extends StatelessWidget {
|
||
|
ScatterItem(this.hashtag, this.index);
|
||
|
final FlutterHashtag hashtag;
|
||
|
final int index;
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
List<Color> randomColors = [
|
||
|
FlutterColors.blue,
|
||
|
FlutterColors.blue400,
|
||
|
FlutterColors.blue,
|
||
|
FlutterColors.gray,
|
||
|
FlutterColors.gray100,
|
||
|
FlutterColors.gray600,
|
||
|
FlutterColors.yellow,
|
||
|
FlutterColors.yellow500
|
||
|
];
|
||
|
final TextStyle style = Theme.of(context).textTheme.bodySmall!.copyWith(
|
||
|
fontSize: hashtag.size.toDouble(),
|
||
|
color: (randomColors..shuffle()).first,
|
||
|
);
|
||
|
return RotatedBox(
|
||
|
quarterTurns: 0,
|
||
|
child: Text(
|
||
|
hashtag.hashtag,
|
||
|
style: style,
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class FlutterHashtag {
|
||
|
const FlutterHashtag(
|
||
|
this.hashtag,
|
||
|
this.size,
|
||
|
this.rotated,
|
||
|
);
|
||
|
final String hashtag;
|
||
|
|
||
|
final int size;
|
||
|
final bool rotated;
|
||
|
}
|
||
|
|
||
|
class FlutterColors {
|
||
|
const FlutterColors._();
|
||
|
|
||
|
static const Color yellow = Color(0xFFFFC108);
|
||
|
static const Color yellow500 = Color.fromARGB(255, 201, 152, 6);
|
||
|
static const Color white = Color(0xFFFFFFFF);
|
||
|
|
||
|
static const Color blue400 = Color(0xFF13B9FD);
|
||
|
static const Color blue600 = Color(0xFF0175C2);
|
||
|
static const Color blue = Color(0xFF02569B);
|
||
|
|
||
|
static const Color gray100 = Color(0xFFD5D7DA);
|
||
|
static const Color gray600 = Color(0xFF60646B);
|
||
|
static const Color gray = Color(0xFF202124);
|
||
|
}
|