├── README.md ├── api ├── .gitignore ├── config │ └── app.config.js ├── controllers │ └── products.controller.js ├── index.js ├── middleware │ ├── errors.js │ └── upload.js ├── models │ └── products.model.js ├── package-lock.json ├── package.json ├── routes │ └── app.routes.js ├── services │ └── products.services.js └── swagger.json └── flutter ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_nodejs_crud_app │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── config.dart ├── main.dart ├── model │ └── product_model.dart ├── pages │ ├── product_add_edit.dart │ ├── product_item.dart │ └── product_list.dart └── services │ └── api_service.dart ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart └── web ├── favicon.png ├── icons ├── Icon-192.png ├── Icon-512.png ├── Icon-maskable-192.png └── Icon-maskable-512.png ├── index.html └── manifest.json /README.md: -------------------------------------------------------------------------------- 1 | ## Flutter CRUD Using NodeJS API 2 | 3 | In this video we will learn how to Create CRUD Rest API for our Flutter application using NODEJS API. 4 | 5 | [![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/Euq_-_Xmi9U/0.jpg)](https://www.youtube.com/watch?v=Euq_-_Xmi9U) 6 | 7 | [![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/_QTuK4PH1hs/0.jpg)](https://www.youtube.com/watch?v=_QTuK4PH1hs) 8 | 9 | [![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/z45p7_sizJk/0.jpg)](https://www.youtube.com/watch?v=z45p7_sizJk) 10 | 11 |
12 | 13 | ##### 📎Packages Used 14 | ##### https://pub.dev/packages/snippet_coder_utils 15 | ##### https://pub.dev/packages/api_cache_manager 16 | ##### https://pub.dev/packages/image_picker 17 | ##### https://www.npmjs.com/package/swagger-ui-express 18 | ##### https://swagger.io/docs/specification/basic-structure/ 19 | 20 |
21 | 22 | ##### 📎Json to Dart ConverterJson to Dart Converter 23 | ##### https://www.dripcoding.com/json-to-dart/ 24 | 25 |
26 | 27 | ### 🤝Stay Connected with me ! 28 | ##### ✔ Instagram : https://www.instagram.com/SnippetCoder 29 | ##### ✔ Facebook : https://www.facebook.com/SnippetCoder 30 | ##### ✔ Twitter : https://www.twitter.com/SnippetCoder 31 | ##### ✔ Telegram : https://t.me/SnippetCoder 32 | ##### ✔ Github : https://github.com/SnippetCoders/ 33 | 34 |
35 | 36 | ### ⛄If you like my work , you can support me 37 | #### ☑️Patreon : https://www.patreon.com/SnippetCoder 38 | #### ☑️PayPal : http://www.paypal.me/iSharpeners 39 | #### ☑️DM For UPI Number 40 | 41 |
42 | 43 | PLEASE SUBSCRIBE AND SHARE THIS VIDEO!!!!😳 44 | THANKS FOR WATCHING!!! 45 | 46 | 🔥NODEJS API for Flutter Developers🔥 47 | https://youtu.be/_hv-4knConI 48 | 49 | 🔥 Node JS Register and Login API using JWT & MongoDB 🔥 50 | https://youtu.be/ZEg03f1o_vQ 51 | 52 | 🔥 Flutter OTP Login Using NodeJS API 🔥 53 | https://youtu.be/KbF6uVMGDxg 54 | 55 | 🔥 NodeJS Login & Register Rest API with MySQL 🔥 56 | https://youtu.be/YINNyvMS35k 57 | 58 | 🔥 Flutter Push Notification Using NodeJS API 🔥 59 | https://youtu.be/3C5pfo7Bc3E 60 | 61 | 62 | Tags and SEO Stuff : 63 | #flutter #NodeJS #SnippetCoder 64 | -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /node_modules -------------------------------------------------------------------------------- /api/config/app.config.js: -------------------------------------------------------------------------------- 1 | const MONGO_DB_CONFIG = { 2 | DB: "mongodb://localhost/ecommerce-app" 3 | }; 4 | 5 | module.exports = { 6 | MONGO_DB_CONFIG, 7 | }; 8 | -------------------------------------------------------------------------------- /api/controllers/products.controller.js: -------------------------------------------------------------------------------- 1 | const productsServices = require("../services/products.services"); 2 | const upload = require("../middleware/upload.js"); 3 | 4 | // Create and Save a new Product 5 | exports.create = (req, res, next) => { 6 | upload(req, res, function (err) { 7 | if (err) { 8 | next(err); 9 | } else { 10 | const url = req.protocol + "://" + req.get("host"); 11 | 12 | const path = 13 | req.file != undefined ? req.file.path.replace(/\\/g, "/") : ""; 14 | 15 | var model = { 16 | productName: req.body.productName, 17 | productDescription: req.body.productDescription, 18 | productPrice: req.body.productPrice, 19 | productImage: path != "" ? url + "/" + path : "", 20 | }; 21 | 22 | productsServices.createProduct(model, (error, results) => { 23 | if (error) { 24 | return next(error); 25 | } 26 | return res.status(200).send({ 27 | message: "Success", 28 | data: results, 29 | }); 30 | }); 31 | } 32 | }); 33 | }; 34 | 35 | // Retrieve all Products from the database. 36 | exports.findAll = (req, res, next) => { 37 | var model = { 38 | productName: req.query.productName, 39 | }; 40 | 41 | productsServices.getProducts(model, (error, results) => { 42 | if (error) { 43 | return next(error); 44 | } 45 | return res.status(200).send({ 46 | message: "Success", 47 | data: results, 48 | }); 49 | }); 50 | }; 51 | 52 | // Find a single Tutorial with an id 53 | exports.findOne = (req, res, next) => { 54 | var model = { 55 | productId: req.params.id, 56 | }; 57 | 58 | productsServices.getProductById(model, (error, results) => { 59 | if (error) { 60 | return next(error); 61 | } 62 | return res.status(200).send({ 63 | message: "Success", 64 | data: results, 65 | }); 66 | }); 67 | }; 68 | 69 | // Update a Product by the id in the request 70 | exports.update = (req, res, next) => { 71 | upload(req, res, function (err) { 72 | if (err) { 73 | next(err); 74 | } else { 75 | const url = req.protocol + "://" + req.get("host"); 76 | 77 | const path = 78 | req.file != undefined ? req.file.path.replace(/\\/g, "/") : ""; 79 | 80 | var model = { 81 | productId: req.params.id, 82 | productName: req.body.productName, 83 | productDescription: req.body.productDescription, 84 | productPrice: req.body.productPrice, 85 | productImage: path != "" ? url + "/" + path : "", 86 | }; 87 | 88 | console.log(model); 89 | 90 | productsServices.updateProduct(model, (error, results) => { 91 | if (error) { 92 | return next(error); 93 | } 94 | return res.status(200).send({ 95 | message: "Success", 96 | data: results, 97 | }); 98 | }); 99 | } 100 | }); 101 | }; 102 | 103 | // Delete a Product with the specified id in the request 104 | exports.delete = (req, res, next) => { 105 | var model = { 106 | productId: req.params.id, 107 | }; 108 | 109 | productsServices.deleteProduct(model, (error, results) => { 110 | if (error) { 111 | return next(error); 112 | } 113 | return res.status(200).send({ 114 | message: "Success", 115 | data: results, 116 | }); 117 | }); 118 | }; 119 | -------------------------------------------------------------------------------- /api/index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const app = express(); 3 | const mongoose = require("mongoose"); 4 | const { MONGO_DB_CONFIG } = require("./config/app.config"); 5 | const errors = require("./middleware/errors.js"); 6 | const swaggerUi = require("swagger-ui-express"), swaggerDocument = require("./swagger.json"); 7 | 8 | // connect to mongodb 9 | 10 | /** 11 | * With useNewUrlParser: The underlying MongoDB driver has deprecated their current connection string parser. 12 | * Because this is a major change, they added the useNewUrlParser flag to allow users to fall back to the old parser if they find a bug in the new parser. 13 | * You should set useNewUrlParser: true unless that prevents you from connecting. 14 | * 15 | * With useUnifiedTopology, the MongoDB driver sends a heartbeat every heartbeatFrequencyMS to check on the status of the connection. 16 | * A heartbeat is subject to serverSelectionTimeoutMS , so the MongoDB driver will retry failed heartbeats for up to 30 seconds by default. 17 | */ 18 | mongoose.Promise = global.Promise; 19 | mongoose 20 | .connect(MONGO_DB_CONFIG.DB, { 21 | useNewUrlParser: true, 22 | useUnifiedTopology: true, 23 | }) 24 | .then( 25 | () => { 26 | console.log("Database connected"); 27 | }, 28 | (error) => { 29 | console.log("Database can't be connected: " + error); 30 | } 31 | ); 32 | 33 | app.use(express.json()); 34 | 35 | app.use("/uploads", express.static("uploads")); 36 | 37 | // initialize routes 38 | app.use("/api", require("./routes/app.routes")); 39 | 40 | app.use(errors.errorHandler); 41 | 42 | app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(swaggerDocument)); 43 | 44 | // listen for requests 45 | app.listen(process.env.port || 5000, function () { 46 | console.log("Ready to Go!"); 47 | }); 48 | -------------------------------------------------------------------------------- /api/middleware/errors.js: -------------------------------------------------------------------------------- 1 | function errorHandler(err, req, res, next) { 2 | if (typeof err === "string") { 3 | // custom application error 4 | return res.status(400).json({ message: err }); 5 | } 6 | 7 | if (err.name === "ValidationError") { 8 | // mongoose validation error 9 | return res.status(400).json({ message: err.message }); 10 | } 11 | 12 | if (err.name === "UnauthorizedError") { 13 | // jwt authentication error 14 | return res.status(401).json({ message: "Token not valid" }); 15 | } 16 | 17 | return res.status(500).json({ message: err.message }); 18 | } 19 | 20 | module.exports = { 21 | errorHandler, 22 | }; 23 | -------------------------------------------------------------------------------- /api/middleware/upload.js: -------------------------------------------------------------------------------- 1 | const multer = require("multer"); 2 | const Path = require('path'); 3 | 4 | const storage = multer.diskStorage({ 5 | destination: function (req, file, cb) { 6 | cb(null, "./uploads"); 7 | }, 8 | filename: function (req, file, cb) { 9 | cb(null, Date.now() + "--" + file.originalname); 10 | }, 11 | }); 12 | 13 | const fileFilter = (req, file, callback) => { 14 | const acceptableExtensions = [".png", ".jpg", ".mp4"]; 15 | if (!acceptableExtensions.includes(Path.extname(file.originalname))) { 16 | return callback(new Error("Only .png, .jpg and .jpeg format allowed!")); 17 | } 18 | 19 | const fileSize = parseInt(req.headers["content-length"]); 20 | if (fileSize > 1048576) { 21 | return callback(new Error("File Size Big")); 22 | } 23 | 24 | callback(null, true); 25 | }; 26 | 27 | let upload = multer({ 28 | storage: storage, 29 | fileFilter: fileFilter, 30 | fileSize: 1048576, // 10 Mb 31 | }); 32 | 33 | module.exports = upload.single("productImage"); 34 | -------------------------------------------------------------------------------- /api/models/products.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const product = mongoose.model( 4 | "products", 5 | mongoose.Schema( 6 | { 7 | productName: String, 8 | productDescription: String, 9 | productPrice: Number, 10 | productImage: String 11 | }, 12 | { timestamps: true } 13 | ) 14 | ); 15 | 16 | module.exports = { 17 | product, 18 | }; 19 | -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs_push_notification_api", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.17.1", 13 | "mongoose": "^6.1.1", 14 | "multer": "^1.4.4", 15 | "nodemon": "^2.0.15", 16 | "swagger-ui-express": "^4.3.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/routes/app.routes.js: -------------------------------------------------------------------------------- 1 | const productsController = require("../controllers/products.controller"); 2 | const express = require("express"); 3 | const router = express.Router(); 4 | 5 | // Create a new Product 6 | router.post("/products", productsController.create); 7 | 8 | // Retrieve all Products 9 | router.get("/products", productsController.findAll); 10 | 11 | // Retrieve a single Product with id 12 | router.get("/products/:id", productsController.findOne); 13 | 14 | // Update a Product with id 15 | router.put("/products/:id", productsController.update); 16 | 17 | // // Delete a Product with id 18 | router.delete("/products/:id", productsController.delete); 19 | 20 | module.exports = router; 21 | -------------------------------------------------------------------------------- /api/services/products.services.js: -------------------------------------------------------------------------------- 1 | const { product } = require("../models/products.model"); 2 | 3 | async function createProduct(params, callback) { 4 | if (!params.productName) { 5 | return callback( 6 | { 7 | message: "Product Name Required", 8 | }, 9 | "" 10 | ); 11 | } 12 | 13 | const productModel = new product(params); 14 | productModel 15 | .save() 16 | .then((response) => { 17 | return callback(null, response); 18 | }) 19 | .catch((error) => { 20 | return callback(error); 21 | }); 22 | } 23 | 24 | async function getProducts(params, callback) { 25 | const productName = params.productName; 26 | var condition = productName 27 | ? { productName: { $regex: new RegExp(productName), $options: "i" } } 28 | : {}; 29 | 30 | product 31 | .find(condition) 32 | .then((response) => { 33 | return callback(null, response); 34 | }) 35 | .catch((error) => { 36 | return callback(error); 37 | }); 38 | } 39 | 40 | async function getProductById(params, callback) { 41 | const productId = params.productId; 42 | 43 | product 44 | .findById(productId) 45 | .then((response) => { 46 | if (!response) callback("Not found Product with id " + productId); 47 | else callback(null, response); 48 | }) 49 | .catch((error) => { 50 | return callback(error); 51 | }); 52 | } 53 | 54 | async function updateProduct(params, callback) { 55 | const productId = params.productId; 56 | 57 | product 58 | .findByIdAndUpdate(productId, params, { useFindAndModify: false }) 59 | .then((response) => { 60 | if (!response) callback(`Cannot update Tutorial with id=${productId}. Maybe Tutorial was not found!`); 61 | else callback(null, response); 62 | }) 63 | .catch((error) => { 64 | return callback(error); 65 | }); 66 | } 67 | 68 | async function deleteProduct(params, callback) { 69 | const productId = params.productId; 70 | 71 | product 72 | .findByIdAndRemove(productId) 73 | .then((response) => { 74 | if (!response) callback(`Cannot delete Product with id=${productId}. Maybe Product was not found!`); 75 | else callback(null, response); 76 | }) 77 | .catch((error) => { 78 | return callback(error); 79 | }); 80 | } 81 | 82 | module.exports = { 83 | createProduct, 84 | getProducts, 85 | getProductById, 86 | updateProduct, 87 | deleteProduct 88 | }; 89 | -------------------------------------------------------------------------------- /api/swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "version": "1.0.0", 5 | "title": "Shopping App - CRUD", 6 | "description": "My Shopping App Project Application API", 7 | "license": { 8 | "name": "MIT", 9 | "url": "https://opensource.org/licenses/MIT" 10 | } 11 | }, 12 | "host": "localhost:5000", 13 | "basePath": "/", 14 | "tags": [ 15 | { 16 | "name": "Products", 17 | "description": "Products API" 18 | } 19 | ], 20 | "schemes": ["http"], 21 | "consumes": ["application/json"], 22 | "produces": ["application/json"], 23 | "paths": { 24 | "/api/products": { 25 | "get": { 26 | "tags": ["Products"], 27 | "summary": "Get all products", 28 | "parameters": [ 29 | { 30 | "name": "productName", 31 | "in": "query", 32 | "required": false, 33 | "description": "Product Name", 34 | "type": "string" 35 | } 36 | ], 37 | "responses": { 38 | "200": { 39 | "description": "OK", 40 | "schema": { 41 | "$ref": "#/definitions/ServiceResponse" 42 | } 43 | } 44 | } 45 | }, 46 | "post": { 47 | "tags": ["Products"], 48 | "summary": "Create Product API", 49 | "parameters": [ 50 | { 51 | "name": "productName", 52 | "in": "formData", 53 | "description": "Product Name", 54 | "required": true, 55 | "type": "string" 56 | }, 57 | { 58 | "name": "productDescription", 59 | "in": "formData", 60 | "description": "Product Description", 61 | "type": "string" 62 | }, 63 | { 64 | "name": "productPrice", 65 | "in": "formData", 66 | "description": "Product Price", 67 | "required": true, 68 | "type": "integer" 69 | }, 70 | { 71 | "name": "productImage", 72 | "in": "formData", 73 | "description": "Product Image", 74 | "type": "file" 75 | } 76 | ], 77 | "responses": { 78 | "200": { 79 | "description": "OK", 80 | "schema": { 81 | "$ref": "#/definitions/ServiceResponse" 82 | } 83 | } 84 | } 85 | } 86 | }, 87 | "/api/products/{id}": { 88 | "parameters": [ 89 | { 90 | "name": "id", 91 | "in": "path", 92 | "required": true, 93 | "description": "Product Id", 94 | "type": "string" 95 | } 96 | ], 97 | "get": { 98 | "tags": ["Products"], 99 | "summary": "Product Details based on Product Id", 100 | "responses": { 101 | "200": { 102 | "description": "OK", 103 | "schema": { 104 | "$ref": "#/definitions/ServiceResponse" 105 | } 106 | } 107 | } 108 | }, 109 | "put": { 110 | "tags": ["Products"], 111 | "summary": "Update Product API", 112 | "parameters": [ 113 | { 114 | "name": "productName", 115 | "in": "formData", 116 | "description": "Product Name", 117 | "required": true, 118 | "type": "string" 119 | }, 120 | { 121 | "name": "productDescription", 122 | "in": "formData", 123 | "description": "Product Description", 124 | "type": "string" 125 | }, 126 | { 127 | "name": "productPrice", 128 | "in": "formData", 129 | "description": "Product Price", 130 | "required": true, 131 | "type": "integer" 132 | }, 133 | { 134 | "name": "productImage", 135 | "in": "formData", 136 | "description": "Product Image", 137 | "type": "file" 138 | } 139 | ], 140 | "responses": { 141 | "200": { 142 | "description": "OK", 143 | "schema": { 144 | "$ref": "#/definitions/ServiceResponse" 145 | } 146 | } 147 | } 148 | }, 149 | "delete": { 150 | "tags": ["Products"], 151 | "summary": "Delete Product API", 152 | "responses": { 153 | "200": { 154 | "description": "OK", 155 | "schema": { 156 | "$ref": "#/definitions/ServiceResponse" 157 | } 158 | } 159 | } 160 | } 161 | } 162 | }, 163 | "definitions": { 164 | "Product": { 165 | "required": ["productName", "_id", "productPrice"], 166 | "properties": { 167 | "_id": { 168 | "type": "integer", 169 | "uniqueItems": true 170 | }, 171 | "productName": { 172 | "type": "string" 173 | }, 174 | "productDescription": { 175 | "type": "string" 176 | }, 177 | "productPrice": { 178 | "type": "number" 179 | }, 180 | "productImage": { 181 | "type": "string" 182 | } 183 | } 184 | }, 185 | "ServiceResponse": { 186 | "properties": { 187 | "message": { 188 | "type": "string" 189 | }, 190 | "data": { 191 | "type": "array", 192 | "items": { 193 | "$ref": "#/definitions/Product" 194 | } 195 | } 196 | } 197 | } 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /flutter/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /flutter/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18116933e77adc82f80866c928266a5b4f1ed645 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /flutter/README.md: -------------------------------------------------------------------------------- 1 | # flutter_nodejs_crud_app 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /flutter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /flutter/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /flutter/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.flutter_nodejs_crud_app" 47 | minSdkVersion 16 48 | targetSdkVersion 30 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /flutter/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /flutter/android/app/src/main/kotlin/com/example/flutter_nodejs_crud_app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_nodejs_crud_app 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /flutter/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /flutter/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /flutter/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /flutter/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /flutter/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNodejsCrudApp; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 297 | SWIFT_VERSION = 5.0; 298 | VERSIONING_SYSTEM = "apple-generic"; 299 | }; 300 | name = Profile; 301 | }; 302 | 97C147031CF9000F007C117D /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | TARGETED_DEVICE_FAMILY = "1,2"; 354 | }; 355 | name = Debug; 356 | }; 357 | 97C147041CF9000F007C117D /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_ANALYZER_NONNULL = YES; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_COMMA = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | SDKROOT = iphoneos; 401 | SUPPORTED_PLATFORMS = iphoneos; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | 97C147061CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | CLANG_ENABLE_MODULES = YES; 414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 415 | ENABLE_BITCODE = NO; 416 | INFOPLIST_FILE = Runner/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNodejsCrudApp; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 422 | SWIFT_VERSION = 5.0; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147071CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = Runner/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNodejsCrudApp; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 440 | SWIFT_VERSION = 5.0; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 97C147031CF9000F007C117D /* Debug */, 452 | 97C147041CF9000F007C117D /* Release */, 453 | 249021D3217E4FDB00AE95B9 /* Profile */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147061CF9000F007C117D /* Debug */, 462 | 97C147071CF9000F007C117D /* Release */, 463 | 249021D4217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /flutter/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /flutter/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_nodejs_crud_app 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /flutter/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /flutter/lib/config.dart: -------------------------------------------------------------------------------- 1 | class Config { 2 | static const String appName = "Shopping App"; 3 | static const String apiURL = '10.0.0.3:5000'; //PROD_URL 4 | static const productsAPI = "api/products"; 5 | } 6 | -------------------------------------------------------------------------------- /flutter/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_nodejs_crud_app/pages/product_add_edit.dart'; 3 | import 'package:flutter_nodejs_crud_app/pages/product_list.dart'; 4 | 5 | void main() { 6 | runApp(const MyApp()); 7 | } 8 | 9 | class MyApp extends StatelessWidget { 10 | const MyApp({Key? key}) : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return MaterialApp( 15 | title: 'Flutter Demo', 16 | theme: ThemeData( 17 | primarySwatch: Colors.blue, 18 | ), 19 | routes: { 20 | '/': (context) => const ProductsList(), 21 | '/add-product': (context) => const ProductAddEdit(), 22 | '/edit-product': (context) => const ProductAddEdit(), 23 | }, 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /flutter/lib/model/product_model.dart: -------------------------------------------------------------------------------- 1 | List productsFromJson(dynamic str) => 2 | List.from((str).map((x) => ProductModel.fromJson(x))); 3 | 4 | class ProductModel { 5 | late String? id; 6 | late String? productName; 7 | late String? productDescription; 8 | late int? productPrice; 9 | late String? productImage; 10 | 11 | ProductModel({ 12 | this.id, 13 | this.productName, 14 | this.productDescription, 15 | this.productPrice, 16 | this.productImage, 17 | }); 18 | 19 | ProductModel.fromJson(Map json) { 20 | id = json['_id']; 21 | productName = json['productName']; 22 | productDescription = json['productDescription']; 23 | productPrice = json['productPrice']; 24 | productImage = json['productImage']; 25 | } 26 | 27 | Map toJson() { 28 | final _data = {}; 29 | _data['_id'] = id; 30 | _data['productName'] = productName; 31 | _data['productDescription'] = productDescription; 32 | _data['productPrice'] = productPrice; 33 | _data['productImage'] = productImage; 34 | return _data; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /flutter/lib/pages/product_add_edit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_nodejs_crud_app/model/product_model.dart'; 5 | import 'package:flutter_nodejs_crud_app/services/api_service.dart'; 6 | import 'package:image_picker/image_picker.dart'; 7 | import 'package:snippet_coder_utils/FormHelper.dart'; 8 | import 'package:snippet_coder_utils/ProgressHUD.dart'; 9 | import 'package:snippet_coder_utils/hex_color.dart'; 10 | 11 | import '../config.dart'; 12 | 13 | class ProductAddEdit extends StatefulWidget { 14 | const ProductAddEdit({Key? key}) : super(key: key); 15 | 16 | @override 17 | _ProductAddEditState createState() => _ProductAddEditState(); 18 | } 19 | 20 | class _ProductAddEditState extends State { 21 | ProductModel? productModel; 22 | static final GlobalKey globalFormKey = GlobalKey(); 23 | bool isApiCallProcess = false; 24 | List images = []; 25 | bool isEditMode = false; 26 | bool isImageSelected = false; 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return SafeArea( 31 | child: Scaffold( 32 | appBar: AppBar( 33 | title: const Text('NodeJS - CRUD'), 34 | elevation: 0, 35 | ), 36 | backgroundColor: Colors.grey[200], 37 | body: ProgressHUD( 38 | child: Form( 39 | key: globalFormKey, 40 | child: productForm(), 41 | ), 42 | inAsyncCall: isApiCallProcess, 43 | opacity: 0.3, 44 | key: UniqueKey(), 45 | ), 46 | ), 47 | ); 48 | } 49 | 50 | @override 51 | void initState() { 52 | super.initState(); 53 | productModel = ProductModel(); 54 | 55 | Future.delayed(Duration.zero, () { 56 | if (ModalRoute.of(context)?.settings.arguments != null) { 57 | final Map arguments = ModalRoute.of(context)?.settings.arguments as Map; 58 | productModel = arguments['model']; 59 | isEditMode = true; 60 | setState(() {}); 61 | } 62 | }); 63 | } 64 | 65 | Widget productForm() { 66 | return SingleChildScrollView( 67 | child: Column( 68 | mainAxisAlignment: MainAxisAlignment.start, 69 | crossAxisAlignment: CrossAxisAlignment.start, 70 | children: [ 71 | Padding( 72 | padding: const EdgeInsets.only( 73 | bottom: 10, 74 | top: 10, 75 | ), 76 | child: FormHelper.inputFieldWidget( 77 | context, 78 | const Icon(Icons.person), 79 | "ProductName", 80 | "Product Name", 81 | (onValidateVal) { 82 | if (onValidateVal.isEmpty) { 83 | return 'ProductName can\'t be empty.'; 84 | } 85 | 86 | return null; 87 | }, 88 | (onSavedVal) => { 89 | productModel!.productName = onSavedVal, 90 | }, 91 | initialValue: productModel!.productName ?? "", 92 | obscureText: false, 93 | borderFocusColor: Colors.black, 94 | borderColor: Colors.black, 95 | textColor: Colors.black, 96 | hintColor: Colors.black.withOpacity(0.7), 97 | borderRadius: 10, 98 | showPrefixIcon: false, 99 | ), 100 | ), 101 | Padding( 102 | padding: const EdgeInsets.only( 103 | bottom: 10, 104 | top: 10, 105 | ), 106 | child: FormHelper.inputFieldWidget( 107 | context, 108 | const Icon(Icons.person), 109 | "ProductPrice", 110 | "Product Price", 111 | (onValidateVal) { 112 | if (onValidateVal.isEmpty) { 113 | return 'Product Price can\'t be empty.'; 114 | } 115 | 116 | return null; 117 | }, 118 | (onSavedVal) => { 119 | productModel!.productPrice = int.parse(onSavedVal), 120 | }, 121 | initialValue: productModel!.productPrice == null 122 | ? "" 123 | : productModel!.productPrice.toString(), 124 | obscureText: false, 125 | borderFocusColor: Colors.black, 126 | borderColor: Colors.black, 127 | textColor: Colors.black, 128 | hintColor: Colors.black.withOpacity(0.7), 129 | borderRadius: 10, 130 | showPrefixIcon: false, 131 | suffixIcon: const Icon(Icons.monetization_on), 132 | ), 133 | ), 134 | picPicker( 135 | isImageSelected, 136 | productModel!.productImage ?? "", 137 | (file) => { 138 | setState( 139 | () { 140 | //model.productPic = file.path; 141 | productModel!.productImage = file.path; 142 | isImageSelected = true; 143 | }, 144 | ) 145 | }, 146 | ), 147 | const SizedBox( 148 | height: 20, 149 | ), 150 | Center( 151 | child: FormHelper.submitButton( 152 | "Save", 153 | () { 154 | if (validateAndSave()) { 155 | print(productModel!.toJson()); 156 | 157 | setState(() { 158 | isApiCallProcess = true; 159 | }); 160 | 161 | APIService.saveProduct( 162 | productModel!, 163 | isEditMode, 164 | isImageSelected, 165 | ).then( 166 | (response) { 167 | setState(() { 168 | isApiCallProcess = false; 169 | }); 170 | 171 | if (response) { 172 | Navigator.pushNamedAndRemoveUntil( 173 | context, 174 | '/', 175 | (route) => false, 176 | ); 177 | } else { 178 | FormHelper.showSimpleAlertDialog( 179 | context, 180 | Config.appName, 181 | "Error occur", 182 | "OK", 183 | () { 184 | Navigator.of(context).pop(); 185 | }, 186 | ); 187 | } 188 | }, 189 | ); 190 | } 191 | }, 192 | btnColor: HexColor("283B71"), 193 | borderColor: Colors.white, 194 | txtColor: Colors.white, 195 | borderRadius: 10, 196 | ), 197 | ), 198 | const SizedBox( 199 | height: 20, 200 | ), 201 | ], 202 | ), 203 | ); 204 | } 205 | 206 | bool validateAndSave() { 207 | final form = globalFormKey.currentState; 208 | if (form!.validate()) { 209 | form.save(); 210 | return true; 211 | } 212 | return false; 213 | } 214 | 215 | static Widget picPicker( 216 | bool isImageSelected, 217 | String fileName, 218 | Function onFilePicked, 219 | ) { 220 | Future _imageFile; 221 | ImagePicker _picker = ImagePicker(); 222 | 223 | return Column( 224 | children: [ 225 | fileName.isNotEmpty 226 | ? isImageSelected 227 | ? Image.file( 228 | File(fileName), 229 | width: 300, 230 | height: 300, 231 | ) 232 | : SizedBox( 233 | child: Image.network( 234 | fileName, 235 | width: 200, 236 | height: 200, 237 | fit: BoxFit.scaleDown, 238 | ), 239 | ) 240 | : SizedBox( 241 | child: Image.network( 242 | "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/1665px-No-Image-Placeholder.svg.png", 243 | width: 200, 244 | height: 200, 245 | fit: BoxFit.scaleDown, 246 | ), 247 | ), 248 | Row( 249 | mainAxisAlignment: MainAxisAlignment.center, 250 | children: [ 251 | SizedBox( 252 | height: 35.0, 253 | width: 35.0, 254 | child: IconButton( 255 | padding: const EdgeInsets.all(0), 256 | icon: const Icon(Icons.image, size: 35.0), 257 | onPressed: () { 258 | _imageFile = _picker.pickImage(source: ImageSource.gallery); 259 | _imageFile.then((file) async { 260 | onFilePicked(file); 261 | }); 262 | }, 263 | ), 264 | ), 265 | SizedBox( 266 | height: 35.0, 267 | width: 35.0, 268 | child: IconButton( 269 | padding: const EdgeInsets.fromLTRB(10, 0, 0, 0), 270 | icon: const Icon(Icons.camera, size: 35.0), 271 | onPressed: () { 272 | _imageFile = _picker.pickImage(source: ImageSource.camera); 273 | _imageFile.then((file) async { 274 | onFilePicked(file); 275 | }); 276 | }, 277 | ), 278 | ), 279 | ], 280 | ), 281 | ], 282 | ); 283 | } 284 | 285 | isValidURL(url) { 286 | return Uri.tryParse(url)?.hasAbsolutePath ?? false; 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /flutter/lib/pages/product_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:snippet_coder_utils/FormHelper.dart'; 3 | import '../model/product_model.dart'; 4 | 5 | class ProductItem extends StatelessWidget { 6 | final ProductModel? model; 7 | final Function? onDelete; 8 | 9 | ProductItem({ 10 | Key? key, 11 | this.model, 12 | this.onDelete, 13 | }) : super(key: key); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Card( 18 | elevation: 0, 19 | margin: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 5.0), 20 | child: Container( 21 | width: 200, 22 | decoration: BoxDecoration( 23 | color: Colors.white, 24 | borderRadius: BorderRadius.circular(50), 25 | ), 26 | child: cartItem(context), 27 | ), 28 | ); 29 | } 30 | 31 | Widget cartItem(context) { 32 | return Row( 33 | mainAxisAlignment: MainAxisAlignment.start, 34 | crossAxisAlignment: CrossAxisAlignment.start, 35 | children: [ 36 | Container( 37 | width: 120, 38 | alignment: Alignment.center, 39 | margin: EdgeInsets.all(10), 40 | child: Image.network( 41 | (model!.productImage == null || model!.productImage == "") 42 | ? "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/1665px-No-Image-Placeholder.svg.png" 43 | : model!.productImage!, 44 | height: 70, 45 | fit: BoxFit.scaleDown, 46 | ), 47 | ), 48 | Padding( 49 | padding: const EdgeInsets.all(8.0), 50 | child: Column( 51 | mainAxisAlignment: MainAxisAlignment.start, 52 | crossAxisAlignment: CrossAxisAlignment.start, 53 | children: [ 54 | Text( 55 | model!.productName!, 56 | style: const TextStyle( 57 | color: Colors.black, 58 | fontWeight: FontWeight.bold, 59 | ), 60 | ), 61 | const SizedBox( 62 | height: 10, 63 | ), 64 | Text( 65 | "₹${model!.productPrice}", 66 | style: const TextStyle(color: Colors.black), 67 | ), 68 | const SizedBox( 69 | height: 10, 70 | ), 71 | Container( 72 | width: MediaQuery.of(context).size.width - 180, 73 | child: Row( 74 | mainAxisAlignment: MainAxisAlignment.end, 75 | children: [ 76 | GestureDetector( 77 | child: const Icon(Icons.edit), 78 | onTap: () { 79 | Navigator.of(context).pushNamed( 80 | '/edit-product', 81 | arguments: { 82 | 'model': model, 83 | }, 84 | ); 85 | }, 86 | ), 87 | GestureDetector( 88 | child: const Icon( 89 | Icons.delete, 90 | color: Colors.red, 91 | ), 92 | onTap: () { 93 | onDelete!(model); 94 | }, 95 | ), 96 | ], 97 | ), 98 | ) 99 | ], 100 | ), 101 | ), 102 | ], 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /flutter/lib/pages/product_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_nodejs_crud_app/model/product_model.dart'; 3 | import 'package:flutter_nodejs_crud_app/pages/product_item.dart'; 4 | import 'package:flutter_nodejs_crud_app/services/api_service.dart'; 5 | import 'package:snippet_coder_utils/ProgressHUD.dart'; 6 | 7 | class ProductsList extends StatefulWidget { 8 | const ProductsList({Key? key}) : super(key: key); 9 | 10 | @override 11 | _ProductsListState createState() => _ProductsListState(); 12 | } 13 | 14 | class _ProductsListState extends State { 15 | // List products = List.empty(growable: true); 16 | bool isApiCallProcess = false; 17 | @override 18 | void initState() { 19 | super.initState(); 20 | 21 | // products.add( 22 | // ProductModel( 23 | // id: "1", 24 | // productName: "Haldiram", 25 | // productImage: 26 | // "https://cdn.grofers.com/cdn-cgi/image/f=auto,fit=scale-down,q=85,metadata=none,w=400,h=400/app/images/products/full_screen/pro_86973.jpg", 27 | // productDescription: "Haldiram Foods", 28 | // productPrice: 500, 29 | // ), 30 | // ); 31 | 32 | // products.add( 33 | // ProductModel( 34 | // id: "1", 35 | // productName: "Haldiram", 36 | // productImage: 37 | // "https://cdn.grofers.com/cdn-cgi/image/f=auto,fit=scale-down,q=85,metadata=none,w=400,h=400/app/images/products/full_screen/pro_86973.jpg", 38 | // productDescription: "Haldiram Foods", 39 | // productPrice: 500, 40 | // ), 41 | // ); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | return Scaffold( 47 | appBar: AppBar( 48 | title: const Text('NodeJS - CRUD'), 49 | elevation: 0, 50 | ), 51 | backgroundColor: Colors.grey[200], 52 | body: ProgressHUD( 53 | child: loadProducts(), 54 | inAsyncCall: isApiCallProcess, 55 | opacity: 0.3, 56 | key: UniqueKey(), 57 | ), 58 | ); 59 | } 60 | 61 | Widget loadProducts() { 62 | return FutureBuilder( 63 | future: APIService.getProducts(), 64 | builder: ( 65 | BuildContext context, 66 | AsyncSnapshot?> model, 67 | ) { 68 | if (model.hasData) { 69 | return productList(model.data); 70 | } 71 | 72 | return const Center( 73 | child: CircularProgressIndicator(), 74 | ); 75 | }, 76 | ); 77 | } 78 | 79 | Widget productList(products) { 80 | return SingleChildScrollView( 81 | child: Column( 82 | mainAxisAlignment: MainAxisAlignment.spaceAround, 83 | crossAxisAlignment: CrossAxisAlignment.center, 84 | children: [ 85 | Column( 86 | mainAxisAlignment: MainAxisAlignment.start, 87 | children: [ 88 | ElevatedButton( 89 | style: ElevatedButton.styleFrom( 90 | onPrimary: Colors.white, 91 | primary: Colors.green, 92 | minimumSize: const Size(88, 36), 93 | padding: const EdgeInsets.symmetric(horizontal: 16), 94 | shape: const RoundedRectangleBorder( 95 | borderRadius: BorderRadius.all( 96 | Radius.circular(10), 97 | ), 98 | ), 99 | ), 100 | onPressed: () { 101 | Navigator.pushNamed( 102 | context, 103 | '/add-product', 104 | ); 105 | }, 106 | child: const Text('Add Product'), 107 | ), 108 | ListView.builder( 109 | shrinkWrap: true, 110 | physics: const ClampingScrollPhysics(), 111 | scrollDirection: Axis.vertical, 112 | itemCount: products.length, 113 | itemBuilder: (context, index) { 114 | return ProductItem( 115 | model: products[index], 116 | onDelete: (ProductModel model) { 117 | setState(() { 118 | isApiCallProcess = true; 119 | }); 120 | 121 | APIService.deleteProduct(model.id).then( 122 | (response) { 123 | setState(() { 124 | isApiCallProcess = false; 125 | }); 126 | }, 127 | ); 128 | }, 129 | ); 130 | }, 131 | ), 132 | ], 133 | ) 134 | ], 135 | ), 136 | ); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /flutter/lib/services/api_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:flutter_nodejs_crud_app/model/product_model.dart'; 5 | import 'package:http/http.dart' as http; 6 | 7 | import '../../config.dart'; 8 | 9 | class APIService { 10 | static var client = http.Client(); 11 | 12 | static Future?> getProducts() async { 13 | Map requestHeaders = { 14 | 'Content-Type': 'application/json', 15 | }; 16 | 17 | var url = Uri.http( 18 | Config.apiURL, 19 | Config.productsAPI, 20 | ); 21 | 22 | var response = await client.get( 23 | url, 24 | headers: requestHeaders, 25 | ); 26 | 27 | if (response.statusCode == 200) { 28 | var data = jsonDecode(response.body); 29 | 30 | return productsFromJson(data["data"]); 31 | 32 | //return true; 33 | } else { 34 | return null; 35 | } 36 | } 37 | 38 | static Future saveProduct( 39 | ProductModel model, 40 | bool isEditMode, 41 | bool isFileSelected, 42 | ) async { 43 | var productURL = Config.productsAPI; 44 | 45 | if (isEditMode) { 46 | productURL = productURL + "/" + model.id.toString(); 47 | } 48 | 49 | var url = Uri.http(Config.apiURL, productURL); 50 | 51 | var requestMethod = isEditMode ? "PUT" : "POST"; 52 | 53 | var request = http.MultipartRequest(requestMethod, url); 54 | request.fields["productName"] = model.productName!; 55 | request.fields["productPrice"] = model.productPrice!.toString(); 56 | 57 | if (model.productImage != null && isFileSelected) { 58 | http.MultipartFile multipartFile = await http.MultipartFile.fromPath( 59 | 'productImage', 60 | model.productImage!, 61 | ); 62 | 63 | request.files.add(multipartFile); 64 | } 65 | 66 | var response = await request.send(); 67 | 68 | if (response.statusCode == 200) { 69 | return true; 70 | } else { 71 | return false; 72 | } 73 | } 74 | 75 | static Future deleteProduct(productId) async { 76 | Map requestHeaders = { 77 | 'Content-Type': 'application/json', 78 | }; 79 | 80 | var url = Uri.http( 81 | Config.apiURL, 82 | Config.productsAPI + "/" + productId, 83 | ); 84 | 85 | var response = await client.delete( 86 | url, 87 | headers: requestHeaders, 88 | ); 89 | 90 | if (response.statusCode == 200) { 91 | return true; 92 | } else { 93 | return false; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /flutter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.8.2" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.2.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.3.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0" 46 | cross_file: 47 | dependency: transitive 48 | description: 49 | name: cross_file 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.3.2" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.0.4" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.2.0" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_lints: 73 | dependency: "direct dev" 74 | description: 75 | name: flutter_lints 76 | url: "https://pub.dartlang.org" 77 | source: hosted 78 | version: "1.0.4" 79 | flutter_plugin_android_lifecycle: 80 | dependency: transitive 81 | description: 82 | name: flutter_plugin_android_lifecycle 83 | url: "https://pub.dartlang.org" 84 | source: hosted 85 | version: "2.0.5" 86 | flutter_test: 87 | dependency: "direct dev" 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | flutter_web_plugins: 92 | dependency: transitive 93 | description: flutter 94 | source: sdk 95 | version: "0.0.0" 96 | http: 97 | dependency: transitive 98 | description: 99 | name: http 100 | url: "https://pub.dartlang.org" 101 | source: hosted 102 | version: "0.13.4" 103 | http_parser: 104 | dependency: transitive 105 | description: 106 | name: http_parser 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "4.0.0" 110 | image_picker: 111 | dependency: "direct main" 112 | description: 113 | name: image_picker 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "0.8.4+4" 117 | image_picker_for_web: 118 | dependency: transitive 119 | description: 120 | name: image_picker_for_web 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "2.1.4" 124 | image_picker_platform_interface: 125 | dependency: transitive 126 | description: 127 | name: image_picker_platform_interface 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "2.4.1" 131 | js: 132 | dependency: transitive 133 | description: 134 | name: js 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "0.6.3" 138 | lints: 139 | dependency: transitive 140 | description: 141 | name: lints 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.0.1" 145 | matcher: 146 | dependency: transitive 147 | description: 148 | name: matcher 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "0.12.11" 152 | meta: 153 | dependency: transitive 154 | description: 155 | name: meta 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.7.0" 159 | path: 160 | dependency: transitive 161 | description: 162 | name: path 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.8.0" 166 | plugin_platform_interface: 167 | dependency: transitive 168 | description: 169 | name: plugin_platform_interface 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "2.0.2" 173 | sky_engine: 174 | dependency: transitive 175 | description: flutter 176 | source: sdk 177 | version: "0.0.99" 178 | snippet_coder_utils: 179 | dependency: "direct main" 180 | description: 181 | name: snippet_coder_utils 182 | url: "https://pub.dartlang.org" 183 | source: hosted 184 | version: "1.0.9" 185 | source_span: 186 | dependency: transitive 187 | description: 188 | name: source_span 189 | url: "https://pub.dartlang.org" 190 | source: hosted 191 | version: "1.8.1" 192 | stack_trace: 193 | dependency: transitive 194 | description: 195 | name: stack_trace 196 | url: "https://pub.dartlang.org" 197 | source: hosted 198 | version: "1.10.0" 199 | stream_channel: 200 | dependency: transitive 201 | description: 202 | name: stream_channel 203 | url: "https://pub.dartlang.org" 204 | source: hosted 205 | version: "2.1.0" 206 | string_scanner: 207 | dependency: transitive 208 | description: 209 | name: string_scanner 210 | url: "https://pub.dartlang.org" 211 | source: hosted 212 | version: "1.1.0" 213 | term_glyph: 214 | dependency: transitive 215 | description: 216 | name: term_glyph 217 | url: "https://pub.dartlang.org" 218 | source: hosted 219 | version: "1.2.0" 220 | test_api: 221 | dependency: transitive 222 | description: 223 | name: test_api 224 | url: "https://pub.dartlang.org" 225 | source: hosted 226 | version: "0.4.3" 227 | typed_data: 228 | dependency: transitive 229 | description: 230 | name: typed_data 231 | url: "https://pub.dartlang.org" 232 | source: hosted 233 | version: "1.3.0" 234 | vector_math: 235 | dependency: transitive 236 | description: 237 | name: vector_math 238 | url: "https://pub.dartlang.org" 239 | source: hosted 240 | version: "2.1.1" 241 | sdks: 242 | dart: ">=2.14.0 <3.0.0" 243 | flutter: ">=2.5.0" 244 | -------------------------------------------------------------------------------- /flutter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_nodejs_crud_app 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.12.0 <3.0.0" 22 | 23 | # Dependencies specify other packages that your package needs in order to work. 24 | # To automatically upgrade your package dependencies to the latest versions 25 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 26 | # dependencies can be manually updated by changing the version numbers below to 27 | # the latest version available on pub.dev. To see which dependencies have newer 28 | # versions available, run `flutter pub outdated`. 29 | dependencies: 30 | flutter: 31 | sdk: flutter 32 | snippet_coder_utils: ^1.0.9 33 | image_picker: ^0.8.4+4 34 | 35 | 36 | # The following adds the Cupertino Icons font to your application. 37 | # Use with the CupertinoIcons class for iOS style icons. 38 | cupertino_icons: ^1.0.2 39 | 40 | dev_dependencies: 41 | flutter_test: 42 | sdk: flutter 43 | 44 | # The "flutter_lints" package below contains a set of recommended lints to 45 | # encourage good coding practices. The lint set provided by the package is 46 | # activated in the `analysis_options.yaml` file located at the root of your 47 | # package. See that file for information about deactivating specific lint 48 | # rules and activating additional ones. 49 | flutter_lints: ^1.0.0 50 | 51 | # For information on the generic Dart part of this file, see the 52 | # following page: https://dart.dev/tools/pub/pubspec 53 | 54 | # The following section is specific to Flutter. 55 | flutter: 56 | 57 | # The following line ensures that the Material Icons font is 58 | # included with your application, so that you can use the icons in 59 | # the material Icons class. 60 | uses-material-design: true 61 | 62 | # To add assets to your application, add an assets section, like this: 63 | # assets: 64 | # - images/a_dot_burr.jpeg 65 | # - images/a_dot_ham.jpeg 66 | 67 | # An image asset can refer to one or more resolution-specific "variants", see 68 | # https://flutter.dev/assets-and-images/#resolution-aware. 69 | 70 | # For details regarding adding assets from package dependencies, see 71 | # https://flutter.dev/assets-and-images/#from-packages 72 | 73 | # To add custom fonts to your application, add a fonts section here, 74 | # in this "flutter" section. Each entry in this list should have a 75 | # "family" key with the font family name, and a "fonts" key with a 76 | # list giving the asset and other descriptors for the font. For 77 | # example: 78 | # fonts: 79 | # - family: Schyler 80 | # fonts: 81 | # - asset: fonts/Schyler-Regular.ttf 82 | # - asset: fonts/Schyler-Italic.ttf 83 | # style: italic 84 | # - family: Trajan Pro 85 | # fonts: 86 | # - asset: fonts/TrajanPro.ttf 87 | # - asset: fonts/TrajanPro_Bold.ttf 88 | # weight: 700 89 | # 90 | # For details regarding fonts from package dependencies, 91 | # see https://flutter.dev/custom-fonts/#from-packages 92 | -------------------------------------------------------------------------------- /flutter/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_nodejs_crud_app/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /flutter/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/web/favicon.png -------------------------------------------------------------------------------- /flutter/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/web/icons/Icon-192.png -------------------------------------------------------------------------------- /flutter/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/web/icons/Icon-512.png -------------------------------------------------------------------------------- /flutter/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /flutter/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnippetCoders/flutter_nodejs_crud/48702937140b88486f77c810ac95b8703357c7b0/flutter/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /flutter/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | flutter_nodejs_crud_app 30 | 31 | 32 | 33 | 36 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /flutter/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_nodejs_crud_app", 3 | "short_name": "flutter_nodejs_crud_app", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | --------------------------------------------------------------------------------