Skip to content

Instantly share code, notes, and snippets.

View Ahmadre's full-sized avatar
🐦
fluttering

Rebar Ahmad Ahmadre

🐦
fluttering
  • App Logik GmbH
  • Krefeld - Germany
View GitHub Profile
@Ahmadre
Ahmadre / Generics.dart
Last active July 5, 2022 10:59
Generic Types in Flutter
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
/// Main
void main() {
runApp(GenericTypesApp());
}
/// EOF Main
@Ahmadre
Ahmadre / ScrollAndPinch.cs
Created October 13, 2021 02:02 — forked from ditzel/ScrollAndPinch.cs
Pinch and Scroll to Move and Zoom in Unity for Mobile Games
/*
Set this on an empty game object positioned at (0,0,0) and attach your active camera.
The script only runs on mobile devices or the remote app.
*/
using UnityEngine;
class ScrollAndPinch : MonoBehaviour
@Ahmadre
Ahmadre / AnimatedCopy
Created June 11, 2021 22:02
AnimatedCopy Icon with Rive
/// Copyright © Rebar Ahmad
/// 12. June 2021 - Germany
///
/// IMPORTANT: You've to install the rive package:
/// rive: 0.7.14
/// at first
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rive/rive.dart';
@Ahmadre
Ahmadre / example.dart
Created February 7, 2021 00:49
Call environment variables
return Scaffold(
appBar: AppBar(
title: Text(const String.fromEnvironment('TITLE')),
),
body: Container(),
);
@Ahmadre
Ahmadre / entrypoint.sh
Created February 7, 2021 00:41
Entrypoint for Flutter
#!/bin/sh -eu
flutter build web --release --dart-define TITLE=${TITLE:-}
chmod -R 755 /usr/share/nginx/html
cp -r /app/build/web/* /usr/share/nginx/html
nginx -g "daemon off;"
@Ahmadre
Ahmadre / .dockerignore
Created February 7, 2021 00:39
Dockerignore for Flutter
build/
.vscode/
android/
ios/
.idea/
pubspec.lock
@Ahmadre
Ahmadre / nginx.conf
Created February 7, 2021 00:37
Nginx default webserver config
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
@Ahmadre
Ahmadre / Dockerfile
Created February 7, 2021 00:22
Dockerize Flutter
# Provide nginx webserver
FROM nginx:stable
# Set directory to Copy App
WORKDIR /app
# Prerequisites
RUN apt update && apt install -y curl git unzip xz-utils zip libglu1-mesa
# Download Flutter SDK
@Ahmadre
Ahmadre / fling_physics.dart
Created August 3, 2020 20:12 — forked from slightfoot/fling_physics.dart
Fling PageScrollPhysics for Flutter
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// 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
// furnished to do so, subject to the following conditions:
@Ahmadre
Ahmadre / main.dart
Created June 18, 2020 01:58
Expanded in a column
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
final kExpansionTileHeight = 114;