mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-28 08:44:06 +02:00
mock server
This commit is contained in:
parent
afaf0b34db
commit
9b1784ba3d
@ -1,159 +1,27 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/models/coordinate.dart';
|
|
||||||
import 'package:mobile/models/product.dart';
|
import 'package:mobile/models/product.dart';
|
||||||
import 'package:mobile/results.dart';
|
import 'package:mobile/results.dart';
|
||||||
import 'package:mobile/server/client.dart';
|
import 'package:mobile/server/mock_server.dart';
|
||||||
import 'package:mobile/server/server.dart';
|
import 'package:mobile/server/server.dart';
|
||||||
|
|
||||||
class ProductController extends ChangeNotifier {
|
class ProductController extends ChangeNotifier {
|
||||||
int _nextId = 0;
|
final server = MockServer();
|
||||||
|
|
||||||
List<Product> products = [];
|
List<Product> products = [];
|
||||||
String query = "";
|
String query = "";
|
||||||
ProductController() {
|
ProductController() {
|
||||||
_addAllProducts();
|
|
||||||
}
|
|
||||||
|
|
||||||
int getNextId() {
|
|
||||||
return _nextId++;
|
|
||||||
}
|
|
||||||
|
|
||||||
get filteredProducts {
|
|
||||||
if (query.trim().isEmpty) {
|
|
||||||
return products;
|
|
||||||
}
|
|
||||||
return products.where((product) {
|
|
||||||
final nameLower = product.name.toLowerCase();
|
|
||||||
final descriptionLower = product.description.toLowerCase();
|
|
||||||
final searchLower = query.toLowerCase();
|
|
||||||
|
|
||||||
return nameLower.contains(searchLower) ||
|
|
||||||
descriptionLower.contains(searchLower);
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void searchProducts(String query) {
|
|
||||||
this.query = query;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<Product, String> productWithBarcode(String barcode) {
|
|
||||||
for (var i = 0; i < products.length; i++) {
|
|
||||||
if (products[i].barcode == barcode) {
|
|
||||||
return Ok(products[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Err("Product with barcode $barcode doesn't exist");
|
|
||||||
}
|
|
||||||
|
|
||||||
void _addAllProducts() {
|
|
||||||
products = [
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Minimælk",
|
|
||||||
priceInDkkCents: 1200,
|
|
||||||
description: "Konventionel minimælk med fedtprocent på 0,4%"),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Letmælk",
|
|
||||||
priceInDkkCents: 1300,
|
|
||||||
description: "Konventionel letmælk med fedtprocent på 1,5%",
|
|
||||||
location: Coordinate(x: 1800, y: 100)),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Frilands Øko Supermælk",
|
|
||||||
priceInDkkCents: 2000,
|
|
||||||
description:
|
|
||||||
"Økologisk mælk af frilandskøer med fedtprocent på 3,5%. Ikke homogeniseret eller pasteuriseret. Skaber store muskler og styrker knoglerne 💪"),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Øko Gulerødder 1 kg",
|
|
||||||
priceInDkkCents: 1000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Øko Agurk",
|
|
||||||
priceInDkkCents: 1000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Æbler 1 kg",
|
|
||||||
priceInDkkCents: 1000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Basmati Ris",
|
|
||||||
priceInDkkCents: 2000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Haribo Mix",
|
|
||||||
priceInDkkCents: 3000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++, name: "Smør", priceInDkkCents: 3000, description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Harboe Cola",
|
|
||||||
priceInDkkCents: 500,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
barcode: "5060337502900",
|
|
||||||
name: "Monster Energi Drik",
|
|
||||||
priceInDkkCents: 1500,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
barcode: "5712870659220",
|
|
||||||
name: "Amper Energi Drik",
|
|
||||||
priceInDkkCents: 750,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
barcode: "5710326001937",
|
|
||||||
name: "Danskvand Med Brus",
|
|
||||||
priceInDkkCents: 500,
|
|
||||||
description: "Med smag a blåbær"),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Spaghetti",
|
|
||||||
priceInDkkCents: 1000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Rød Cecil",
|
|
||||||
priceInDkkCents: 6000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
name: "Jägermeister 750 ml",
|
|
||||||
priceInDkkCents: 12000,
|
|
||||||
description: ""),
|
|
||||||
Product(
|
|
||||||
id: _nextId++,
|
|
||||||
barcode: "5711953068881",
|
|
||||||
name: "Protein Chokoladedrik",
|
|
||||||
priceInDkkCents: 1500,
|
|
||||||
description: "Arla's protein chokolade drik der giver store muskler"),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ProductControllerByServer extends ChangeNotifier {
|
|
||||||
final client = BackendServer();
|
|
||||||
List<Product> products = [];
|
|
||||||
String query = "";
|
|
||||||
ProductControllerByServer() {
|
|
||||||
fetchProductsFromServer();
|
fetchProductsFromServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> fetchProductsFromServer() async {
|
Future<void> fetchProductsFromServer() async {
|
||||||
final res = client.allProducts();
|
final res = await server.allProducts();
|
||||||
if (res is Error) {
|
switch (res) {
|
||||||
return;
|
case Success<List<Product>>(data: final data):
|
||||||
|
products = data;
|
||||||
|
notifyListeners();
|
||||||
|
case Error<List<Product>>():
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
products = (res as Success<List<Product>>).data;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get filteredProducts {
|
get filteredProducts {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/models/product.dart';
|
import 'package:mobile/models/product.dart';
|
||||||
import 'package:mobile/repos/cart.dart';
|
import 'package:mobile/controllers/cart.dart';
|
||||||
|
|
||||||
class ReceiptController extends ChangeNotifier {
|
class ReceiptController extends ChangeNotifier {
|
||||||
int nextId = 0;
|
int nextId = 0;
|
||||||
|
@ -1,22 +1,21 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:mobile/pages/log_in_page.dart';
|
import 'package:mobile/pages/log_in_page.dart';
|
||||||
import 'package:mobile/repos/add_to_cart_state.dart';
|
import 'package:mobile/controllers/add_to_cart_state.dart';
|
||||||
import 'package:mobile/repos/cart.dart';
|
import 'package:mobile/controllers/cart.dart';
|
||||||
import 'package:mobile/repos/location_image.dart';
|
import 'package:mobile/controllers/location_image.dart';
|
||||||
import 'package:mobile/repos/paying_state.dart';
|
import 'package:mobile/controllers/paying_state.dart';
|
||||||
import 'package:mobile/repos/product.dart';
|
import 'package:mobile/controllers/product.dart';
|
||||||
import 'package:mobile/repos/receipt.dart';
|
import 'package:mobile/controllers/receipt.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:mobile/repos/routing.dart';
|
import 'package:mobile/controllers/routing.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
final apiUrl = "10.135.51.114:8080/api";
|
|
||||||
const MyApp({super.key});
|
const MyApp({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/models/product.dart';
|
import 'package:mobile/models/product.dart';
|
||||||
import 'package:mobile/repos/product.dart';
|
import 'package:mobile/controllers/product.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:mobile/widgets/sized_card.dart';
|
import 'package:mobile/widgets/sized_card.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/pages/receipt_page.dart';
|
import 'package:mobile/pages/receipt_page.dart';
|
||||||
import 'package:mobile/repos/receipt.dart';
|
import 'package:mobile/controllers/receipt.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ import 'package:barcode_scan2/platform_wrapper.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/models/product.dart';
|
import 'package:mobile/models/product.dart';
|
||||||
import 'package:mobile/pages/finish_shopping_page.dart';
|
import 'package:mobile/pages/finish_shopping_page.dart';
|
||||||
import 'package:mobile/repos/cart.dart';
|
import 'package:mobile/controllers/cart.dart';
|
||||||
import 'package:mobile/repos/product.dart';
|
import 'package:mobile/controllers/product.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:mobile/results.dart';
|
import 'package:mobile/results.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:mobile/widgets/primary_button.dart';
|
import 'package:mobile/widgets/primary_button.dart';
|
||||||
|
@ -3,9 +3,9 @@ import 'package:mobile/pages/all_products_page.dart';
|
|||||||
import 'package:mobile/pages/cart_page.dart';
|
import 'package:mobile/pages/cart_page.dart';
|
||||||
import 'package:mobile/pages/all_receipts_page.dart';
|
import 'package:mobile/pages/all_receipts_page.dart';
|
||||||
import 'package:mobile/pages/home_page.dart';
|
import 'package:mobile/pages/home_page.dart';
|
||||||
import 'package:mobile/repos/routing.dart';
|
import 'package:mobile/controllers/routing.dart';
|
||||||
import 'package:mobile/repos/cart.dart';
|
import 'package:mobile/controllers/cart.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class Dashboard extends StatelessWidget {
|
class Dashboard extends StatelessWidget {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/repos/routing.dart';
|
import 'package:mobile/controllers/routing.dart';
|
||||||
import 'package:mobile/repos/cart.dart';
|
import 'package:mobile/controllers/cart.dart';
|
||||||
import 'package:mobile/repos/paying_state.dart';
|
import 'package:mobile/controllers/paying_state.dart';
|
||||||
import 'package:mobile/repos/receipt.dart';
|
import 'package:mobile/controllers/receipt.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:mobile/results.dart';
|
import 'package:mobile/results.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:mobile/widgets/primary_button.dart';
|
import 'package:mobile/widgets/primary_button.dart';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/pages/settings_page.dart';
|
import 'package:mobile/pages/settings_page.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/pages/register_page.dart';
|
import 'package:mobile/pages/register_page.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:mobile/results.dart';
|
import 'package:mobile/results.dart';
|
||||||
import 'package:mobile/widgets/error_box.dart';
|
import 'package:mobile/widgets/error_box.dart';
|
||||||
import 'package:mobile/widgets/primary_button.dart';
|
import 'package:mobile/widgets/primary_button.dart';
|
||||||
|
@ -2,7 +2,7 @@ import 'dart:ui' as ui;
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/models/coordinate.dart';
|
import 'package:mobile/models/coordinate.dart';
|
||||||
import 'package:mobile/models/product.dart';
|
import 'package:mobile/models/product.dart';
|
||||||
import 'package:mobile/repos/location_image.dart';
|
import 'package:mobile/controllers/location_image.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class ProductLocationPage extends StatelessWidget {
|
class ProductLocationPage extends StatelessWidget {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/models/product.dart';
|
import 'package:mobile/models/product.dart';
|
||||||
import 'package:mobile/pages/product_location_page.dart';
|
import 'package:mobile/pages/product_location_page.dart';
|
||||||
import 'package:mobile/repos/add_to_cart_state.dart';
|
import 'package:mobile/controllers/add_to_cart_state.dart';
|
||||||
import 'package:mobile/repos/cart.dart';
|
import 'package:mobile/controllers/cart.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:mobile/widgets/primary_button.dart';
|
import 'package:mobile/widgets/primary_button.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/repos/receipt.dart';
|
import 'package:mobile/controllers/receipt.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:mobile/widgets/receipt_item.dart';
|
import 'package:mobile/widgets/receipt_item.dart';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:mobile/results.dart';
|
import 'package:mobile/results.dart';
|
||||||
import 'package:mobile/widgets/error_box.dart';
|
import 'package:mobile/widgets/error_box.dart';
|
||||||
import 'package:mobile/widgets/primary_button.dart';
|
import 'package:mobile/widgets/primary_button.dart';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/pages/log_in_page.dart';
|
import 'package:mobile/pages/log_in_page.dart';
|
||||||
import 'package:mobile/pages/settings_pages/saldo.dart';
|
import 'package:mobile/pages/settings_pages/saldo.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class _Page {
|
class _Page {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/controllers/user.dart';
|
||||||
import 'package:mobile/utils/price.dart';
|
import 'package:mobile/utils/price.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
118
mobile/lib/server/mock_server.dart
Normal file
118
mobile/lib/server/mock_server.dart
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
import 'package:mobile/models/coordinate.dart';
|
||||||
|
import 'package:mobile/models/product.dart';
|
||||||
|
import 'package:mobile/server/server.dart';
|
||||||
|
|
||||||
|
class MockServer implements Server {
|
||||||
|
@override
|
||||||
|
Future<Response<List<Product>>> allProducts() async {
|
||||||
|
var nextId = 0;
|
||||||
|
return Success(data: <Product>[
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Minimælk",
|
||||||
|
priceInDkkCents: 1200,
|
||||||
|
description: "Konventionel minimælk med fedtprocent på 0,4%"),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Letmælk",
|
||||||
|
priceInDkkCents: 1300,
|
||||||
|
description: "Konventionel letmælk med fedtprocent på 1,5%",
|
||||||
|
location: Coordinate(x: 1800, y: 100)),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Frilands Øko Supermælk",
|
||||||
|
priceInDkkCents: 2000,
|
||||||
|
description:
|
||||||
|
"Økologisk mælk af frilandskøer med fedtprocent på 3,5%. Ikke homogeniseret eller pasteuriseret. Skaber store muskler og styrker knoglerne 💪"),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Øko Gulerødder 1 kg",
|
||||||
|
priceInDkkCents: 1000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Øko Agurk",
|
||||||
|
priceInDkkCents: 1000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Æbler 1 kg",
|
||||||
|
priceInDkkCents: 1000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Basmati Ris",
|
||||||
|
priceInDkkCents: 2000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Haribo Mix",
|
||||||
|
priceInDkkCents: 3000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++, name: "Smør", priceInDkkCents: 3000, description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Harboe Cola",
|
||||||
|
priceInDkkCents: 500,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
barcode: "5060337502900",
|
||||||
|
name: "Monster Energi Drik",
|
||||||
|
priceInDkkCents: 1500,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
barcode: "5712870659220",
|
||||||
|
name: "Amper Energi Drik",
|
||||||
|
priceInDkkCents: 750,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
barcode: "5710326001937",
|
||||||
|
name: "Danskvand Med Brus",
|
||||||
|
priceInDkkCents: 500,
|
||||||
|
description: "Med smag a blåbær"),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Spaghetti",
|
||||||
|
priceInDkkCents: 1000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Rød Cecil",
|
||||||
|
priceInDkkCents: 6000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
name: "Jägermeister 750 ml",
|
||||||
|
priceInDkkCents: 12000,
|
||||||
|
description: ""),
|
||||||
|
Product(
|
||||||
|
id: nextId++,
|
||||||
|
barcode: "5711953068881",
|
||||||
|
name: "Protein Chokoladedrik",
|
||||||
|
priceInDkkCents: 1500,
|
||||||
|
description: "Arla's protein chokolade drik der giver store muskler"),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Response<Null>> register(
|
||||||
|
String name,
|
||||||
|
String email,
|
||||||
|
String password,
|
||||||
|
) async {
|
||||||
|
return Success(data: null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Response<Null>> login(
|
||||||
|
String name,
|
||||||
|
String email,
|
||||||
|
String password,
|
||||||
|
) async {
|
||||||
|
return Success(data: null);
|
||||||
|
}
|
||||||
|
}
|
@ -13,7 +13,7 @@ import 'package:mobile/main.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
// Build our app and trigger a frame.
|
// Build our app and trigger a frame.
|
||||||
await tester.pumpWidget(const MyApp());
|
await tester.pumpWidget(MyApp());
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
// Verify that our counter starts at 0.
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user