Skip to content

Instantly share code, notes, and snippets.

View rutvik110's full-sized avatar
🎵
Humming

Rutvik Tak rutvik110

🎵
Humming
View GitHub Profile
@rutvik110
rutvik110 / main.dart
Created July 15, 2022 08:02
animating hero behind other widgets
import 'package:flutter/material.dart';
// TODO edit your app
void main() {
print('Hello from your Flutter app!');
runApp(MyApp());
}
@rutvik110
rutvik110 / image_size_data.dart
Created June 23, 2022 12:58 — forked from dnfield/image_size_data.dart
Image size parsing in Dart
import 'dart:typed_data';
import 'package:meta/meta.dart';
/// Image formats supported by Flutter.
enum ImageFormat {
/// A Portable Network Graphics format image.
png,
/// A JPEG format image.
///
double getScaledSize(int index) {
return getPropertyValue(
index: index,
baseValue: baseItemHeight,
maxValue: 70,
nonHoveredMaxValue: 50,
);
}
double getTranslationY(int index) {
Positioned(
height: baseItemHeight,
left: 0,
right: 0,
child: DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
gradient: const LinearGradient(colors: [
Colors.blueAccent,
Colors.greenAccent,
double getPropertyValue({
required int index,
required double baseValue,
required double maxValue,
required double nonHoveredMaxValue,
}) {
late final double propertyValue;
// 1.
if (hoveredIndex == null) {
Padding(
padding: EdgeInsets.all(verticlItemsPadding),
// 1.
child : Row(
mainAxisSize: MainAxisSize.min,
children: List.generate(items.length, (index) {
// 2.
return MouseRegion(
cursor: SystemMouseCursors.click,
onEnter: ((event) {
@rutvik110
rutvik110 / launch.json
Created June 13, 2022 13:52
launch.json cofigurations for nativeshell
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter: Attach to Process",
"type": "dart",
"request": "attach",
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
class MyShader extends StatefulWidget {
const MyShader({Key? key}) : super(key: key);
@override
State<MyShader> createState() => _MyShaderState();
uniform float u_time;
vec4 fragment(in vec2 uv,in vec2 fragCoord){
float l=u_time;
vec2 uv2,p=uv;
uv2=p;
p-=.5;
l=length(p);
uv2+=abs(sin(l*10.-u_time));
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
void main() {