1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

[provider_shopper] Added widget tests for login, catalog and cart screens (#400)

This commit is contained in:
Jaideep Prasad
2020-04-28 06:15:50 +05:30
committed by GitHub
parent e6c7aaf8c6
commit ddf610d682
4 changed files with 164 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
/// For simplicity, the catalog is expected to be immutable (no products are
/// expected to be added, removed or changed during the execution of the app).
class CatalogModel {
static const _itemNames = [
static List<String> itemNames = [
'Code Smell',
'Control Flow',
'Interpreter',
@@ -32,8 +32,8 @@ class CatalogModel {
/// Get item by [id].
///
/// In this sample, the catalog is infinite, looping over [_itemNames].
Item getById(int id) => Item(id, _itemNames[id % _itemNames.length]);
/// In this sample, the catalog is infinite, looping over [itemNames].
Item getById(int id) => Item(id, itemNames[id % itemNames.length]);
/// Get item by its position in the catalog.
Item getByPosition(int position) {