Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Armstrong xsokev

View GitHub Profile
@xsokev
xsokev / main.dart
Last active Jun 12, 2018
Playing with JSON Arrays in Dart
View main.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());
@xsokev
xsokev / weather_screen_with_forecast.dart
Created May 18, 2018
Flutter Weather Screen Design with Current Temperature and Forecast
View weather_screen_with_forecast.dart
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;
You can’t perform that action at this time.