Skip to content

Instantly share code, notes, and snippets.

View MadFlasheroo7's full-sized avatar
🎯
Focusing

Jayesh Seth MadFlasheroo7

🎯
Focusing
View GitHub Profile
Function Description
f = dot(v, v) Vector dot product
v = cross(v, v) Vector cross product
m = matrixCompMult(m, m) Component-wise multiply
Construct Syntax / Notes
Function Call Call by value-return
Iteration for (<init>; <test>; <next>) { break, continue }
Selection if () { }
if () { } else { }
switch () { break, case }
(default case should be last)
Jump break, continue, return
(discard is not allowed)
Entry Point half4 main(float2 fragCoord)
Function Description
vec4 unpremul(vec4 color) Converts color value to non-premultiplied alpha
half3 toLinearSrgb(half3 color) Color space transformation to linear SRGB
half3 fromLinearSrgb(half3 color) Color space transformation from linear SRGB
Operator Description Associativity
() Parenthetical Grouping N/A
[] () . ++ -- (postfix) Array subscript, Function call & constructor, Structure field or method selector, Swizzle, Postfix increment and decrement Left to Right
++ -- + - ! (prefix) Prefix increment and decrement, Unary plus, Unary minus, Logical NOT Right to Left
* / Multiply, Divide Left to Right
+ - (binary) Addition, Subtraction
@Composable
fun AnimatedTextTextField(
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
textStyle: TextStyle = TextStyle(fontSize = 50.sp)
) {
val scope = rememberCoroutineScope()
val animatables = remember { mutableStateMapOf<Int, Animatable<Float, AnimationVector1D>>() }
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun AnimateCharTextField(
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
textStyle: TextStyle = TextStyle(fontSize = 50.sp)
) {
val scope = rememberCoroutineScope()
val animatables = remember { mutableStateMapOf<Int, Animatable<Float, AnimationVector1D>>() }
val lifecycleOwner = LocalLifecycleOwner.current
DisposableEffect(lifecycleOwner) {
val lifecycleEventObserver = LifecycleEventObserver { lifecycleOwner, event ->
when (event) {
Lifecycle.Event.ON_CREATE -> Log.d("compose lifecycle", event.name)
Lifecycle.Event.ON_START -> Log.d("compose lifecycle", event.name)
Lifecycle.Event. ON_RESUME -> Log.d("compose lifecycle", event.name)
Lifecycle.Event.ON_PAUSE -> Log.d("compose lifecycle", event.name)
Lifecycle.Event.ON_STOP -> Log.d("compose lifecycle", event.name)
Lifecycle.Event.ON_DESTROY -> Log.d("compose lifecycle", event.name)
import 'package:flutter/widget.dart';
import 'package:flutter/materail.dart';
import 'package:flutter/cupertnio.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {