Skip to content

Instantly share code, notes, and snippets.

@anilcancakir
anilcancakir / pubspec_wind.yaml
Created February 2, 2025 20:10
Wind Dependency in pubspec.yaml
dependencies:
fluttersdk_wind: ^0.0.2
@anilcancakir
anilcancakir / install_wind.sh
Created February 2, 2025 20:09
Wind Installation Command
flutter pub add fluttersdk_wind
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:medium_story_app/config.dart';
void main() {
// Init the default timezone
Config.instance.set('timezone', 'Europe/London');
runApp(const MyApp());
}
class Config {
/// The singleton instance.
static final Config instance = Config();
/// All of the configuration items.
final Map<String, dynamic> _items = <String, dynamic>{};
/// Get the specified configuration value.
dynamic get(String key) {
return _items[key];
class Config {
/// All of the configuration items.
final Map<String, dynamic> _items = <String, dynamic>{};
/// Get the specified configuration value.
dynamic get(String key) {
return _items[key];
}
/// Set a given configuration value.
@anilcancakir
anilcancakir / postgres_autovacuum.sql
Created September 13, 2021 11:44
PostgreSQL Auto Vacuum Snippets
-- Get the default settings of the postgresql
select *
from pg_settings
where name like '%autovacuum%';
-- Get the table specific settings
select relname, reloptions
from pg_class
join pg_namespace on pg_namespace.oid = pg_class.relnamespace
where pg_namespace.nspname = 'public' and relam = 2
@anilcancakir
anilcancakir / pcre.md
Created August 31, 2021 09:46
Solution for `pcre.h` or `pcre2.h` error in Apple M1 Macos
@anilcancakir
anilcancakir / macos.md
Created January 5, 2020 20:05
Anilcan's macOS Setup - (PHP, PostgreSQL, Featured Apps...)

Anilcan's macOS Setup

This my personal development MacOS environment. It contains a type of software and custom improvements.

Softwares

Terminal

@anilcancakir
anilcancakir / flutter_internationalization_tutorial.md
Last active March 30, 2018 16:08
In this tutorial, I'll create my own language provider and I'll get my sentences by json files.

Flutter Internationalization by Using JSON Files

The Flutter has a good document for internationalization but this document is so mixed. Today, the Flutter haven’t any language class or function for using your own sentences on the app but you can create your own language provider and use this easiest. In this tutorial, I'll create my own language provider and I'll get my sentences by json files.

Getting Started

I’ll use a clean Flutter project in this tutorial. Let’s create a new Flutter project and clean your main.dart file for using by this tutorial. In this tutorial, my app have 2 languages which are English and Turkish. The App will show sentences by device language. Let's start!

Prepare Your Project

@anilcancakir
anilcancakir / main.dart
Created March 5, 2018 21:55
How to use dynamic home page in Flutter? - main
import 'package:app/pages/home.page.dart';
import 'package:app/pages/login.page.dart';
import 'package:app/services/auth.service.dart';
import 'package:flutter/material.dart';
AuthService appAuth = new AuthService();
void main() async {
// Set default home.
Widget _defaultHome = new LoginPage();