Skip to content
Snippets Groups Projects
Commit 5311a658 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: test colors

parent f94c0b61
No related branches found
No related tags found
1 merge request!7Clhp map
...@@ -35,6 +35,13 @@ class _ChoroplethMapState extends State<ChoroplethMap> { ...@@ -35,6 +35,13 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
late MapShapeSource mapShapeSource; late MapShapeSource mapShapeSource;
late final MapZoomPanBehavior _zoomPanBehavior = MapZoomPanBehavior(); late final MapZoomPanBehavior _zoomPanBehavior = MapZoomPanBehavior();
List<IceThicknessModel> iceThicknessList = <IceThicknessModel>[]; List<IceThicknessModel> iceThicknessList = <IceThicknessModel>[];
List<Color> testColors = [ // NB test color
const Color(0xff8a003b),
const Color(0xff8a4300),
const Color(0xff8a7a00),
const Color(0xff538a00),
const Color(0xff007b8a),
];
@override @override
void initState() { void initState() {
...@@ -42,11 +49,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> { ...@@ -42,11 +49,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
final Random random = Random(); final Random random = Random();
for (int i = 0; i <= 120; i++) { for (int i = 0; i <= 120; i++) {
int red = random.nextInt(256); int ran = random.nextInt(4); // NB test color
int green = random.nextInt(256); Color randomColor = testColors[ran];
int blue = random.nextInt(256);
Color randomColor = Color.fromRGBO(red, green, blue, 1);
int randomNumber = random.nextInt(21); // 0 -> 20, NB: temp test data int randomNumber = random.nextInt(21); // 0 -> 20, NB: temp test data
iceThicknessList.add(IceThicknessModel(i.toString(), randomNumber, randomColor)); iceThicknessList.add(IceThicknessModel(i.toString(), randomNumber, randomColor));
...@@ -68,8 +72,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> { ...@@ -68,8 +72,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
shapeColorValueMapper: (int index) => iceThicknessList[index].color, shapeColorValueMapper: (int index) => iceThicknessList[index].color,
), ),
//color: Colors.blue.shade400, // Map color //color: Colors.blue.shade400, // Map color
//zoomPanBehavior: _zoomPanBehavior, zoomPanBehavior: _zoomPanBehavior,
//strokeColor: Colors.black, strokeColor: Colors.black,
// Shape selection // Shape selection
selectedIndex: selectedIndex, selectedIndex: selectedIndex,
onSelectionChanged: (int index) { onSelectionChanged: (int index) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment