Skip to content

Instantly share code, notes, and snippets.

View tenwolfgun's full-sized avatar
🇮🇩
I may be slow to respond.

Faishal Risfandi tenwolfgun

🇮🇩
I may be slow to respond.
View GitHub Profile
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
@tenwolfgun
tenwolfgun / ColoredShadow.kt
Created March 7, 2022 00:43 — forked from cedrickring/ColoredShadow.kt
Draw a colored shadow in Android Jetpack Compose
import androidx.compose.ui.Modifier
import androidx.compose.ui.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
fun Modifier.drawColoredShadow(
color: Color,
🌞 Morning 86 commits █████▊░░░░░░░░░░░░░░░ 27.9%
🌆 Daytime 126 commits ████████▌░░░░░░░░░░░░ 40.9%
🌃 Evening 79 commits █████▍░░░░░░░░░░░░░░░ 25.6%
🌙 Night 17 commits █▏░░░░░░░░░░░░░░░░░░░ 5.5%
Kotlin 0 secs ███████████████▏░░░░░ 72.5%
XML 0 secs ████▍░░░░░░░░░░░░░░░░ 21.1%
Groovy 0 secs █▎░░░░░░░░░░░░░░░░░░░ 6.4%
@tenwolfgun
tenwolfgun / main.dart
Created July 29, 2020 08:08
clone list in dart
void main() {
List<int> a = [1, 2, 3];
List<int> b = []..addAll(a);
b.clear();
print(a);
print(b);
}
@tenwolfgun
tenwolfgun / main.dart
Last active June 15, 2020 05:49
Bloc example
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../../injection_container.dart';
import '../bloc/bloc.dart';
class Test extends StatefulWidget {
@override
_TestState createState() => _TestState();
}
@tenwolfgun
tenwolfgun / main.dart
Created April 26, 2020 23:29
Flutter TabBar inside TabBarView
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@tenwolfgun
tenwolfgun / main.dart
Created April 26, 2020 08:15
split string
void main() {
final String code = "BANJARMASIN|2864|PULSAA|970979709";
List<String> test = code.split("|");
print(test[1]);
}
class Datum {
final String id;
final String name;
const Datum({this.id, this.name});
}
void main() {
final Map<String, String> someMap = {
"1": "andi",
@tenwolfgun
tenwolfgun / README.md
Created February 11, 2020 07:14 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store