Skip to content

Instantly share code, notes, and snippets.

View 100lvlmaster's full-sized avatar
🏠
sup

Navin Kodag 100lvlmaster

🏠
sup
View GitHub Profile
@100lvlmaster
100lvlmaster / css_parser.dart
Created February 12, 2022 09:13
A helper class to parse css styles from css text to appropriate flutter textstyles and buttonstyles. Also supports gradients
import 'package:flutter/material.dart';
class CssParser {
const CssParser();
///
static Color getColorFromHashCode(String colorCode) {
String color = colorCode.replaceAll("#", "0xff").toLowerCase();
return Color(int.parse(color));
}
@100lvlmaster
100lvlmaster / timeline.dart
Created February 1, 2022 10:15
A reusable horizontal timeline widget for flutter in dart
import 'package:flutter/material.dart';
class TimelineWidget extends StatelessWidget {
final List<MilestoneWidget> children;
const TimelineWidget({
Key? key,
required this.children,
}) : super(key: key);
@override
@100lvlmaster
100lvlmaster / manifest.json
Created June 27, 2021 21:10
manifest.json
{
"short_name": "svelte-pwa",
"name": "svelte-test-pwa",
"start_url": "/",
"icons": [
{
"src": "logo_512.png",
"type": "image/png",
"sizes": "512x512"
}
@100lvlmaster
100lvlmaster / service-worker.ts
Created June 27, 2021 21:01
service-worker.ts
/// <reference lib="webworker" />
import { build, files, timestamp } from '$service-worker';
const worker = (self as unknown) as ServiceWorkerGlobalScope;
const FILES = `cache${timestamp}`;
// `build` is an array of all the files generated by the bundler,
// `files` is an array of everything in the `static` directory
const to_cache = build.concat(files);