Skip to content

Instantly share code, notes, and snippets.

View bkhezry's full-sized avatar
🏠
Working from home

Behrouz Khezry bkhezry

🏠
Working from home
View GitHub Profile
static ThemeData darkTheme() {
return FlexThemeData.dark(
scheme: FlexScheme.blueWhale,
colorScheme: const ColorScheme(
brightness: Brightness.dark,
primary: Color(0xff57859d),
onPrimary: Color(0xfff5f9fb),
primaryContainer: Color(0xff2a9d8f),
onPrimaryContainer: Color(0xffe6f8f6),
secondary: Color(0xffed7f29),
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class ThemeUtil {
static ThemeData themeData(bool isDarkTheme, BuildContext context) {
return ThemeData(
pageTransitionsTheme: const PageTransitionsTheme(builders: {
TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: FadeUpwardsPageTransitionsBuilder(),
}),
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/ahmad/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@bkhezry
bkhezry / styles.xml
Created June 26, 2018 10:55
change NumberPicker theme
<resources>
<style name="NumberPickerStyle" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:textColorPrimary">#000000</item>
</style>
</resources>
@bkhezry
bkhezry / proguard-rules.pro
Last active September 2, 2020 15:50
Proguard rules for popular libraries.
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\bkhezry\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
@bkhezry
bkhezry / main.dart
Created July 31, 2020 07:43
Half screen with two listview
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
/**
* Persian Calendar see: http://code.google.com/p/persian-calendar/
Copyright (C) 2012 Mortezaadi@gmail.com
PersianCalendar.java
Persian Calendar is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@bkhezry
bkhezry / BaseActivity.java
Created February 2, 2020 10:50
Fix dark mode problem with i18n
@Override
public void applyOverrideConfiguration(@Nullable Configuration overrideConfiguration) {
if (overrideConfiguration != null) {
int uiMode = overrideConfiguration.uiMode;
overrideConfiguration.setTo(getBaseContext().getResources().getConfiguration());
overrideConfiguration.uiMode = uiMode;
}
super.applyOverrideConfiguration(getResources().getConfiguration());
}
package com.github.bkhezry.buildingcollection.service;
import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.location.Location;
import android.os.Build;
@bkhezry
bkhezry / EncodingSRT.bash
Created March 16, 2019 15:43
Change encoding of subtitle to UTF-8 in the linux terminal
iconv -f CP1256 -t UTF-8 input.srt -o output.srt