Skip to content

Instantly share code, notes, and snippets.

View ponnamkarthik's full-sized avatar

Karthik Ponnam ponnamkarthik

View GitHub Profile
#include <flutter/runtime_effect.glsl>
uniform vec2 uSize;
uniform float iTime;
vec2 iResolution;
out vec4 fragColor;
#define PI 3.1415926535897932384626433832795
#define PI 3.1415926535897932384626433832795
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 center = fragCoord/iResolution.xy - vec2(0.5, 0.5);
float dist = length(center);
float p = (atan(center.y,center.x)) / (2.0 * PI);
float numStripes = 12.0;
class MyPainter extends CustomPainter {
final Paint paint;
MyPainter(this.paint);
@override
void paint(Canvas canvas, Size size) {
canvas.drawRect(
Rect.fromLTRB(0, 0, size.width, size.height),
paint,
CustomPaint(
painter: MyPainter(paint),
child: Container(),
);
Paint paint = Paint()
..shader = Shader.linearGradient(
colors: [Colors.red, Colors.blue],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
);
@ponnamkarthik
ponnamkarthik / ShareSheet.swift
Created October 1, 2022 11:20
ios UIApplication extension function to get the UIViewController in flutter plugin
var sharedItems : Array<NSObject> = Array()
sharedItems.append((message as NSObject?)!)
let activityViewController = UIActivityViewController(activityItems: sharedItems, applicationActivities: nil)
activityViewController.setValue("Share", forKeyPath: "subject");
DispatchQueue.main.async {
UIApplication.topViewController()?.present(activityViewController, animated: true, completion: nil)
@ponnamkarthik
ponnamkarthik / viewbound_error_solution_customscrollview.dart
Created December 4, 2021 03:53
Vertical viewport was given unbounded height.
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: CustomScrollView(
slivers: [
SliverList(delegate: SliverChildBuilderDelegate(
(context, index) {
return Text("hello user");
},
@ponnamkarthik
ponnamkarthik / viewbound_error_solution_shrinkwrap.dart
Created December 4, 2021 03:43
Vertical viewport was given unbounded height.
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: SingleChildScrollView(
child: ListView(
shrinkWrap: true,
children: const [
Text("hello user")
],
@ponnamkarthik
ponnamkarthik / viewbound_error_solution_column.dart
Last active December 13, 2021 06:34
Vertical viewport was given unbounded height.
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: SingleChildScrollView(
child: Column(
children: const [
Text("hello user")
],
),
@ponnamkarthik
ponnamkarthik / viewbound_error.dart
Created December 4, 2021 03:22
Vertical viewport was given unbounded height.
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: SingleChildScrollView(
child: ListView(
children: const [
Text("hello user")
],
),