color: Colors.primaries[Random().nextInt(Colors.primaries.length)],
or
use package random_color 1.0.5
Colors.primaries[Random().nextInt(Colors.primaries.length)],
import 'dart:math';
color:Colors.primaries[Random().nextInt(Colors.primaries.length)],