Skip to content

Instantly share code, notes, and snippets.

@Zfinix
Created October 19, 2019 12:46
Show Gist options
  • Select an option

  • Save Zfinix/bb34bda761373e0da664ec1ebe633a3a to your computer and use it in GitHub Desktop.

Select an option

Save Zfinix/bb34bda761373e0da664ec1ebe633a3a to your computer and use it in GitHub Desktop.
import 'dart:math';
import 'package:flutter/material.dart';
Color randomColor() {
List<Color> colors = [
Colors.green,
Colors.red,
Colors.blue,
Colors.deepOrange,
Color.fromRGBO(34, 111, 255, 1),
];
Random random = new Random();
int index = 0;
index = random.nextInt(colors.length);
return colors[index];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment