This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductView extends ProductViewModel { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
key: scaffoldKey, | |
appBar: AppBar( | |
title: Text("Product List"), | |
), | |
floatingActionButton: FloatingActionButton( | |
onPressed: () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateProductView extends StatefulWidget { | |
final Function(ProductModel model) onComplete; | |
const CreateProductView({Key key, @required this.onComplete}) | |
: super(key: key); | |
@override | |
_CreateProductViewState createState() => _CreateProductViewState(); | |
} | |
class _CreateProductViewState extends State<CreateProductView> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateProductView extends StatelessWidget { | |
final ProductModel product; | |
final TextEditingController controller; | |
final Function(ProductModel product) onComplete; | |
const UpdateProductView( | |
{Key key, | |
@required this.product, | |
@required this.controller, | |
this.onComplete}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class ProductViewModel extends BaseState<Product> { | |
IO.Socket socket = IO.io(AppConstants.SOCKET_URL); | |
final TextEditingController textEditingController1 = TextEditingController(); | |
final TextEditingController textEditingController2 = TextEditingController(); | |
List<ProductModel> products = []; | |
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey(); | |
ProductService service = ProductService(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ShoppiDio with DioMixin implements Dio { | |
static ShoppiDio _instance; | |
static ShoppiDio get instance { | |
if (_instance == null) { | |
_instance = ShoppiDio._init(); | |
} | |
return _instance; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require("mongoose"); | |
const bodyParser = require('body-parser'); | |
const httpStatusCode = require('http-status-codes'); | |
var cors = require('cors'); | |
var app = require('express')(); | |
const router = require('express').Router(); | |
const port = process.env.PORT || 4000; | |
const socketConstants = require('./constants/socket_constants'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
var Joi = require('joi'); | |
const Product = require('../models/product'); | |
const httpStatusCode = require('http-status-codes'); | |
const productPath = "/product"; | |
router.get(productPath, (req, res) => { | |
Product.find((err, products) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
var productSchema = new mongoose.Schema({ | |
title: { | |
type: String, | |
required: true, | |
unique: true, | |
index: true, | |
}, | |
image: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ShoppiDioService with DioMixin implements Dio { | |
static ShoppiDioService _instance; | |
String baseUrl; | |
static ShoppiDioService get instance { | |
if (_instance == null) { | |
_instance = ShoppiDioService._init(); | |
} | |
return _instance; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(List<String> args) { | |
final userId = 1000; | |
// dumyy add item | |
List<EtkinlikOturum> datas = []; | |
for (var i = 0; i < 1000; i++) { | |
datas.add(EtkinlikOturum(id: i, etkinlikOturumDetay: [ | |
EtkinlikOturumDetay(etkinlikOturumDetayChild: [ | |
EtkinlikOturumDetayChild(uyeId: i % 10 == 0 ? 1000 : i) | |
]) | |
])); |