imageUrl method

String imageUrl (
  1. String keyword,
  2. {int width: 640,
  3. int height: 480}
)

Implementation

String imageUrl(String keyword, {int width = 640, int height = 480}) {
  String url = 'https://source.unsplash.com';

  url += '/${width}x${height}';

  if (keyword != '') {
    url += '?$keyword';
  }
  return url;
}