This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'DessertList.dart'; | |
Dessert dessert; | |
class DessertDetails extends StatelessWidget { | |
static final routeName = '/DessertDetails'; | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"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" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ { "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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |