Skip to content

Instantly share code, notes, and snippets.

View ariona's full-sized avatar
🏠
Working from home

Rian Ariona ariona

🏠
Working from home
View GitHub Profile
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
//plugins/axios.js
export default function ({ $axios, app }) {
$axios.onError(error => {
const code = parseInt(error.response && error.response.status)
if ([401, 403].includes(code)) {
app.$auth.logout();
}
@whiplashoo
whiplashoo / hexOrRGBToColor.dart
Created April 23, 2021 08:23
Convert a hex, rgba, or rgb color string to Color object in Dart
import 'dart:ui';
import 'package:flutter/material.dart';
// Converts a hex, rgb, or rgba color string to Color object. Works with opacity values as well.
// e.g.:
// "#000" -> Color(0xff000000)
// "#cc3333" -> Color(0xffcc3333)
// "#cc3333dd" -> Color(0xddcc3333)
// "rgb(204, 44, 81)" -> Color(0xffcc2c51)
// "rgba(204, 44, 81, 0.20)" -> Color(0x33cc2c51)
@danielcshn
danielcshn / fix-duplicate-class-android-studio.md
Created April 16, 2023 04:08
Fix Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-* Android Studio | 2022.2.1

📜 Info:

  • Android Studio Flamingo | 2022.2.1
  • Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
  • Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
  • Windows 11 (version 10.0.22000.1817)

🐛 Bug/Error log: