Skip to content

Instantly share code, notes, and snippets.

View vladnicula's full-sized avatar
👾

Vlad Nicula vladnicula

👾
  • Cluj-Napoca, Romania
View GitHub Profile
@vladnicula
vladnicula / main.dart
Created May 29, 2021 07:44
Hello Flutter 02
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
title: 'Hello From Flutter', // used by the OS task switcher
home: SafeArea(
child: Scaffold(
body: Center(
child: Text(
@vladnicula
vladnicula / main.dart
Created May 29, 2021 06:41
Counter App
// from https://flutter.dev/docs/development/ui/widgets-intro
import 'package:flutter/material.dart';
class Counter extends StatefulWidget {
// This class is the configuration for the state.
// It holds the values (in this case nothing) provided
// by the parent and used by the build method of the
// State. Fields in a Widget subclass are always marked
// "final".
@vladnicula
vladnicula / main.dart
Last active May 26, 2021 05:14
Flutter Basic Responsiveness
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@vladnicula
vladnicula / main.dart
Created March 24, 2021 04:36
Flutter Theme Switcher
import 'package:flutter/material.dart';
/// Dart data model
class AppThemeValues {
final Color primaryColor;
final Color primaryBackgroundColor;
AppThemeValues(
{required this.primaryColor, required this.primaryBackgroundColor});
}
@vladnicula
vladnicula / window-resize.js
Created March 2, 2015 08:17
Custom window resize event
var $window = $(window),
resizeInCooldown = false,
resizeTimeout;
function onResize() {
var resizeValue;
// only run this if we didn't run a update 150ms ago or less.
if ( !resizeInCooldown ) {
// orientation dictates what height and what width means.