Skip to content

Instantly share code, notes, and snippets.

View MoshDev's full-sized avatar
🎯
Focusing

Mohammad Ersan MoshDev

🎯
Focusing
View GitHub Profile
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
Future main() async {
final Iterable<Locale> supportedLocales = [Locale('en'), Locale('ar')];
await Langs.init(supportedLocales: supportedLocales, loadDeviceLanguage: true);
runApp(MyApp(supportedLocales: supportedLocales));
print(Langs.string('sample.item.name'));
print(Langs.string('name'));
}
@MoshDev
MoshDev / installRun.gradle
Last active June 9, 2023 15:41
Install and Run Android App Using Gradle Task
//Place this script inside your application module build.gradle
//It will create a new task(s) based on your application variants within (run) group
//sample: ./gradlew installRunDebug
//sample: ./gradlew installRunStagDebug
project.afterEvaluate {
android.applicationVariants.all { variant ->
task "installRun${variant.name.capitalize()}"(type: Exec, dependsOn: "install${variant.name.capitalize()}", group: "run") {
commandLine = ["adb", "shell", "monkey", "-p", variant.applicationId + " 1"]
doLast {
package com.mosh.arabicfix;
/**
(Mosh Arabic Shaper) this API should fix Arabic shapes used within Android views, and canvas.
Copyright (C) 2011 Mohammad Mshari Ersan (mosh_java@yahoo.com)
* IF YOU LIKED IT, DONATE BY HIRING ME, OR LET ME MAKE YOUR PROJECT.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by