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
import 'package:flutter/material.dart';
import 'DessertList.dart';
Dessert dessert;
class DessertDetails extends StatelessWidget {
static final routeName = '/DessertDetails';
@override
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
/// to see the response go to
/// https://gist.github.com/Eng-MFQ/483ac384385134dc3d5d30d236419b6c
[
{
"product_id" : 1,
"name" : "Chocolate Cake",
"imgUrl" : "https://github.com/Eng-MFQ/imges_uplader/blob/master/Dessert/chcolate%20cake.jpg?raw=true",
"description" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"type" : "dessert",
"quantity" : 13,
"Price" : "1.80 JD"
},
[ { "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
@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();
}
}
@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 / 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
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
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) {