Skip to content

Instantly share code, notes, and snippets.

View Eng-MFQ's full-sized avatar
🏠
Working from home

Muwaffaq imam Eng-MFQ

🏠
Working from home
View GitHub Profile
/** FontFamily **/
///'casual'
///'cursive'
///'monospace'
///'sans-serif-condensed'
///'sans-serif-smallcaps'
///'serif'
///'serif-monospace'
@Eng-MFQ
Eng-MFQ / FlutterMainStarter
Created December 29, 2018 08:02
Starter template for flutter course
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// this is your APP Main screen configuration
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
/// copy me
Widget _widgetName(BuildContext context) {
return null;
}
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// this is your APP Main screen configuration
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// this is your APP Main screen configuration
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
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) {
return MaterialApp(
theme: ThemeData(
// to change your app color change this
@Eng-MFQ
Eng-MFQ / RecyclerItemClickSupport.java
Last active February 13, 2019 16:30
Helper class to add click Listener on RecyclerView items
// add this to res >values >ids.xml
// <resources>
// <item name="item_click_support" type="id"/>
// </resources>
public class RecyclerItemClickSupport {
private final RecyclerView mRecyclerView;
private OnItemClickListener mOnItemClickListener;
private OnItemLongClickListener mOnItemLongClickListener;
private View.OnClickListener mOnClickListener = new View.OnClickListener() {
@Override
@Eng-MFQ
Eng-MFQ / RecyclerViewLoadmore.java
Created February 28, 2019 11:47
listener on RecyclerView that detect all load more trigger from all sides TOP, BOTTOM, RIGHT, LEFT
private void loadMore() {
int LAUNCH_LOAD_MORE_AT_POSITION_FROM_TOP =5;
mRecycler.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
@Eng-MFQ
Eng-MFQ / StateFullWidgetTemplate.dart
Last active September 26, 2021 11:46
Stateful widget template to copy
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// Stateful widget template to copy
class StateFullWidgetTemplate extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return StateFullWidgetTemplateState();
}
}
[ { "product_id" : 1, "name" : "Chocolate Cake", "imgUrl" : "https://github.com/Eng-MFQ/imges_uplader/blob/master/Dessert/chcolate%20cake.jpg?raw=true", "description" : "Yummy, Yummy, Yummy, Yummy, Yummy, Yummy, Yummy, Yummy, ", "type" :"dessert", "quantity" : 1, "Clap" : { "product_clap" : 150, "user_clap" : 10 }, "Price" : { "value" : 1.80, "formattedValue" : "1.80 JD", "Discounts" : { "description" : "15%", "priceAfterDiscount" : "2.50 JD" } }, "MealPreferences" : null }, { "product_id" : 1, "name" : "Toffee Cake", "imgUrl" : "https://github.com/Eng-MFQ/imges_uplader/blob/master/Dessert/niscafi%20cake.jpg?raw=true", "description" : "Yummy, Yummy, Yummy, Yummy, Yummy, Yummy, Yummy, Yummy, ", "type" : "dessert", "quantity" : 1, "Clap" : { "product_clap" : 150, "user_clap" : 10 }, "Price" : { "value" : 1.80, "formattedValue" : "1.80 JD", "Discounts" : { "description" : "15%", "priceAfterDiscount" : "2.50 JD" } }, "MealPreferences" : null }, { "product_id" : 1, "name" : "Layers Cake", "imgUrl" : "https://githu