GardenPlanner/test/helpers/plant_generator.dart

77 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:garden_planner/entities/plant.dart';
import 'package:garden_planner/entities/plant_time.dart';
class PlantGenerator {
static getPlant() {
return Plant(
id: 1,
name: 'Tomate',
supType: '',
waterRequirement: 0.8,
horizontalSpace: 0.6,
verticalSpace: 0.8,
imagePath: 'lib/assets/plants/tomatoes-gc17bf34c6_640.jpg',
times: [
PlantTime(
color: Colors.yellow,
description: 'Aussaat',
from: DateTime.parse('2023-04-01T00:00:00.000Z'),
until: DateTime.parse('2023-05-15T00:00:00.000Z'),
action: true,
),
PlantTime(
color: Colors.purple,
description: 'Wachstumsphase',
from: DateTime.parse('2023-05-16T00:00:00.000Z'),
until: DateTime.parse('2023-06-15T00:00:00.000Z'),
action: false,
),
PlantTime(
color: Colors.red,
description: 'Erntezeit',
from: DateTime.parse('2023-06-16T00:00:00.000Z'),
until: DateTime.parse('2023-07-31T00:00:00.000Z'),
action: false,
),
],
);
}
static getPlant2() {
Plant plant = Plant(
id: 2,
name: 'Kopfsalat',
supType: 'Maikönig',
waterRequirement: 0.5,
horizontalSpace: 0.25,
verticalSpace: 0.25,
imagePath: 'lib/assets/plants/salad-seedling-g46a52dd37_640.jpg',
times: [
PlantTime(
color: Colors.yellow,
description: 'Aussaat',
from: DateTime.parse('2023-04-01T00:00:00.000Z'),
until: DateTime.parse('2023-06-01T00:00:00.000Z'),
action: true,
),
PlantTime(
color: Colors.purple,
description: 'Wachstumsphase',
from: DateTime.parse('2023-06-02T00:00:00.000Z'),
until: DateTime.parse('2023-07-15T00:00:00.000Z'),
action: false,
),
PlantTime(
color: Colors.red,
description: 'Erntezeit',
from: DateTime.parse('2023-07-16T00:00:00.000Z'),
until: DateTime.parse('2023-08-31T00:00:00.000Z'),
action: false,
)
]);
return plant;
}
}