Skip to content

Instantly share code, notes, and snippets.

View LOG-TAG's full-sized avatar

Subrahmanya S M LOG-TAG

View GitHub Profile
@tarek360
tarek360 / CurvedShape.dart
Last active February 8, 2023 00:54
Draw a curved shape in Flutter
import "package:flutter/material.dart";
import 'package:flutter/services.dart';
import 'dart:math';
const CURVE_HEIGHT = 160.0;
const AVATAR_RADIUS = CURVE_HEIGHT * 0.28;
const AVATAR_DIAMETER = AVATAR_RADIUS * 2;
void main() => runApp(new MyApp());
@nickbutcher
nickbutcher / ShowbizView.kt
Last active May 24, 2019 03:37
A prototype of an animation I helped out on, see: https://twitter.com/crafty/status/1073612862139064332
/*
* Copyright 2018 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rodydavis
rodydavis / flutter_search.dart
Created August 14, 2018 14:50
Very Fast Search for Flutter with Custom Object
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:date_format/date_format.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/material.dart';
import 'package:native_widgets/native_widgets.dart';
import 'package:songlist_pro/util/globals.dart' as globals;
import 'package:tonic/tonic.dart';
@chaines27
chaines27 / homebrew-openjdk-configuration
Last active June 14, 2022 08:29
Configuration for homebrew-openjdk for macOS to see it as an installed JVM
OpenJDK 1.8
1. Follow the instructions from https://github.com/AdoptOpenJDK/homebrew-openjdk to tap and install jdk8.
2. Run the following command to create the necessary directories
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-1.8.0_172.jdk/Contents/MacOS
3. Run the following commands to link to the existing homebrew-openjdk install
class MyApp extends StatelessWidget {
Stream<int> _countUp() async* {
for (int i = 1; i <= 10; i++) {
yield await Future.delayed(Duration(seconds: 1), () => i);
}
}
@override
Widget build(BuildContext context) {
return MaterialApp(
@LOG-TAG
LOG-TAG / DbSchema.kt
Created April 29, 2018 15:58 — forked from PrashamTrivedi/DbSchema.kt
Some extension functions with room: Requires Export schema Read this section https://medium.com/google-developers/testing-room-migrations-be93cdb0d975#6872
import com.squareup.moshi.Json
data class DbSchema(@field:Json(name = "formatVersion") val formatVersion: Int? = 0, @field:Json(
name = "database") val database: Database? = Database())
data class Database(@field:Json(name = "version") val version: Int = 0, @field:Json(name = "identityHash") val identityHash: String? = "", @field:Json(
name = "entities") val entities: List<Entity?>? = listOf(), @field:Json(name = "setupQueries") val setupQueries: List<String?>? = listOf())
abstract class PlanetVisitor {
void visit({Planet planet});
}
abstract class Planet {
void accept({PlanetVisitor visitor});
}
class MoonJedah extends Planet {
@override
import android.app.Activity
import android.graphics.Rect
import android.os.Build
import android.view.View
import android.view.ViewTreeObserver
import android.view.inputmethod.InputMethodManager
/**
* Created by mikepenz on 14.03.15.
* This class implements a hack to change the layout padding on bottom if the keyboard is shown
@ValCanBuild
ValCanBuild / BottomNavigationBehavior.kt
Last active December 18, 2023 00:04
Full code of a BottomNavigationBehavior which hides itself on scroll and handles Snackbars, FAB and snapping. https://medium.com/@ValCanBuild/scroll-your-bottom-navigation-view-away-with-10-lines-of-code-346f1ed40e9e
/**
MIT License
Copyright (c) 2018 Valentin Hinov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@putraxor
putraxor / flutter_chat_bubble.dart
Created March 5, 2018 02:19
Flutter Chat Bubble
import 'package:flutter/material.dart';
class Bubble extends StatelessWidget {
Bubble({this.message, this.time, this.delivered, this.isMe});
final String message, time;
final delivered, isMe;
@override
Widget build(BuildContext context) {