Skip to content

Instantly share code, notes, and snippets.

View xsokev's full-sized avatar

Kevin Armstrong xsokev

View GitHub Profile
@xsokev
xsokev / weather_screen_with_forecast.dart
Created May 18, 2018 16:15
Flutter Weather Screen Design with Current Temperature and Forecast
import 'dart:convert';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:fluids/plugins/weather/models/models.dart'; //custom data models
import 'package:fluids/utils/md_icons.dart'; //material design community icons
class CityForecast extends StatelessWidget {
final GlobalKey<AnimatedListState> _listKey = GlobalKey<AnimatedListState>();
final String city;
final String state;
@xsokev
xsokev / main.dart
Last active June 12, 2018 16:44
Playing with JSON Arrays in Dart
import 'dart:convert';
void main() {
String aryString =
'{"data": "red, blue, green, red, yellow, deep orange, orange, blue, purple, green"}';
Map map = jsonDecode(aryString);
String listString = map['data'];
List cats = listString.split(', ');
cats.sort();
print(cats.toSet());