Commit 5d53e813 authored by Karunarathna K.M.D.Y.K's avatar Karunarathna K.M.D.Y.K

Merge branch 'IT19975382' into 'master'

It19975382

See merge request !4
parents 069ed7eb fa272058
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:govimithura/models/error_model.dart';
import 'package:govimithura/screens/login.dart';
import 'package:govimithura/utils/loading_overlay.dart';
import 'package:govimithura/utils/utils.dart';
import 'package:provider/provider.dart';
import '../providers/authentication_provider.dart';
import '../utils/screen_size.dart';
import '../widgets/utils/buttons/custom_elevated_button.dart';
import '../widgets/utils/common_widget.dart';
import '../widgets/utils/text_fields/primary_textfield.dart';
class RegisterScreen extends StatefulWidget {
const RegisterScreen({super.key});
@override
State<RegisterScreen> createState() => _RegisterScreenState();
}
class _RegisterScreenState extends State<RegisterScreen> {
late AuthenticationProvider pAuthentication;
GlobalKey<FormState> registerFormKey = GlobalKey<FormState>();
@override
void initState() {
super.initState();
pAuthentication =
Provider.of<AuthenticationProvider>(context, listen: false);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: SizedBox(
height: ScreenSize.height,
width: ScreenSize.width,
child: Form(
key: registerFormKey,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
const LogoText(),
spacingWidget(30, SpaceDirection.vertical),
Text(
'Welcome to Govimithura',
style: Theme.of(context).textTheme.titleLarge,
),
spacingWidget(20, SpaceDirection.vertical),
PrimaryTextField(
hintText: "First name",
validator: (value) {
if (value == null || value.isEmpty) {
return 'Required';
}
return null;
},
onChanged: (value) {
pAuthentication.setFirstName(value.trim());
},
),
spacingWidget(20, SpaceDirection.vertical),
PrimaryTextField(
hintText: "Last name",
validator: (value) {
if (value == null || value.isEmpty) {
return 'Required';
}
return null;
},
onChanged: (value) {
pAuthentication.setLastName(value.trim());
},
),
spacingWidget(20, SpaceDirection.vertical),
PrimaryTextField(
hintText: "Email address",
validator: (value) {
if (value == null || value.isEmpty) {
return 'Required';
} else if (!(value.contains("@") &&
value.contains("."))) {
return 'Enter valid Email Address';
}
return null;
},
onChanged: (value) {
pAuthentication.setEmail(value.trim());
},
),
spacingWidget(20, SpaceDirection.vertical),
PrimaryTextField(
isPassword: true,
hintText: "Password",
validator: (value) {
if (value == null || value.isEmpty) {
return 'Required';
}
return null;
},
onChanged: (value) {
pAuthentication.setPassWord(value.trim());
},
),
spacingWidget(20, SpaceDirection.vertical),
PrimaryTextField(
isPassword: true,
hintText: "Confirm password",
validator: (value) {
if (value == null || value.isEmpty) {
return 'Required';
} else if (value !=
pAuthentication.authModel.password) {
return "Password doesn't match";
}
return null;
},
onChanged: (value) {
pAuthentication.setConfirmPassword(value.trim());
},
),
spacingWidget(30, SpaceDirection.vertical),
CustomElevatedButton(
text: "Register ",
onPressed: () async {
if (registerFormKey.currentState!.validate()) {
LoadingOverlay overlay = LoadingOverlay.of(context);
bool success = await overlay
.during(pAuthentication.register());
if (success) {
if (context.mounted) {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const LoginScreen(),
),
);
}
} else {
if (context.mounted) {
Utils.showSnackBar(
context, ErrorModel.errorMessage);
}
}
}
},
),
spacingWidget(20, SpaceDirection.vertical),
RichText(
text: TextSpan(
text: "Already have an account? ",
style: Theme.of(context).textTheme.bodyLarge,
children: [
TextSpan(
text: "Login",
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(
color: Theme.of(context).primaryColor,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const LoginScreen(),
),
);
},
),
],
),
)
],
),
),
],
),
),
),
),
);
}
}
Main Objective:
...Research problem...
The Main Objective of the research topic is even a person with primary knowledge
or without any knowledge about home gardening can use this mobile application to make home
gardening in effective way to reap the harvest.
Agriculture is one of the major livelihoods in Sri Lanka. People are engaging in cultivation in commercial gardens and also at a smaller level, in home gardens.
Due to the current economic and fuel crisis in Sri Lanka, people have found it difficult to get their daily food needs from stores. because of these reasons again people have turned their attention on home gardening.
Research Problem:
Sri Lankan people have found it difficult to get their home gardening inquiry solutions in their day-to-day life. There is no such application developed for Sri Lankan home gardening to help users. The main research problem is to answer the necessary home gardening inquiries through message commands in the chatbot.
Due to the current economic and fuel crisis, most of the people living in Sri Lanka are now turning to home gardening.
But the main problem here is that people who are used to a modern lifestyle do not have proper knowledge about gardening.
There is no path to take decisions and advice about problems that arise when they start home gardening in their own living places.
Due to these facts, people cannot reap a bountiful harvest from the garden.
...Main Objective...
If we consider these points in more detail, the problem is that many people who turn to home gardening today, have a rudimentary knowledge
of home gardening and lack the proper understanding of home gardening and climate changes and crop growing quarters. Therefore, People who
cultivate various crops have not been able to harvest as much as they expected.
The main objective of this home gardening chatbot is to provide users in the agriculture industry with quick and reliable information on various topics such as crop management, weather conditions, and watering plants, among others. The aim is to improve productivity and sustainability in home gardening.
Another problem faced by people is that people are not able to analyze the disease affecting a particular crop. Once the disease affects
the crop, the growth of some stems of the crop is reduced, but the disease can still attack the crop. So those whole crops or parts are
destroyed and much of their produce is reduced before harvest. Therefore, people don’t have little understanding of what remedies are needed to
prevent the spread of the disease.
...Sub Objectives...
And also, another problem that arises in day-to-day home gardening activities, people face various problems in crop cultivation mainly due to
their rudimentary knowledge about gardening and unable to identify the disease affecting a certain crop, people face various problems in crop
cultivation and also people use different types of fertilizers, herbicides, and insecticides while growing crops. They don’t know how to use
them properly for the crops. Also, due to the fuel crisis in the country, people have not been able to go to the agricultural service centers
to get necessary advice related to home gardening and above mention problems.
1. Provide small details of the home gardening inquiries and improving users' knowledge and skills through educational content.
2. Natural Language Processing model to answer inquires.
3. Develop a pre trained model to identify keywords in the given questions.
4. Then extracted documents from the Wikipedia for the identified keywords.
5. Develop a mobile application and integrate with the developed models.
The other major problem affecting home gardening is considered to be the destruction of crops by animals, so the severity problem is attacks
of wild animals. For example, elephants, peacocks, monkeys, greater coucal, and so on. They cause crop damage. Due to that reason, people will not be
able to expect a harvest from gardening. Due to the lack of a proper remedy for it, the people who are currently engaged in home gardening activities
are hindered from cultivating successfully.
...User Requirements...
Individual research question:
1. How do people cultivate crops harvested as they accepted, according to crop analysis and prediction?
2. How do people recognize the affected crop diseases and get relevant solutions using computer vision?
3. How people find the right solutions to their queries through different languages via chat messaging and voice messaging?
4. How to identify and repel harmful animals that come to the plantation?
1. The user should be able to get accurate and up-to-date information related to agriculture such as crop information, weather conditions, and pest control.
2. The chatbot should be easily accessible and convenient to use.
3. The chatbot should have a user-friendly interface that is easy to navigate and understand.
Individual Objectives:
1. Crop analysis and predictions.
People may have a lack of proper understanding of home gardening and climate changes and crop growing quarters.
Therefore, People who cultivate various crops have not been able to harvest as much as they expected.
Due to that problem the user will be creating their own account while adding the location where the person lives
and the relevant quarter of their own. The location of the user will be stored in the system. After that, according
to the user's above information of predicting the type of crop suitable for cultivation at that time and giving instructions related to cultivation.
2. Crop diseases recognition based on Computer vision.
Select the leaf affected by disease and then collect the leaf from the plant and take a photo of the leaf and upload the leaf image to the system.
Preprocessing the input image to improve image quality and remove unwanted distortions from the image. Through the approach of plant disease identification
using image processing and machine learning is illustrated in Image preprocessing, segmentation, feature extraction, and classification.
And also, we can include several classification algorithms like NB, KNN, DT, SVM, and RF to identify the diagnosis of disease and give solutions and recommendations.
3. Multipurpose Chat Application.
In the study of the research papers on this Chat Applications, it was the latest digital interface developments, for the growth of the web and smartphone apps.
It is well documented for these applications to use automatic conversational agents that operate on software creation or a kind of artificial intelligence (AI)
relationship between users and automated systems. This AI-based multi-purpose chat application helps users to find the right answers to their queries to make the
right decisions. This multi-purpose chat application is made by providing feedback in two different languages and voice activation.
And also users can multilingual both text and voice programmable in this chat application. This system will enable the users to ask any number of inquiries,
which will help to spread the latest Home Gardening technology faster and to a higher number of users.
4. Animal detective camera security system.
Gardening is constantly monitored by a security camera system. This will constantly monitor the inner as well as the outer boundary of the gardening.
Due to this process, if an animal that damages the plantation reaches the outer limit of the plantation or enters the plantation,
this security camera system will identify the animal that has entered the plantation and inform the user of the location of the animal.
Because of this, the gardener does not need to keep an eye on his crops constantly to protect them from harmful animals.
Here, by installing speakers at selected locations around the gardening, the security camera system can identify the relevant animal and
emit sounds necessary to drive away the relevant animal.
(Ex: making a blast sound to drive away animals like peacocks, monkeys, and pigs and making the sound of bees to drive away wild elephants)
This measure will be able to reduce the damage caused to crops, especially by animals like elephants, peacocks, monkeys, cows
...Functional Requirements...
1. The chatbot should be able to provide personalized information to users based on their specific requirements in the questions.
2. The chatbot should use NLP to understand and respond to user queries in a conversational manner.
3. The chatbot should be able to retrieve and access relevant information from the internet related to agriculture.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment