Skip to content

Commit

Permalink
plants_shop
Browse files Browse the repository at this point in the history
  • Loading branch information
justkawal committed Aug 29, 2024
1 parent 500128e commit 7b9a217
Show file tree
Hide file tree
Showing 23 changed files with 1,373 additions and 14 deletions.
43 changes: 43 additions & 0 deletions plants_shop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
36 changes: 36 additions & 0 deletions plants_shop/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: android
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: ios
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
- platform: macos
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
Binary file added plants_shop/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plants_shop/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions plants_shop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# plants_shop

A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
32 changes: 32 additions & 0 deletions plants_shop/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer:
errors:
prefer_const_constructors: ignore
prefer_const_literals_to_create_immutables: ignore
use_super_parameters: ignore

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Binary file added plants_shop/assets/plant_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plants_shop/assets/plant_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plants_shop/assets/plant_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plants_shop/assets/plant_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plants_shop/assets/plant_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plants_shop/assets/plant_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plants_shop/assets/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions plants_shop/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import 'package:plants_shop/pages/home_page.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
home: const HomePage(),
);
}
}
62 changes: 62 additions & 0 deletions plants_shop/lib/models/flower_feature_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import 'dart:math';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:plants_shop/utils/colors.dart';

class FlowerFeatureModel {
final String title;
final String value;
final Color iconColor;
final Color iconBackgroundColor;
final Color backgroundColor;
final IconData icon;

const FlowerFeatureModel({
required this.title,
required this.value,
required this.iconColor,
required this.iconBackgroundColor,
this.backgroundColor = Colors.white,
required this.icon,
});

static List<FlowerFeatureModel> features = [
FlowerFeatureModel(
title: 'Room Light',
icon: CupertinoIcons.lightbulb,
value: '${Random.secure().nextInt(40) + 40}%',
iconColor: PlantsColor.greenColor,
iconBackgroundColor: Colors.white,
backgroundColor: Colors.grey.shade200,
),
FlowerFeatureModel(
title: 'Room temp',
icon: Icons.thermostat,
value: '${Random.secure().nextInt(30) + 15}°C',
iconColor: Colors.black,
iconBackgroundColor: PlantsColor.yellowColor,
),
FlowerFeatureModel(
title: 'Height',
icon: Icons.height,
value: '${Random.secure().nextInt(30) + 15} cm',
iconColor: Colors.black,
iconBackgroundColor: PlantsColor.greenColor,
),
FlowerFeatureModel(
title: 'Width',
icon: Icons.height,
value: '${Random.secure().nextInt(30) + 15} cm',
iconColor: Colors.black,
iconBackgroundColor: PlantsColor.lightYellowColor,
),
FlowerFeatureModel(
title: 'Humidity',
icon: Icons.water_damage,
value: '${Random.secure().nextInt(30) + 15}%',
iconColor: Colors.black,
iconBackgroundColor: PlantsColor.blueColor,
),
];
}
54 changes: 54 additions & 0 deletions plants_shop/lib/models/plant_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';

class FlowerModel {
final String name;
final Color color;
final int daysUntilHarvest;
final String assetPath;

const FlowerModel({
required this.name,
required this.color,
required this.daysUntilHarvest,
required this.assetPath,
});

static List<FlowerModel> flowers = [
FlowerModel(
name: 'Rose',
color: Colors.red,
daysUntilHarvest: 30,
assetPath: 'assets/plant_1.png',
),
FlowerModel(
name: 'Sunflower',
color: Colors.yellow,
daysUntilHarvest: 60,
assetPath: 'assets/plant_2.png',
),
FlowerModel(
name: 'Tulip',
color: Colors.pink,
daysUntilHarvest: 45,
assetPath: 'assets/plant_3.png',
),
FlowerModel(
name: 'Daisy',
color: Colors.white,
daysUntilHarvest: 20,
assetPath: 'assets/plant_4.png',
),
FlowerModel(
name: 'Lily',
color: Colors.orange,
daysUntilHarvest: 40,
assetPath: 'assets/plant_5.png',
),
FlowerModel(
name: 'Orchid',
color: Colors.purple,
daysUntilHarvest: 90,
assetPath: 'assets/plant_6.png',
),
];
}
Loading

0 comments on commit 7b9a217

Please sign in to comment.