Skip to content

Instantly share code, notes, and snippets.

View gbuela's full-sized avatar

German Buela gbuela

View GitHub Profile
@gbuela
gbuela / RotatingView.swift
Created April 27, 2023 16:39
RotatingView
import SwiftUI
struct PausableRotation: GeometryEffect {
@Binding var currentAngle: Double
private var currentAngleValue: Double = 0.0
var animatableData: Double {
get { currentAngleValue }
set { currentAngleValue = newValue }
}
@gbuela
gbuela / NavViewDemo
Created February 9, 2020 03:14
Custom navigation bar in SwiftUI
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
ZStack {
Color.black
.edgesIgnoringSafeArea([.all])
NavigationLink(destination: ContentView2()) {
Text("push")
@gbuela
gbuela / animation_card.dart
Created April 3, 2019 23:46
Card flip animation in Flutter
import 'dart:math';
import 'package:flutter/material.dart';
// based on https://github.com/fedeoo/flip_card/
// provides a callback to the front & back widgets so they can trigger the flip, therefore the CardSideBuilder
// note this version only flips horizontally
class AnimationCard extends StatelessWidget {
AnimationCard({this.child, this.animation});