Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-174
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abdurrahumaan A N
2022-174
Commits
f10acc47
Commit
f10acc47
authored
May 02, 2022
by
nazeerxexagen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
frontend init
parent
bd066a99
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
3375 additions
and
274 deletions
+3375
-274
frontend/.gitignore
frontend/.gitignore
+0
-46
frontend/.metadata
frontend/.metadata
+1
-1
frontend/README.md
frontend/README.md
+1
-1
frontend/android/app/build.gradle
frontend/android/app/build.gradle
+6
-2
frontend/android/app/google-services.json
frontend/android/app/google-services.json
+40
-0
frontend/android/app/src/debug/AndroidManifest.xml
frontend/android/app/src/debug/AndroidManifest.xml
+1
-1
frontend/android/app/src/main/AndroidManifest.xml
frontend/android/app/src/main/AndroidManifest.xml
+2
-2
frontend/android/app/src/main/kotlin/com/aries/pettahmate/MainActivity.kt
.../app/src/main/kotlin/com/aries/pettahmate/MainActivity.kt
+1
-1
frontend/android/app/src/profile/AndroidManifest.xml
frontend/android/app/src/profile/AndroidManifest.xml
+1
-1
frontend/android/build.gradle
frontend/android/build.gradle
+1
-0
frontend/assets/img/banner.png
frontend/assets/img/banner.png
+0
-0
frontend/assets/img/category.png
frontend/assets/img/category.png
+0
-0
frontend/assets/img/logo.png
frontend/assets/img/logo.png
+0
-0
frontend/assets/img/textlogo.png
frontend/assets/img/textlogo.png
+0
-0
frontend/assets/img/user_sample.png
frontend/assets/img/user_sample.png
+0
-0
frontend/ios/Runner.xcodeproj/project.pbxproj
frontend/ios/Runner.xcodeproj/project.pbxproj
+3
-3
frontend/ios/Runner/Info.plist
frontend/ios/Runner/Info.plist
+2
-2
frontend/lib/Controllers/Auth/AuthController.dart
frontend/lib/Controllers/Auth/AuthController.dart
+151
-0
frontend/lib/Controllers/Auth/AuthValidator.dart
frontend/lib/Controllers/Auth/AuthValidator.dart
+57
-0
frontend/lib/Controllers/Category/CategoryController.dart
frontend/lib/Controllers/Category/CategoryController.dart
+18
-0
frontend/lib/Controllers/Common/SplashScreenController.dart
frontend/lib/Controllers/Common/SplashScreenController.dart
+7
-0
frontend/lib/Models/Category.dart
frontend/lib/Models/Category.dart
+5
-0
frontend/lib/Models/Colors.dart
frontend/lib/Models/Colors.dart
+20
-0
frontend/lib/Models/FirebaseStructure.dart
frontend/lib/Models/FirebaseStructure.dart
+5
-0
frontend/lib/Models/Images.dart
frontend/lib/Models/Images.dart
+7
-0
frontend/lib/Models/Strings.dart
frontend/lib/Models/Strings.dart
+11
-0
frontend/lib/Models/User.dart
frontend/lib/Models/User.dart
+5
-0
frontend/lib/Models/Utils.dart
frontend/lib/Models/Utils.dart
+221
-0
frontend/lib/Views/Auth/Login.dart
frontend/lib/Views/Auth/Login.dart
+354
-0
frontend/lib/Views/Auth/RecoverPassword.dart
frontend/lib/Views/Auth/RecoverPassword.dart
+227
-0
frontend/lib/Views/Auth/Register.dart
frontend/lib/Views/Auth/Register.dart
+350
-0
frontend/lib/Views/Category/CategoryManagement.dart
frontend/lib/Views/Category/CategoryManagement.dart
+97
-0
frontend/lib/Views/Category/NewUpdateCategory.dart
frontend/lib/Views/Category/NewUpdateCategory.dart
+112
-0
frontend/lib/Views/Common/ManagementAppBar.dart
frontend/lib/Views/Common/ManagementAppBar.dart
+63
-0
frontend/lib/Views/Common/SplashScreen.dart
frontend/lib/Views/Common/SplashScreen.dart
+110
-0
frontend/lib/Views/Dashboard/Dashboard.dart
frontend/lib/Views/Dashboard/Dashboard.dart
+117
-0
frontend/lib/Views/Home/Drawer.dart
frontend/lib/Views/Home/Drawer.dart
+110
-0
frontend/lib/Views/Home/Home.dart
frontend/lib/Views/Home/Home.dart
+230
-0
frontend/lib/Views/Profile/Profile.dart
frontend/lib/Views/Profile/Profile.dart
+15
-0
frontend/lib/Views/Shop/NewShop.dart
frontend/lib/Views/Shop/NewShop.dart
+17
-0
frontend/lib/Views/Widgets/PopUps/Confirmation.dart
frontend/lib/Views/Widgets/PopUps/Confirmation.dart
+105
-0
frontend/lib/Views/Widgets/PopUps/ImageBrowser.dart
frontend/lib/Views/Widgets/PopUps/ImageBrowser.dart
+79
-0
frontend/lib/Views/Widgets/PopUps/PopUpLoading.dart
frontend/lib/Views/Widgets/PopUps/PopUpLoading.dart
+76
-0
frontend/lib/Views/Widgets/PopUps/showSummery.dart
frontend/lib/Views/Widgets/PopUps/showSummery.dart
+197
-0
frontend/lib/main.dart
frontend/lib/main.dart
+14
-103
frontend/pubspec.lock
frontend/pubspec.lock
+490
-1
frontend/pubspec.yaml
frontend/pubspec.yaml
+29
-67
frontend/test/widget_test.dart
frontend/test/widget_test.dart
+0
-30
frontend/web/index.html
frontend/web/index.html
+2
-2
frontend/web/manifest.json
frontend/web/manifest.json
+2
-2
frontend/windows/CMakeLists.txt
frontend/windows/CMakeLists.txt
+2
-2
frontend/windows/flutter/generated_plugin_registrant.cc
frontend/windows/flutter/generated_plugin_registrant.cc
+3
-0
frontend/windows/flutter/generated_plugins.cmake
frontend/windows/flutter/generated_plugins.cmake
+1
-0
frontend/windows/runner/Runner.rc
frontend/windows/runner/Runner.rc
+6
-6
frontend/windows/runner/main.cpp
frontend/windows/runner/main.cpp
+1
-1
No files found.
frontend/.gitignore
deleted
100644 → 0
View file @
bd066a99
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# 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
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# 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
frontend/.metadata
View file @
f10acc47
...
...
@@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
revision:
db747aa1331bd95bc9b3874c842261ca2d302cd5
revision:
c860cba910319332564e1e9d470a17074c1f2dfd
channel: stable
project_type: app
frontend/README.md
View file @
f10acc47
#
frontend
#
pettahmate
A new Flutter project.
...
...
frontend/android/app/build.gradle
View file @
f10acc47
...
...
@@ -43,8 +43,8 @@ android {
defaultConfig
{
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId
"com.
example.frontend
"
minSdkVersion
flutter
.
minSdkVersion
applicationId
"com.
aries.pettahmate
"
minSdkVersion
23
targetSdkVersion
flutter
.
targetSdkVersion
versionCode
flutterVersionCode
.
toInteger
()
versionName
flutterVersionName
...
...
@@ -63,6 +63,10 @@ flutter {
source
'../..'
}
apply
plugin:
'com.android.application'
apply
plugin:
'com.google.gms.google-services'
dependencies
{
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
platform
(
'com.google.firebase:firebase-bom:29.3.0'
)
}
frontend/android/app/google-services.json
0 → 100644
View file @
f10acc47
{
"project_info"
:
{
"project_number"
:
"16403513664"
,
"firebase_url"
:
"https://pettahmate-default-rtdb.asia-southeast1.firebasedatabase.app"
,
"project_id"
:
"pettahmate"
,
"storage_bucket"
:
"pettahmate.appspot.com"
},
"client"
:
[
{
"client_info"
:
{
"mobilesdk_app_id"
:
"1:16403513664:android:a24c3802af292324cb7aa5"
,
"android_client_info"
:
{
"package_name"
:
"com.aries.pettahmate"
}
},
"oauth_client"
:
[
{
"client_id"
:
"16403513664-3n3dlna0qn7glgjlqii2j2pnkhu8ipq7.apps.googleusercontent.com"
,
"client_type"
:
3
}
],
"api_key"
:
[
{
"current_key"
:
"AIzaSyCyIg7qcA2dtREcvLXXu0pSmM-DyeAgqmg"
}
],
"services"
:
{
"appinvite_service"
:
{
"other_platform_oauth_client"
:
[
{
"client_id"
:
"16403513664-3n3dlna0qn7glgjlqii2j2pnkhu8ipq7.apps.googleusercontent.com"
,
"client_type"
:
3
}
]
}
}
}
],
"configuration_version"
:
"1"
}
\ No newline at end of file
frontend/android/app/src/debug/AndroidManifest.xml
View file @
f10acc47
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.
example.frontend
"
>
package=
"com.
aries.pettahmate
"
>
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
...
...
frontend/android/app/src/main/AndroidManifest.xml
View file @
f10acc47
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.
example.frontend
"
>
package=
"com.
aries.pettahmate
"
>
<application
android:label=
"
frontend
"
android:label=
"
pettahmate
"
android:name=
"${applicationName}"
android:icon=
"@mipmap/ic_launcher"
>
<activity
...
...
frontend/android/app/src/main/kotlin/com/
example/frontend
/MainActivity.kt
→
frontend/android/app/src/main/kotlin/com/
aries/pettahmate
/MainActivity.kt
View file @
f10acc47
package
com.
example.frontend
package
com.
aries.pettahmate
import
io.flutter.embedding.android.FlutterActivity
...
...
frontend/android/app/src/profile/AndroidManifest.xml
View file @
f10acc47
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.
example.frontend
"
>
package=
"com.
aries.pettahmate
"
>
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
...
...
frontend/android/build.gradle
View file @
f10acc47
...
...
@@ -7,6 +7,7 @@ buildscript {
dependencies
{
classpath
'com.android.tools.build:gradle:4.1.0'
classpath
'com.google.gms:google-services:4.3.10'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
...
...
frontend/assets/img/banner.png
0 → 100644
View file @
f10acc47
934 KB
frontend/assets/img/category.png
0 → 100644
View file @
f10acc47
124 KB
frontend/assets/img/logo.png
0 → 100644
View file @
f10acc47
125 KB
frontend/assets/img/textlogo.png
0 → 100644
View file @
f10acc47
84.6 KB
frontend/assets/img/user_sample.png
0 → 100644
View file @
f10acc47
23 KB
frontend/ios/Runner.xcodeproj/project.pbxproj
View file @
f10acc47
...
...
@@ -294,7 +294,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.
example.frontend
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.
aries.pettahmate
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SWIFT_OBJC_BRIDGING_HEADER
=
"Runner/Runner-Bridging-Header.h"
;
SWIFT_VERSION
=
5.0
;
...
...
@@ -422,7 +422,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.
example.frontend
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.
aries.pettahmate
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SWIFT_OBJC_BRIDGING_HEADER
=
"Runner/Runner-Bridging-Header.h"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
...
...
@@ -444,7 +444,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.
example.frontend
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.
aries.pettahmate
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SWIFT_OBJC_BRIDGING_HEADER
=
"Runner/Runner-Bridging-Header.h"
;
SWIFT_VERSION
=
5.0
;
...
...
frontend/ios/Runner/Info.plist
View file @
f10acc47
...
...
@@ -5,7 +5,7 @@
<key>
CFBundleDevelopmentRegion
</key>
<string>
$(DEVELOPMENT_LANGUAGE)
</string>
<key>
CFBundleDisplayName
</key>
<string>
Frontend
</string>
<string>
Pettahmate
</string>
<key>
CFBundleExecutable
</key>
<string>
$(EXECUTABLE_NAME)
</string>
<key>
CFBundleIdentifier
</key>
...
...
@@ -13,7 +13,7 @@
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
frontend
</string>
<string>
pettahmate
</string>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleShortVersionString
</key>
...
...
frontend/lib/Controllers/Auth/AuthController.dart
0 → 100644
View file @
f10acc47
import
'package:firebase_database/firebase_database.dart'
;
import
'package:pettahmate/Models/FirebaseStructure.dart'
;
import
'package:firebase_auth/firebase_auth.dart'
;
import
'package:flutter/material.dart'
;
import
'package:pettahmate/Models/User.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
import
'package:pettahmate/Views/Auth/Login.dart'
;
class
AuthController
{
static
late
FirebaseAuth
_auth
;
late
DatabaseReference
_databaseRef
;
AuthController
()
{
_auth
=
FirebaseAuth
.
instance
;
_databaseRef
=
FirebaseDatabase
.
instance
.
ref
();
}
Future
<
bool
>
checkAuth
()
async
{
if
(
_auth
.
currentUser
==
null
)
{
return
false
;
}
else
{
Utils
.
profileUser
=
await
getUserData
();
return
true
;
}
}
Future
<
dynamic
>
doDoctorRegistration
(
data
)
async
{
var
key
=
null
;
await
_auth
.
createUserWithEmailAndPassword
(
email:
data
[
'email'
],
password:
data
[
'password'
],
)
.
then
((
value
)
async
{
await
_databaseRef
.
child
(
FirebaseStructure
.
USERS
)
.
child
(
value
.
user
!.
uid
)
.
set
({
'name'
:
data
[
'name'
],
'mobile'
:
data
[
'mobile'
],
'type'
:
data
[
'type'
]
});
key
=
value
.
user
!.
uid
;
}).
catchError
((
e
)
{
Utils
.
showToast
(
e
.
toString
());
});
return
key
;
}
Future
<
void
>
doDoctorUpdate
(
userid
,
data
)
async
{
await
_databaseRef
.
child
(
FirebaseStructure
.
USERS
).
child
(
userid
).
set
(
data
);
}
Future
<
bool
>
doRegistration
(
data
)
async
{
bool
check
=
true
;
await
_auth
.
createUserWithEmailAndPassword
(
email:
data
[
'email'
],
password:
data
[
'password'
],
)
.
then
((
value
)
async
{
await
_databaseRef
.
child
(
FirebaseStructure
.
USERS
)
.
child
(
value
.
user
!.
uid
)
.
set
({
'name'
:
data
[
'name'
],
'mobile'
:
data
[
'mobile'
],
'type'
:
data
[
'type'
]
});
Utils
.
showToast
(
'Successfully Registered. Please Login Now.'
);
}).
catchError
((
e
)
{
check
=
false
;
Utils
.
showToast
(
e
.
toString
());
});
return
check
;
}
Future
<
bool
>
doLogin
(
data
)
async
{
bool
check
=
true
;
await
_auth
.
signInWithEmailAndPassword
(
email:
data
[
'email'
],
password:
data
[
'password'
],
)
.
catchError
((
e
)
{
check
=
false
;
late
String
errorMessage
;
switch
(
e
.
code
)
{
case
'invalid-email'
:
case
'user-not-found'
:
case
'wrong-password'
:
errorMessage
=
'Invalid credentails.'
;
break
;
case
'user-disabled'
:
errorMessage
=
'Account has been disabled.'
;
break
;
default
:
errorMessage
=
'Something wrong.'
;
}
Utils
.
showToast
(
errorMessage
);
}).
then
((
value
)
async
{
Utils
.
profileUser
=
await
getUserData
();
});
return
check
;
}
Future
<
void
>
logout
(
context
)
async
{
await
_auth
.
signOut
();
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
Login
()));
}
Future
<
ProfileUser
>
getUserData
()
async
{
late
ProfileUser
user
;
if
(
_auth
.
currentUser
!=
null
)
{
await
_databaseRef
.
child
(
FirebaseStructure
.
USERS
)
.
child
(
_auth
.
currentUser
!.
uid
)
.
once
()
.
then
((
DatabaseEvent
event
)
{
Map
<
dynamic
,
dynamic
>
profileUserData
=
event
.
snapshot
.
value
as
Map
;
if
(
event
.
snapshot
.
value
!=
null
)
{
user
=
ProfileUser
(
name:
profileUserData
[
'name'
],
email:
_auth
.
currentUser
!.
email
,
mobile:
profileUserData
[
'mobile'
],
type:
profileUserData
[
'type'
],
uid:
_auth
.
currentUser
!.
uid
);
}
});
}
return
user
;
}
Future
<
void
>
sendRecoverLink
(
email
)
async
{
await
_auth
.
sendPasswordResetEmail
(
email:
email
);
}
}
frontend/lib/Controllers/Auth/AuthValidator.dart
0 → 100644
View file @
f10acc47
import
'package:email_validator/email_validator.dart'
;
class
AuthValidator
{
static
dynamic
validateUsername
(
String
value
)
{
if
(
value
.
isNotEmpty
)
{
if
(!
EmailValidator
.
validate
(
value
))
{
return
'Please check your username.'
;
}
}
else
{
return
'Please fill username'
;
}
}
static
dynamic
validatePassword
(
String
value
)
{
if
(
value
.
isNotEmpty
)
{
if
(
value
.
length
<
8
)
{
return
'Invalid password (Min : 8 Characters)'
;
}
}
else
{
return
'Please fill password'
;
}
}
static
dynamic
validateName
(
String
value
)
{
if
(
value
.
isNotEmpty
)
{
if
(
value
.
length
<
2
)
{
return
'Invalid name (Min : 2 Characters)'
;
}
}
else
{
return
'Please fill name'
;
}
}
static
dynamic
validateMobile
(
String
value
)
{
if
(
value
.
isNotEmpty
)
{
if
(
value
.
length
!=
10
)
{
return
'Invalid Mobile Number'
;
}
}
else
{
return
'Please fill name'
;
}
}
static
dynamic
validateRetypePassword
(
String
password
,
String
value
)
{
if
(
value
.
isNotEmpty
)
{
if
(
value
.
length
<
8
)
{
return
'Invalid retype password (Min : 8 Characters)'
;
}
else
{
if
(
password
!=
value
)
{
return
'Mismatching passwords, Please recheck'
;
}
}
}
else
{
return
'Please fill same password'
;
}
}
}
frontend/lib/Controllers/Category/CategoryController.dart
0 → 100644
View file @
f10acc47
import
'package:firebase_database/firebase_database.dart'
;
import
'package:pettahmate/Models/Category.dart'
;
import
'package:pettahmate/Models/FirebaseStructure.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
CategoryController
{
static
late
final
DatabaseReference
_databaseRef
=
FirebaseDatabase
.
instance
.
ref
();
Future
<
void
>
saveCategory
(
Category
category
)
async
{
await
_databaseRef
.
child
(
FirebaseStructure
.
USERS
)
.
child
(
Utils
.
profileUser
.
uid
)
.
child
(
FirebaseStructure
.
CATEGORIES
)
.
push
()
.
set
(
category
);
}
}
frontend/lib/Controllers/Common/SplashScreenController.dart
0 → 100644
View file @
f10acc47
import
'package:pettahmate/Controllers/Auth/AuthController.dart'
;
class
SplashScreenController
{
Future
<
bool
>
checkAuth
()
async
{
return
await
AuthController
().
checkAuth
();
}
}
frontend/lib/Models/Category.dart
0 → 100644
View file @
f10acc47
class
Category
{
var
key
,
name
,
mainKey
,
mainName
;
Category
({
this
.
key
,
this
.
mainKey
,
this
.
mainName
,
required
this
.
name
});
}
frontend/lib/Models/Colors.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
class
UtilColors
{
static
Color
primaryColor
=
const
Color
.
fromRGBO
(
241
,
177
,
33
,
1.0
);
static
Color
primaryColorLight
=
const
Color
.
fromRGBO
(
243
,
190
,
67
,
1.0
);
static
Color
secondaryColor
=
const
Color
.
fromRGBO
(
97
,
160
,
64
,
1.0
);
static
Color
secondaryColorLight
=
const
Color
.
fromRGBO
(
108
,
177
,
71
,
1.0
);
static
Color
whiteColor
=
const
Color
.
fromRGBO
(
250
,
250
,
250
,
1.0
);
static
Color
whiteColorLight
=
const
Color
.
fromRGBO
(
255
,
255
,
255
,
1.0
);
static
Color
blackColor
=
const
Color
.
fromRGBO
(
33
,
33
,
33
,
1.0
);
static
Color
greyColor
=
const
Color
.
fromRGBO
(
158
,
158
,
158
,
1.0
);
static
Color
greyColorDark
=
const
Color
.
fromRGBO
(
97
,
97
,
97
,
1.0
);
static
Color
primaryStatusBarColor
=
const
Color
.
fromRGBO
(
0
,
0
,
0
,
1
);
static
Color
redColor
=
const
Color
.
fromRGBO
(
198
,
40
,
40
,
1
);
static
Color
greenColor
=
const
Color
.
fromRGBO
(
76
,
175
,
80
,
1
);
static
Color
blueColor
=
const
Color
.
fromRGBO
(
21
,
101
,
192
,
1
);
static
Color
purpleColor
=
const
Color
.
fromRGBO
(
106
,
27
,
154
,
1
);
static
Color
orangeColor
=
const
Color
.
fromRGBO
(
239
,
108
,
0
,
1
);
static
Color
orangeDarkColor
=
const
Color
.
fromRGBO
(
230
,
81
,
0
,
1
);
}
frontend/lib/Models/FirebaseStructure.dart
0 → 100644
View file @
f10acc47
class
FirebaseStructure
{
static
String
USERS
=
"users"
;
static
String
CATEGORIES
=
"categories"
;
static
String
PRODUCTS
=
"products"
;
}
frontend/lib/Models/Images.dart
0 → 100644
View file @
f10acc47
class
UtilImages
{
static
var
logoPNG
=
'assets/img/logo.png'
;
static
var
textLogoPNG
=
'assets/img/textlogo.png'
;
static
var
userPNG
=
'assets/img/user_sample.png'
;
static
var
bannerPNG
=
'assets/img/banner.png'
;
static
var
categoryManagementPNG
=
'assets/img/category.png'
;
}
frontend/lib/Models/Strings.dart
0 → 100644
View file @
f10acc47
class
UtilStrings
{
static
var
splashScreen
=
'Powered By ARIES (Pvt) Ltd.'
;
static
var
appTitle
=
'Pettah Mate'
;
static
var
appTitleSection1
=
'Pettah'
;
static
var
appTitleSection2
=
'Mate'
;
static
var
appSubtitle
=
'Tag tracking AI based application'
;
static
var
loginSubTitle
=
'Unlock your access with existing account'
;
static
var
registrationTitle
=
'Registration'
;
static
var
registrationSubTitle
=
'Create your free account'
;
static
var
forgetPasswordSubTitle
=
'Recover your account password'
;
}
frontend/lib/Models/User.dart
0 → 100644
View file @
f10acc47
class
ProfileUser
{
var
uid
,
name
,
mobile
,
email
,
type
;
ProfileUser
({
this
.
uid
,
this
.
name
,
this
.
mobile
,
this
.
email
,
this
.
type
});
}
frontend/lib/Models/Utils.dart
0 → 100644
View file @
f10acc47
import
'package:auto_size_text/auto_size_text.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/User.dart'
;
import
'package:pettahmate/Views/Widgets/PopUps/Confirmation.dart'
;
import
'package:pettahmate/Views/Widgets/PopUps/PopUpLoading.dart'
;
import
'package:pettahmate/Views/Widgets/PopUps/showSummery.dart'
;
class
Utils
{
//Fonts Start
static
double
smallFonts
=
10.0
;
static
double
xlFonts
=
30.0
;
//Fonts End
static
String
googleMapsKey
=
'AIzaSyD8HZ9Is3SwaYwv9WiTvWZIKwVH15M8Dbw'
;
static
late
Size
displaySize
;
static
late
ProfileUser
profileUser
;
static
var
loadingMessage
;
static
double
carbsValue
=
0.0
;
static
double
fatValue
=
0.0
;
static
Map
<
String
,
dynamic
>
dataMap
=
{};
static
var
imageResponse
;
static
var
lightNavbar
=
SystemUiOverlayStyle
.
light
.
copyWith
(
statusBarBrightness:
Brightness
.
light
,
systemNavigationBarColor:
UtilColors
.
blackColor
,
statusBarColor:
UtilColors
.
primaryStatusBarColor
);
static
var
darkNavbar
=
SystemUiOverlayStyle
.
dark
.
copyWith
(
statusBarBrightness:
Brightness
.
light
,
systemNavigationBarColor:
UtilColors
.
blackColor
,
statusBarColor:
UtilColors
.
primaryStatusBarColor
);
//TextStyles
static
TextStyle
getprimaryStyle
(
Color
color
)
{
return
GoogleFonts
.
openSans
(
color:
color
);
}
static
TextStyle
getprimaryStyleSmall
(
Color
color
)
{
return
GoogleFonts
.
openSans
(
color:
color
,
fontSize:
13.0
);
}
static
TextStyle
getprimaryBoldStyle
(
Color
color
)
{
return
GoogleFonts
.
openSans
(
color:
color
,
fontWeight:
FontWeight
.
bold
);
}
static
TextStyle
getprimaryFieldTextStyle
(
Color
color
)
{
return
GoogleFonts
.
openSans
(
color:
UtilColors
.
blackColor
,
fontSize:
13.0
);
}
static
TextStyle
getprimaryFieldTextStyle2
(
Color
color
)
{
return
GoogleFonts
.
openSans
(
color:
color
,
fontSize:
13.0
);
}
static
TextStyle
getprimaryFieldTextStylePopUp
(
Color
color
)
{
return
GoogleFonts
.
openSans
(
color:
UtilColors
.
primaryColor
,
fontSize:
13.0
);
}
//TextFormField Styles
static
double
borderRadius
=
5.0
;
static
double
buttonBorderRadius
=
5.0
;
static
InputDecoration
getDefaultTextInputDecoration
(
String
label
,
suffixIcon
)
{
return
InputDecoration
(
labelText:
label
,
errorStyle:
const
TextStyle
(
fontSize:
11
,
color:
Colors
.
red
),
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
12.0
,
vertical:
10.0
),
labelStyle:
TextStyle
(
fontSize:
12.0
,
color:
UtilColors
.
greyColor
),
suffixIcon:
suffixIcon
,
fillColor:
Colors
.
white
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius
),
borderSide:
const
BorderSide
(),
),
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius
),
borderSide:
BorderSide
(
color:
UtilColors
.
primaryColorLight
,
width:
1
),
),
focusedBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius
),
borderSide:
BorderSide
(
color:
UtilColors
.
primaryColor
,
width:
1
),
));
}
static
InputDecoration
getDefaultDropDownInputDecoration
(
String
label
)
{
return
InputDecoration
(
labelText:
label
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10.0
,
vertical:
10.0
),
errorStyle:
const
TextStyle
(
fontSize:
11
,
color:
Colors
.
red
),
labelStyle:
TextStyle
(
fontSize:
13.0
,
color:
UtilColors
.
greyColor
),
fillColor:
Colors
.
white
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius
),
borderSide:
const
BorderSide
(),
),
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius
),
borderSide:
BorderSide
(
color:
UtilColors
.
primaryColor
,
width:
1
),
),
focusedBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius
),
borderSide:
BorderSide
(
color:
UtilColors
.
primaryColor
,
width:
1
),
));
}
//Loading Widgets
static
bool
checkShowLoader
=
false
;
static
late
BuildContext
parentLoadingContext
;
static
Widget
getListLoader
()
{
return
Wrap
(
children:
const
[
Padding
(
padding:
EdgeInsets
.
only
(
top:
50.0
),
child:
CircularProgressIndicator
(),
)
],
);
}
static
Future
showLoader
(
context
)
async
{
await
showDialog
(
context:
context
,
builder:
(
_
)
=>
PopUpLoading
(),
).
then
((
onValue
)
{
parentLoadingContext
=
context
;
checkShowLoader
=
true
;
});
}
static
Future
showConfirmation
(
context
,
okFunction
,
noFunction
)
async
{
await
showDialog
(
context:
context
,
builder:
(
_
)
=>
Confirmation
(
okFunction:
okFunction
,
noFunction:
noFunction
),
).
then
((
onValue
)
{
parentLoadingContext
=
context
;
checkShowLoader
=
true
;
});
}
static
Future
<
void
>
doCalculation
(
context
)
async
{
await
showDialog
(
context:
context
,
builder:
(
_
)
=>
showSummery
(),
).
then
((
onValue
)
{
parentLoadingContext
=
context
;
checkShowLoader
=
true
;
});
}
static
Future
showLoaderWithCustomMessage
(
context
,
message
)
async
{
Utils
.
loadingMessage
=
message
;
await
showDialog
(
context:
context
,
builder:
(
_
)
=>
PopUpLoading
(),
).
then
((
onValue
)
{
parentLoadingContext
=
context
;
checkShowLoader
=
true
;
});
}
static
Future
hideLoader
()
async
{
if
(
checkShowLoader
==
true
&&
parentLoadingContext
!=
null
)
{
Navigator
.
pop
(
parentLoadingContext
);
checkShowLoader
=
false
;
Utils
.
loadingMessage
=
null
;
}
}
static
Future
hideLoaderCurrrent
(
context
)
async
{
Navigator
.
pop
(
context
);
checkShowLoader
=
false
;
}
//Toast Contents
static
showToast
(
String
message
)
{
Fluttertoast
.
showToast
(
msg:
message
,
toastLength:
Toast
.
LENGTH_SHORT
,
gravity:
ToastGravity
.
BOTTOM
,
timeInSecForIosWeb:
1
,
backgroundColor:
Colors
.
black
,
textColor:
Colors
.
white
,
fontSize:
14.0
);
}
static
getGradientBackground
()
{
return
BoxDecoration
(
gradient:
LinearGradient
(
begin:
Alignment
.
topRight
,
tileMode:
TileMode
.
decal
,
end:
Alignment
.
bottomLeft
,
colors:
[
UtilColors
.
primaryColor
,
UtilColors
.
secondaryColor
,
],
));
}
static
getTextGradient
()
{
return
LinearGradient
(
colors:
<
Color
>[
UtilColors
.
primaryColor
,
UtilColors
.
secondaryColor
],
).
createShader
(
Rect
.
fromLTWH
(
0.0
,
0.0
,
200.0
,
70.0
));
}
}
frontend/lib/Views/Auth/Login.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/services.dart'
;
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Controllers/Auth/AuthController.dart'
;
import
'package:pettahmate/Controllers/Auth/AuthValidator.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Images.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
import
'package:pettahmate/Views/Auth/RecoverPassword.dart'
;
import
'package:pettahmate/Views/Auth/Register.dart'
;
import
'package:pettahmate/Views/Dashboard/Dashboard.dart'
;
import
'package:pettahmate/Views/Home/Home.dart'
;
class
Login
extends
StatefulWidget
{
Login
({
Key
?
key
})
:
super
(
key:
key
);
@override
_LoginState
createState
()
=>
_LoginState
();
}
class
_LoginState
extends
State
<
Login
>
{
final
TextEditingController
_email
=
TextEditingController
();
final
TextEditingController
_password
=
TextEditingController
();
final
_loginFormKey
=
GlobalKey
<
FormState
>();
bool
_rememberMe
=
false
;
bool
_obscurePassword
=
true
;
late
AuthController
_authController
;
@override
void
initState
()
{
super
.
initState
();
SystemChrome
.
setSystemUIOverlayStyle
(
Utils
.
lightNavbar
);
SystemChrome
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
,
DeviceOrientation
.
portraitDown
,
]);
}
@override
Widget
build
(
BuildContext
context
)
{
double
spaceAround
=
10.0
;
double
fieldspaces
=
15.0
;
double
fieldspacesmid
=
20.0
;
double
fontsize
=
12
;
_authController
=
AuthController
();
return
SafeArea
(
child:
Scaffold
(
backgroundColor:
UtilColors
.
whiteColor
,
body:
Container
(
alignment:
Alignment
.
center
,
child:
SingleChildScrollView
(
child:
Stack
(
children:
[
Positioned
(
top:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
left:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
,
height:
Utils
.
displaySize
.
width
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
Positioned
(
bottom:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
right:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
*
0.9
,
height:
Utils
.
displaySize
.
width
*
0.9
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
SizedBox
(
width:
Utils
.
displaySize
.
width
,
height:
Utils
.
displaySize
.
height
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Visibility
(
visible:
(
Utils
.
displaySize
.
height
<
1000
)
?
false
:
true
,
child:
Container
(
padding:
EdgeInsets
.
only
(
bottom:
spaceAround
),
width:
Utils
.
displaySize
.
width
*
0.35
,
child:
SizedBox
(
child:
Image
.
asset
(
UtilImages
.
logoPNG
),
),
)),
Visibility
(
visible:
(
Utils
.
displaySize
.
height
>
1000
)
?
false
:
true
,
child:
Container
(
padding:
EdgeInsets
.
only
(
bottom:
spaceAround
),
width:
Utils
.
displaySize
.
width
*
0.35
,
child:
SizedBox
(
child:
Image
.
asset
(
UtilImages
.
logoPNG
),
),
)),
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
spaceAround
,
vertical:
spaceAround
),
child:
Card
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
15.0
),
child:
Form
(
key:
_loginFormKey
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
fieldspaces
,
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
UtilStrings
.
appTitleSection1
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
23.0
,
color:
UtilColors
.
primaryColor
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
5.0
),
child:
Text
(
UtilStrings
.
appTitleSection2
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
23.0
,
color:
UtilColors
.
secondaryColor
)),
)
],
),
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
5.0
,
bottom:
10.0
),
child:
Text
(
UtilStrings
.
loginSubTitle
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
11.0
,
fontWeight:
FontWeight
.
w600
,
foreground:
Paint
()
..
shader
=
Utils
.
getTextGradient
()),
),
),
),
const
Divider
(),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_email
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Email'
,
Icon
(
Icons
.
email
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
),
)),
cursorColor:
UtilColors
.
primaryColor
,
keyboardType:
TextInputType
.
emailAddress
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
greyColor
),
validator:
(
value
)
{
return
AuthValidator
.
validateUsername
(
value
!);
},
),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_password
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Password'
,
Icon
(
Icons
.
lock
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
))),
cursorColor:
UtilColors
.
primaryColor
,
obscureText:
_obscurePassword
,
keyboardType:
TextInputType
.
emailAddress
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
blackColor
),
validator:
(
value
)
{
return
AuthValidator
.
validatePassword
(
value
!);
},
onChanged:
(
value
)
{
setState
(()
{
_obscurePassword
=
true
;
});
},
),
SizedBox
(
height:
fieldspaces
,
),
Row
(
children:
[
SizedBox
(
height:
24.0
,
width:
24.0
,
child:
Checkbox
(
value:
_rememberMe
,
onChanged:
(
val
)
{
setState
(()
{
this
.
_rememberMe
=
val
!;
});
},
activeColor:
UtilColors
.
primaryColor
,
focusColor:
Colors
.
red
,
checkColor:
UtilColors
.
whiteColor
,
hoverColor:
Colors
.
red
,
tristate:
false
,
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
10.0
),
child:
GestureDetector
(
onTap:
()
{
setState
(()
{
_rememberMe
=
!
this
.
_rememberMe
;
});
},
child:
Text
(
'Remember my credentials'
,
style:
TextStyle
(
fontSize:
fontsize
),
),
),
)
],
),
SizedBox
(
height:
fieldspaces
,
),
Row
(
children:
[
SizedBox
(
child:
TextButton
(
child:
Text
(
"LET'S START"
,
style:
GoogleFonts
.
openSans
(),
),
style:
ButtonStyle
(
foregroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
whiteColor
),
backgroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
primaryColor
),
),
onPressed:
()
async
{
if
(
_loginFormKey
.
currentState
!
.
validate
())
{
FocusScope
.
of
(
context
).
unfocus
();
Utils
.
showLoader
(
context
);
try
{
await
_authController
.
doLogin
({
'email'
:
_email
.
text
,
'password'
:
_password
.
text
}).
then
((
value
)
{
if
(
value
==
true
)
{
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
Dashboard
()));
}
});
}
catch
(
e
)
{
Utils
.
hideLoaderCurrrent
(
context
);
}
}
},
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
10.0
),
child:
GestureDetector
(
onTap:
()
=>
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
const
RecoverPassword
())),
child:
const
Text
(
'Recover Forget Password'
,
style:
TextStyle
(
fontSize:
12.0
),
),
),
)
],
),
SizedBox
(
height:
fieldspaces
,
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
GestureDetector
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
Register
()));
},
child:
Text
(
'No account yet, register today !'
,
style:
TextStyle
(
fontSize:
fontsize
),
),
),
),
SizedBox
(
height:
fieldspaces
,
),
],
)),
),
),
),
],
),
)
],
),
),
),
));
}
}
frontend/lib/Views/Auth/RecoverPassword.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/services.dart'
;
import
'package:flutter/material.dart'
;
import
'package:pettahmate/Controllers/Auth/AuthController.dart'
;
import
'package:pettahmate/Controllers/Auth/AuthValidator.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
RecoverPassword
extends
StatefulWidget
{
const
RecoverPassword
({
Key
?
key
})
:
super
(
key:
key
);
@override
_RecoverPasswordState
createState
()
=>
_RecoverPasswordState
();
}
class
_RecoverPasswordState
extends
State
<
RecoverPassword
>
{
TextEditingController
_email
=
TextEditingController
();
final
_formKey
=
GlobalKey
<
FormState
>();
late
AuthController
_authController
;
@override
void
initState
()
{
super
.
initState
();
SystemChrome
.
setSystemUIOverlayStyle
(
Utils
.
lightNavbar
);
SystemChrome
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
,
DeviceOrientation
.
portraitDown
,
]);
}
@override
Widget
build
(
BuildContext
context
)
{
double
spaceAround
=
10.0
;
double
fieldspaces
=
15.0
;
double
fieldspacesmid
=
20.0
;
_authController
=
AuthController
();
return
SafeArea
(
child:
Scaffold
(
backgroundColor:
UtilColors
.
whiteColor
,
body:
Container
(
alignment:
Alignment
.
center
,
child:
SingleChildScrollView
(
child:
Container
(
child:
Stack
(
children:
[
Positioned
(
top:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
left:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
,
height:
Utils
.
displaySize
.
width
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
Positioned
(
bottom:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
right:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
*
0.9
,
height:
Utils
.
displaySize
.
width
*
0.9
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
Container
(
width:
Utils
.
displaySize
.
width
,
height:
Utils
.
displaySize
.
height
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
spaceAround
,
vertical:
spaceAround
),
child:
Card
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
15.0
),
child:
Form
(
key:
_formKey
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
fieldspaces
,
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
UtilStrings
.
appTitleSection1
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
23.0
,
color:
UtilColors
.
primaryColor
)),
Padding
(
padding:
EdgeInsets
.
only
(
left:
5.0
),
child:
Text
(
UtilStrings
.
appTitleSection2
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
23.0
,
color:
UtilColors
.
secondaryColor
)),
)
],
),
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
Padding
(
padding:
EdgeInsets
.
only
(
top:
5.0
,
bottom:
10.0
),
child:
Text
(
UtilStrings
.
forgetPasswordSubTitle
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
11.0
,
fontWeight:
FontWeight
.
w600
,
foreground:
Paint
()
..
shader
=
Utils
.
getTextGradient
()),
),
),
),
Divider
(),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_email
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Your Email'
,
Icon
(
Icons
.
email
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
),
)),
cursorColor:
UtilColors
.
primaryColor
,
keyboardType:
TextInputType
.
emailAddress
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
greyColor
),
validator:
(
value
)
{
return
AuthValidator
.
validateUsername
(
value
!);
},
),
SizedBox
(
height:
fieldspaces
,
),
SizedBox
(
child:
TextButton
(
onPressed:
()
async
{
if
(
_formKey
.
currentState
!
.
validate
())
{
_authController
.
sendRecoverLink
(
_email
.
text
);
}
},
style:
TextButton
.
styleFrom
(
backgroundColor:
UtilColors
.
whiteColorLight
,
side:
BorderSide
(
color:
UtilColors
.
primaryColor
,
width:
1
),
shape:
const
BeveledRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
5
))),
primary:
UtilColors
.
primaryColorLight
),
child:
Text
(
"SEND RECOVER EMAIL."
,
style:
TextStyle
(
color:
UtilColors
.
primaryColor
),
)),
width:
Utils
.
displaySize
.
width
,
),
SizedBox
(
height:
fieldspaces
,
),
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
const
Text
(
"Back to login"
,
style:
TextStyle
(
fontSize:
12.0
),
),
),
SizedBox
(
height:
fieldspaces
,
),
],
)),
),
),
),
],
),
)
],
),
),
),
),
));
}
}
frontend/lib/Views/Auth/Register.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/services.dart'
;
import
'package:flutter/material.dart'
;
import
'package:pettahmate/Controllers/Auth/AuthController.dart'
;
import
'package:pettahmate/Controllers/Auth/AuthValidator.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
Register
extends
StatefulWidget
{
const
Register
({
Key
?
key
})
:
super
(
key:
key
);
@override
_RegisterState
createState
()
=>
_RegisterState
();
}
class
_RegisterState
extends
State
<
Register
>
{
final
TextEditingController
_name
=
TextEditingController
();
final
TextEditingController
_mobile
=
TextEditingController
();
final
TextEditingController
_email
=
TextEditingController
();
final
TextEditingController
_password
=
TextEditingController
();
final
TextEditingController
_repassword
=
TextEditingController
();
final
_registerFormKey
=
GlobalKey
<
FormState
>();
bool
_obscurePassword1
=
true
;
bool
_obscurePassword2
=
true
;
double
fieldspacesmid
=
(
Utils
.
displaySize
.
height
<
1000
)
?
10
:
20
;
final
AuthController
_authController
=
AuthController
();
@override
void
initState
()
{
super
.
initState
();
SystemChrome
.
setSystemUIOverlayStyle
(
Utils
.
lightNavbar
);
SystemChrome
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
,
DeviceOrientation
.
portraitDown
,
]);
}
@override
Widget
build
(
BuildContext
context
)
{
double
spaceAround
=
10.0
;
double
fieldspaces
=
15.0
;
double
fieldspacesmax
=
30.0
;
double
fontsize
=
12
;
// final AuthController authController = AuthController();
return
SafeArea
(
child:
Scaffold
(
backgroundColor:
UtilColors
.
whiteColor
,
body:
Container
(
alignment:
Alignment
.
center
,
child:
SingleChildScrollView
(
child:
SizedBox
(
child:
Stack
(
children:
[
Positioned
(
top:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
left:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
,
height:
Utils
.
displaySize
.
width
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
Positioned
(
bottom:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
right:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
*
0.9
,
height:
Utils
.
displaySize
.
width
*
0.9
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
SizedBox
(
width:
Utils
.
displaySize
.
width
,
height:
Utils
.
displaySize
.
height
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
spaceAround
,
vertical:
spaceAround
),
child:
Card
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
15.0
),
child:
Form
(
key:
_registerFormKey
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
fieldspaces
,
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
UtilStrings
.
appTitleSection1
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
23.0
,
color:
UtilColors
.
primaryColor
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
5.0
),
child:
Text
(
UtilStrings
.
appTitleSection2
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
23.0
,
color:
UtilColors
.
secondaryColor
)),
)
],
),
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
5.0
,
bottom:
10.0
),
child:
Text
(
UtilStrings
.
registrationSubTitle
.
toUpperCase
(),
style:
TextStyle
(
fontSize:
11.0
,
fontWeight:
FontWeight
.
w600
,
foreground:
Paint
()
..
shader
=
Utils
.
getTextGradient
()),
),
),
),
Divider
(),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_name
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Name'
,
Icon
(
Icons
.
person
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
),
)),
cursorColor:
UtilColors
.
primaryColor
,
keyboardType:
TextInputType
.
name
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
greyColor
),
validator:
(
value
)
{
return
AuthValidator
.
validateName
(
value
!);
},
),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_mobile
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Mobile Number'
,
Icon
(
Icons
.
send_to_mobile
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
),
)),
cursorColor:
UtilColors
.
primaryColor
,
keyboardType:
TextInputType
.
number
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
greyColor
),
validator:
(
value
)
{
return
AuthValidator
.
validateMobile
(
value
!);
},
),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_email
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Email'
,
Icon
(
Icons
.
email
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
),
)),
cursorColor:
UtilColors
.
primaryColor
,
keyboardType:
TextInputType
.
emailAddress
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
greyColor
),
validator:
(
value
)
{
return
AuthValidator
.
validateUsername
(
value
!);
},
),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_password
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Password'
,
Icon
(
Icons
.
lock
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
))),
cursorColor:
UtilColors
.
primaryColor
,
obscureText:
_obscurePassword1
,
keyboardType:
TextInputType
.
text
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
blackColor
),
validator:
(
value
)
{
return
AuthValidator
.
validatePassword
(
value
!);
},
onChanged:
(
value
)
{
setState
(()
{
_obscurePassword1
=
true
;
});
},
),
SizedBox
(
height:
fieldspacesmid
,
),
TextFormField
(
controller:
_repassword
,
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Retype Password'
,
Icon
(
Icons
.
lock
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
))),
cursorColor:
UtilColors
.
primaryColor
,
obscureText:
_obscurePassword2
,
keyboardType:
TextInputType
.
text
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
blackColor
),
validator:
(
value
)
{
return
AuthValidator
.
validateRetypePassword
(
_password
.
text
,
value
!);
},
onChanged:
(
value
)
{
setState
(()
{
_obscurePassword2
=
true
;
});
},
),
SizedBox
(
height:
fieldspaces
,
),
SizedBox
(
child:
FlatButton
(
onPressed:
()
async
{
if
(
_registerFormKey
.
currentState
!
.
validate
())
{
FocusScope
.
of
(
context
).
unfocus
();
Utils
.
showLoader
(
context
);
await
_authController
.
doRegistration
({
'name'
:
_name
.
text
.
toString
(),
'mobile'
:
_mobile
.
text
.
toString
(),
'email'
:
_email
.
text
.
toString
(),
'type'
:
2
,
'password'
:
_password
.
text
.
toString
(),
}).
then
((
value
)
=>
Utils
.
hideLoaderCurrrent
(
context
));
_registerFormKey
.
currentState
!
.
reset
();
_name
.
text
=
''
;
_mobile
.
text
=
''
;
_email
.
text
=
''
;
_password
.
text
=
''
;
_repassword
.
text
=
''
;
}
},
child:
const
Text
(
"REGISTER NOW"
,
),
color:
UtilColors
.
primaryColor
,
textColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
Utils
.
buttonBorderRadius
),
side:
BorderSide
(
color:
UtilColors
.
primaryColorLight
)),
height:
42.0
,
),
width:
Utils
.
displaySize
.
width
,
),
SizedBox
(
height:
fieldspacesmax
,
),
Align
(
alignment:
Alignment
.
topCenter
,
child:
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
Text
(
'Already have an account, Login now !'
,
style:
TextStyle
(
fontSize:
fontsize
),
),
),
),
SizedBox
(
height:
fieldspaces
,
),
],
)),
),
),
),
],
),
)
],
),
),
),
),
));
}
}
frontend/lib/Views/Category/CategoryManagement.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Images.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
import
'package:pettahmate/Views/Category/NewUpdateCategory.dart'
;
import
'package:pettahmate/Views/Common/ManagementAppBar.dart'
;
class
CategoryManagement
extends
StatefulWidget
{
CategoryManagement
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
CategoryManagement
>
createState
()
=>
_CategoryManagementState
();
}
class
_CategoryManagementState
extends
State
<
CategoryManagement
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
SafeArea
(
child:
Scaffold
(
body:
Column
(
children:
[
ManagementAppBar
(
title:
"Categories"
,
tailingIcons:
[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
15.0
,
horizontal:
20.0
),
child:
GestureDetector
(
onTap:
()
{
showModalBottomSheet
<
void
>(
context:
context
,
builder:
(
BuildContext
context
)
{
return
NewUpdateCategory
();
});
},
child:
const
Icon
(
Icons
.
add_box
)),
)
]),
Expanded
(
child:
Center
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
5.0
,
horizontal:
5.0
),
child:
ListView
(
children:
[
Card
(
child:
ListTile
(
leading:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Icon
(
Icons
.
category
,
color:
UtilColors
.
primaryColor
,
)
],
),
title:
Text
(
"Mobile Phones"
,
style:
GoogleFonts
.
openSans
(
fontSize:
14.0
,
fontWeight:
FontWeight
.
w600
),
),
subtitle:
Text
(
"Electronics"
,
style:
GoogleFonts
.
openSans
(
fontSize:
12.0
,
fontWeight:
FontWeight
.
w600
,
color:
UtilColors
.
greyColor
),
),
trailing:
Wrap
(
direction:
Axis
.
horizontal
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
10.0
),
child:
Icon
(
Icons
.
edit
,
color:
UtilColors
.
orangeColor
,
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
10.0
),
child:
Icon
(
Icons
.
delete
,
color:
UtilColors
.
redColor
,
),
),
],
),
),
)
],
),
),
))
],
),
));
}
}
frontend/lib/Views/Category/NewUpdateCategory.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Category.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Images.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
NewUpdateCategory
extends
StatefulWidget
{
NewUpdateCategory
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
NewUpdateCategory
>
createState
()
=>
_NewUpdateCategoryState
();
}
class
_NewUpdateCategoryState
extends
State
<
NewUpdateCategory
>
{
var
_formKey
=
GlobalKey
<
FormState
>();
var
categoryList
=
[
Category
(
name:
"- Select -"
,
key:
"none"
),
Category
(
name:
"Mobile Phones"
,
key:
"1"
),
Category
(
name:
"Electronics"
,
key:
"2"
)];
String
?
category
;
@override
void
initState
()
{
setState
(()
{
category
=
(
categoryList
.
isNotEmpty
)
?
categoryList
.
first
.
key
:
null
;
});
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10.0
,
vertical:
20.0
),
child:
Form
(
key:
_formKey
,
child:
Wrap
(
spacing:
1.0
,
children:
[
Text
(
"New Category"
,
style:
GoogleFonts
.
openSans
(
fontSize:
15.0
)),
const
SizedBox
(
height:
40.0
,
),
TextFormField
(
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Category / Sub Category'
,
Icon
(
Icons
.
category
,
color:
UtilColors
.
greyColor
.
withOpacity
(
0.6
))),
cursorColor:
UtilColors
.
primaryColor
,
keyboardType:
TextInputType
.
emailAddress
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
blackColor
),
validator:
(
value
)
{
if
(
value
!.
isEmpty
)
{
return
"Please enter category or sub category name"
;
}
},
),
const
SizedBox
(
height:
20.0
,
),
SizedBox
(
height:
50.0
,
child:
InputDecorator
(
decoration:
Utils
.
getDefaultDropDownInputDecoration
(
'Main Category'
),
child:
DropdownButtonHideUnderline
(
child:
DropdownButton
<
String
>(
value:
category
,
onChanged:
(
String
?
newValue
)
{
setState
(()
{
category
=
newValue
!;
});
},
items:
categoryList
.
map
<
DropdownMenuItem
<
String
>>((
Category
value
)
{
return
DropdownMenuItem
<
String
>(
value:
value
.
key
,
child:
Text
(
value
.
name
,
style:
TextStyle
(
color:
(
value
.
key
==
"none"
)?
UtilColors
.
greyColor
:
UtilColors
.
blackColor
,
fontSize:
13
),
),
);
}).
toList
(),
),
),
),
),
const
SizedBox
(
height:
20.0
,
),
SizedBox
(
width:
double
.
infinity
,
height:
50.0
,
child:
TextButton
(
child:
Text
(
"Save"
,
style:
GoogleFonts
.
openSans
(),
),
style:
ButtonStyle
(
foregroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
whiteColor
),
backgroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
greenColor
),
),
onPressed:
()
async
{
if
(
_formKey
.
currentState
!.
validate
())
{
}
},
),
)
],
)),
);
}
}
frontend/lib/Views/Common/ManagementAppBar.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
ManagementAppBar
extends
StatefulWidget
{
String
title
;
List
<
Widget
>
tailingIcons
;
ManagementAppBar
({
Key
?
key
,
required
this
.
title
,
required
this
.
tailingIcons
})
:
super
(
key:
key
);
@override
State
<
ManagementAppBar
>
createState
()
=>
_ManagementAppBarState
(
title:
this
.
title
,
tailingIcons:
this
.
tailingIcons
);
}
class
_ManagementAppBarState
extends
State
<
ManagementAppBar
>
{
String
title
;
List
<
Widget
>
tailingIcons
;
_ManagementAppBarState
({
required
this
.
title
,
required
this
.
tailingIcons
});
@override
Widget
build
(
BuildContext
context
)
{
return
Expanded
(
flex:
0
,
child:
Container
(
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
const
BorderRadius
.
only
(
bottomRight:
Radius
.
circular
(
20.0
),
bottomLeft:
Radius
.
circular
(
20.0
))),
width:
Utils
.
displaySize
.
width
,
child:
Stack
(
alignment:
Alignment
.
center
,
children:
[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
15.0
,
horizontal:
20.0
),
child:
GestureDetector
(
onTap:
()
=>
Navigator
.
pop
(
context
),
child:
const
Icon
(
Icons
.
arrow_back_ios
)),
)),
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
title
),
),
Align
(
alignment:
Alignment
.
topRight
,
child:
Visibility
(
visible:
(
tailingIcons
.
isNotEmpty
)
?
true
:
false
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
tailingIcons
,
)),
)
],
)),
);
}
}
frontend/lib/Views/Common/SplashScreen.dart
0 → 100644
View file @
f10acc47
import
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Controllers/Common/SplashScreenController.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Images.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
import
'package:pettahmate/Views/Auth/Login.dart'
;
import
'package:pettahmate/Views/Dashboard/Dashboard.dart'
;
import
'package:pettahmate/Views/Home/Home.dart'
;
class
SplashScreen
extends
StatefulWidget
{
const
SplashScreen
({
Key
?
key
})
:
super
(
key:
key
);
@override
_SplashScreenState
createState
()
=>
_SplashScreenState
();
}
class
_SplashScreenState
extends
State
<
SplashScreen
>
{
late
Timer
_timer
;
@override
void
initState
()
{
super
.
initState
();
startApp
();
}
@override
void
dispose
()
{
_timer
.
cancel
();
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
Utils
.
displaySize
=
MediaQuery
.
of
(
context
).
size
;
return
SafeArea
(
child:
Scaffold
(
body:
Container
(
color:
UtilColors
.
whiteColor
,
child:
Stack
(
children:
[
Positioned
(
top:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
left:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
*
0.8
,
height:
Utils
.
displaySize
.
width
*
0.8
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
Positioned
(
bottom:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
right:
-
Utils
.
displaySize
.
width
*
0.5
/
2
,
child:
ClipRect
(
child:
Container
(
width:
Utils
.
displaySize
.
width
*
0.8
,
height:
Utils
.
displaySize
.
width
*
0.8
,
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
200.0
)),
),
)),
Align
(
alignment:
Alignment
.
center
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SizedBox
(
width:
Utils
.
displaySize
.
width
*
0.5
,
height:
Utils
.
displaySize
.
width
*
0.5
,
child:
Image
.
asset
(
UtilImages
.
textLogoPNG
,
fit:
BoxFit
.
cover
,
),
),
],
),
),
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
20.0
),
child:
Text
(
UtilStrings
.
splashScreen
,
style:
GoogleFonts
.
openSans
(
color:
UtilColors
.
blackColor
)),
),
)
],
),
),
));
}
void
startApp
()
async
{
await
SplashScreenController
().
checkAuth
().
then
((
value
)
{
_timer
=
Timer
.
periodic
(
const
Duration
(
seconds:
3
),
(
t
)
=>
Navigator
.
of
(
context
,
rootNavigator:
true
).
pushReplacement
(
MaterialPageRoute
(
builder:
(
_
)
=>
(
value
==
true
)
?
const
Dashboard
()
:
Login
()),
));
});
}
}
frontend/lib/Views/Dashboard/Dashboard.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:pettahmate/Controllers/Auth/AuthController.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
import
'package:pettahmate/Views/Home/Drawer.dart'
;
import
'package:pettahmate/Views/Home/Home.dart'
;
class
Dashboard
extends
StatefulWidget
{
const
Dashboard
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
Dashboard
>
createState
()
=>
_DashboardState
();
}
class
_DashboardState
extends
State
<
Dashboard
>
{
int
_selectedIndex
=
0
;
static
const
TextStyle
optionStyle
=
TextStyle
(
fontSize:
30
,
fontWeight:
FontWeight
.
bold
);
static
const
List
<
Widget
>
_widgetOptions
=
<
Widget
>[
Home
(),
Text
(
'Index 1: Business'
,
style:
optionStyle
,
),
Text
(
'Index 2: School'
,
style:
optionStyle
,
),
];
void
_onItemTapped
(
int
index
)
{
setState
(()
{
_selectedIndex
=
index
;
});
}
final
_scaffoldKey
=
GlobalKey
<
ScaffoldState
>();
@override
Widget
build
(
BuildContext
context
)
{
return
SafeArea
(
child:
Scaffold
(
key:
_scaffoldKey
,
drawer:
const
HomeDrawer
(),
body:
Column
(
children:
[
Expanded
(
flex:
0
,
child:
Container
(
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
const
BorderRadius
.
only
(
bottomRight:
Radius
.
circular
(
20.0
),
bottomLeft:
Radius
.
circular
(
20.0
))),
width:
Utils
.
displaySize
.
width
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
15.0
,
horizontal:
20.0
),
child:
GestureDetector
(
onTap:
()
{
if
(
_scaffoldKey
.
currentState
!.
hasDrawer
)
{
if
(
_scaffoldKey
.
currentState
!.
isDrawerOpen
)
{
_scaffoldKey
.
currentState
!.
openEndDrawer
();
}
else
{
_scaffoldKey
.
currentState
!.
openDrawer
();
}
}
},
child:
const
Icon
(
Icons
.
menu
),
),
),
Text
(
UtilStrings
.
appTitle
),
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
15.0
,
horizontal:
20.0
),
child:
GestureDetector
(
onTap:
()
=>
AuthController
().
logout
(
context
),
child:
const
Icon
(
Icons
.
logout
),
),
)
],
),
),
),
Expanded
(
child:
Center
(
child:
_widgetOptions
.
elementAt
(
_selectedIndex
),
))
],
),
bottomNavigationBar:
BottomNavigationBar
(
backgroundColor:
UtilColors
.
primaryColor
,
items:
const
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
home
),
label:
'Home'
,
),
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
shopping_cart
),
label:
'Basket'
,
),
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
school
),
label:
'Favorite'
,
),
],
currentIndex:
_selectedIndex
,
selectedItemColor:
UtilColors
.
blackColor
,
onTap:
_onItemTapped
,
),
));
}
}
frontend/lib/Views/Home/Drawer.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
import
'package:pettahmate/Views/Category/CategoryManagement.dart'
;
import
'package:pettahmate/Views/Profile/Profile.dart'
;
import
'package:pettahmate/Views/Shop/NewShop.dart'
;
class
HomeDrawer
extends
StatefulWidget
{
const
HomeDrawer
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
HomeDrawer
>
createState
()
=>
_HomeDrawerState
();
}
class
_HomeDrawerState
extends
State
<
HomeDrawer
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Drawer
(
child:
ListView
(
children:
[
Container
(
color:
UtilColors
.
primaryColor
,
child:
SizedBox
(
height:
Utils
.
displaySize
.
width
*
0.5
,
width:
Utils
.
displaySize
.
width
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
85
,
width:
85.0
,
child:
GestureDetector
(
onTap:
()
=>
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
Profile
())),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
53.0
),
child:
SizedBox
(
height:
80
,
width:
80.0
,
child:
Image
.
asset
(
"assets/img/user_sample.png"
),
),
),
),
),
Text
(
"Pasindu"
,
style:
GoogleFonts
.
openSans
(
fontSize:
18.0
,
color:
UtilColors
.
whiteColorLight
,
fontWeight:
FontWeight
.
w600
,
),
),
Text
(
"adpasindupriyashan@gmail.com"
,
style:
GoogleFonts
.
openSans
(
fontSize:
13.0
,
color:
UtilColors
.
whiteColorLight
,
),
),
Text
(
"+97 77 977 8269"
,
style:
GoogleFonts
.
openSans
(
fontSize:
13.0
,
color:
UtilColors
.
whiteColorLight
,
),
),
],
),
),
),
getDrawerItem
(
"Home"
,
Icons
.
dashboard
,
()
{}),
getDrawerItem
(
"Category Management"
,
Icons
.
category
,
()
=>
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
CategoryManagement
()))
),
getDrawerItem
(
"Shop Management"
,
Icons
.
shop
,
()
=>
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
NewShop
()))),
getDrawerItem
(
"Products Management"
,
Icons
.
production_quantity_limits
,
()
{}),
],
),
);
}
getDrawerItem
(
String
title
,
IconData
production_quantity_limits
,
func
)
{
return
ListTile
(
onTap:
func
,
tileColor:
UtilColors
.
whiteColor
,
leading:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Icon
(
production_quantity_limits
,
size:
18.0
,
)
],
),
title:
Text
(
title
,
style:
GoogleFonts
.
openSans
(
fontSize:
14.0
,
color:
UtilColors
.
blackColor
,
fontWeight:
FontWeight
.
w600
,
),
),
);
}
}
frontend/lib/Views/Home/Home.dart
0 → 100644
View file @
f10acc47
import
'package:carousel_slider/carousel_slider.dart'
;
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Images.dart'
;
import
'package:pettahmate/Models/Strings.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
import
'package:pettahmate/Views/Widgets/PopUps/ImageBrowser.dart'
;
class
Home
extends
StatefulWidget
{
const
Home
({
Key
?
key
})
:
super
(
key:
key
);
@override
_HomeState
createState
()
=>
_HomeState
();
}
class
_HomeState
extends
State
<
Home
>
{
final
_scaffoldKey
=
GlobalKey
<
ScaffoldState
>();
final
double
topSpace
=
Utils
.
displaySize
.
width
*
0.4
;
@override
void
initState
()
{
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
SafeArea
(
child:
Scaffold
(
key:
_scaffoldKey
,
backgroundColor:
UtilColors
.
whiteColor
,
body:
SizedBox
(
width:
Utils
.
displaySize
.
width
,
height:
Utils
.
displaySize
.
height
,
child:
Column
(
children:
[
Expanded
(
flex:
0
,
child:
Column
(
children:
[
const
SizedBox
(
height:
10.0
,
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
child:
Container
(
margin:
const
EdgeInsets
.
only
(
left:
10.0
,
right:
10.0
),
child:
TextFormField
(
decoration:
Utils
.
getDefaultTextInputDecoration
(
'Search '
,
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
Container
(
padding:
const
EdgeInsets
.
all
(
5.0
),
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
BorderRadius
.
circular
(
100.0
)),
child:
Icon
(
Icons
.
image_search
,
color:
UtilColors
.
blackColor
,
),
),
Container
(
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
10.0
),
padding:
const
EdgeInsets
.
all
(
5.0
),
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
BorderRadius
.
circular
(
100.0
)),
child:
Icon
(
Icons
.
multitrack_audio
,
color:
UtilColors
.
blackColor
,
),
),
],
)),
cursorColor:
UtilColors
.
primaryColor
,
keyboardType:
TextInputType
.
emailAddress
,
style:
Utils
.
getprimaryFieldTextStyle
(
UtilColors
.
greyColor
),
),
)),
],
),
const
SizedBox
(
height:
10.0
,
),
],
)),
CarouselSlider
(
options:
CarouselOptions
(
height:
180.0
),
items:
[
1
,
2
,
3
,
4
,
5
].
map
((
i
)
{
return
Builder
(
builder:
(
BuildContext
context
)
{
return
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
2.0
),
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
BorderRadius
.
circular
(
10.0
)),
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
5.0
),
child:
Image
.
asset
(
UtilImages
.
bannerPNG
,
fit:
BoxFit
.
cover
,
),
));
},
);
}).
toList
(),
),
const
SizedBox
(
height:
10.0
,
),
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
5.0
),
child:
SingleChildScrollView
(
scrollDirection:
Axis
.
horizontal
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
getCategory
(
"Shoes"
),
getCategory
(
"Electronics"
),
getCategory
(
"Baby Care"
),
getCategory
(
"Kitchen Electronics"
),
],
),
),
),
const
SizedBox
(
height:
10.0
,
),
Expanded
(
child:
GridView
.
extent
(
primary:
false
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
5.0
),
crossAxisSpacing:
5
,
mainAxisSpacing:
5
,
maxCrossAxisExtent:
300.0
,
children:
<
Widget
>[
getCard
(),
getCard
(),
getCard
(),
getCard
(),
getCard
(),
],
))
],
)),
));
}
getCategory
(
String
name
)
{
return
Container
(
margin:
const
EdgeInsets
.
only
(
right:
5.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
20.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
color:
UtilColors
.
primaryColor
),
child:
Text
(
name
,
style:
GoogleFonts
.
openSans
(
color:
UtilColors
.
blackColor
),
),
);
}
getCard
()
{
return
Container
(
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
UtilColors
.
primaryColor
),
borderRadius:
BorderRadius
.
circular
(
10.0
),
color:
UtilColors
.
whiteColor
),
child:
Stack
(
alignment:
AlignmentDirectional
.
center
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
Image
.
network
(
'https://e7.pngegg.com/pngimages/483/759/png-clipart-nike-air-max-nike-free-air-force-shoe-nike-white-outdoor-shoe.png'
,
fit:
BoxFit
.
cover
,
)),
Expanded
(
flex:
0
,
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
3.0
),
child:
Text
(
"Shoe Nike Free Air Force"
,
style:
GoogleFonts
.
openSans
(
fontSize:
13.0
),
),
)),
Expanded
(
flex:
0
,
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
3.0
,
bottom:
5.0
),
child:
Text
(
"Rs. 500.00"
,
style:
GoogleFonts
.
openSans
(
fontSize:
20.0
),
),
)),
],
),
Positioned
(
top:
10.0
,
right:
5.0
,
child:
Container
(
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
BorderRadius
.
circular
(
50.0
)),
child:
const
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
10.0
),
child:
Icon
(
Icons
.
add_shopping_cart
),
),
))
],
),
);
}
}
frontend/lib/Views/Profile/Profile.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
class
Profile
extends
StatefulWidget
{
Profile
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
Profile
>
createState
()
=>
_ProfileState
();
}
class
_ProfileState
extends
State
<
Profile
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
();
}
}
\ No newline at end of file
frontend/lib/Views/Shop/NewShop.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
class
NewShop
extends
StatefulWidget
{
NewShop
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
NewShop
>
createState
()
=>
_NewShopState
();
}
class
_NewShopState
extends
State
<
NewShop
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
// body: ,
);
}
}
\ No newline at end of file
frontend/lib/Views/Widgets/PopUps/Confirmation.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
Confirmation
extends
StatefulWidget
{
var
okFunction
,
noFunction
;
Confirmation
({
required
this
.
okFunction
,
required
this
.
noFunction
});
@override
State
<
StatefulWidget
>
createState
()
=>
ConfirmationState
(
okFunction:
this
.
okFunction
,
noFunction:
this
.
noFunction
);
}
class
ConfirmationState
extends
State
<
Confirmation
>
with
SingleTickerProviderStateMixin
{
var
okFunction
,
noFunction
;
ConfirmationState
({
required
this
.
okFunction
,
required
this
.
noFunction
});
@override
Widget
build
(
BuildContext
context
)
{
return
Center
(
child:
Material
(
color:
Colors
.
transparent
,
child:
SizedBox
(
width:
Utils
.
displaySize
.
width
*
0.8
,
child:
Card
(
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
20.0
,
horizontal:
10.0
),
child:
Wrap
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'Confirmation'
,
style:
GoogleFonts
.
openSans
(
fontSize:
15.0
,
color:
UtilColors
.
primaryColor
),
),
Padding
(
padding:
EdgeInsets
.
only
(
top:
20.0
),
child:
Text
(
'Record found. Do you want to edit personal details?'
,
style:
GoogleFonts
.
openSans
(
fontSize:
12.0
,
color:
UtilColors
.
primaryColor
),
),
),
Padding
(
padding:
EdgeInsets
.
only
(
top:
20.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
right:
10.0
),
child:
TextButton
(
child:
Text
(
"No"
,
style:
GoogleFonts
.
openSans
(),
),
style:
ButtonStyle
(
foregroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
whiteColor
),
backgroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
redColor
),
),
onPressed:
(
noFunction
!=
null
)
?
noFunction
:
()
async
{
Navigator
.
pop
(
context
);
},
),
),
Padding
(
padding:
EdgeInsets
.
only
(
right:
10.0
),
child:
TextButton
(
child:
Text
(
"Yes"
,
style:
GoogleFonts
.
openSans
(),
),
style:
ButtonStyle
(
foregroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
whiteColor
),
backgroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
greenColor
),
),
onPressed:
okFunction
,
),
),
],
),
),
],
)
]),
),
),
),
),
);
}
}
frontend/lib/Views/Widgets/PopUps/ImageBrowser.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
class
ImageBrowser
extends
StatefulWidget
{
ImageBrowser
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
ImageBrowser
>
createState
()
=>
_ImageBrowserState
();
}
class
_ImageBrowserState
extends
State
<
ImageBrowser
>
{
final
ImagePicker
_picker
=
ImagePicker
();
@override
Widget
build
(
BuildContext
context
)
{
return
Wrap
(
children:
[
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
20.0
),
color:
UtilColors
.
whiteColor
,
child:
Center
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
GestureDetector
(
onTap:
()
async
{
await
_picker
.
pickImage
(
source
:
ImageSource
.
camera
);
},
child:
Column
(
children:
[
Container
(
margin:
const
EdgeInsets
.
only
(
left:
20.0
,
right:
20.0
),
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
BorderRadius
.
circular
(
50.0
)),
child:
const
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
10.0
),
child:
Icon
(
Icons
.
camera
,
),
),
),
const
SizedBox
(
height:
5.0
),
const
Text
(
'Camera'
)
],
),
),
GestureDetector
(
onTap:
()
async
{
await
_picker
.
pickImage
(
source
:
ImageSource
.
gallery
);
},
child:
Column
(
children:
[
Container
(
margin:
const
EdgeInsets
.
only
(
left:
20.0
,
right:
20.0
),
decoration:
BoxDecoration
(
color:
UtilColors
.
primaryColor
,
borderRadius:
BorderRadius
.
circular
(
50.0
)),
child:
const
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
10.0
),
child:
Icon
(
Icons
.
image
),
),
),
const
SizedBox
(
height:
5.0
),
const
Text
(
'Gallery'
)
],
),
),
],
),
),
)
],
);
}
}
frontend/lib/Views/Widgets/PopUps/PopUpLoading.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
PopUpLoading
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
=>
PopUpLoadingState
();
}
class
PopUpLoadingState
extends
State
<
PopUpLoading
>
with
SingleTickerProviderStateMixin
{
late
AnimationController
controller
;
late
Animation
<
double
>
scaleAnimation
;
@override
void
initState
()
{
super
.
initState
();
controller
=
AnimationController
(
vsync:
this
,
duration:
Duration
(
milliseconds:
450
));
scaleAnimation
=
CurvedAnimation
(
parent:
controller
,
curve:
Curves
.
elasticInOut
);
controller
.
addListener
(()
{
setState
(()
{});
});
controller
.
forward
();
}
@override
void
dispose
()
{
controller
.
dispose
();
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Center
(
child:
Material
(
color:
Colors
.
transparent
,
child:
ScaleTransition
(
scale:
scaleAnimation
,
child:
Container
(
alignment:
Alignment
.
center
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
new
CircularProgressIndicator
(
valueColor:
new
AlwaysStoppedAnimation
<
Color
>(
UtilColors
.
primaryColor
),
),
SizedBox
(
height:
10.0
,
),
SizedBox
(
width:
Utils
.
displaySize
.
width
*
0.6
,
child:
Text
(
(
Utils
.
loadingMessage
==
null
)
?
"Please Wait"
:
Utils
.
loadingMessage
.
toString
(),
textAlign:
TextAlign
.
center
,
style:
GoogleFonts
.
openSans
(
color:
UtilColors
.
whiteColor
,
fontSize:
12.0
),
),
)
],
),
),
),
),
);
}
}
frontend/lib/Views/Widgets/PopUps/showSummery.dart
0 → 100644
View file @
f10acc47
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:pettahmate/Models/Colors.dart'
;
import
'package:pettahmate/Models/Utils.dart'
;
class
showSummery
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
=>
showSummeryState
();
}
class
showSummeryState
extends
State
<
showSummery
>
with
SingleTickerProviderStateMixin
{
int
summary1
=
1
,
summary2
=
1
,
summary3
=
1
,
summary4
=
0
;
List
statusList
=
[
'Not Specified'
,
'OK'
,
'NOT BAD'
,
'BAD'
];
List
colorList
=
[
UtilColors
.
primaryColor
,
UtilColors
.
greenColor
,
UtilColors
.
orangeColor
,
UtilColors
.
redColor
];
double
bmi
=
0.0
;
@override
void
initState
()
{
double
weight
=
double
.
parse
(
Utils
.
dataMap
[
'weight'
]);
double
height
=
double
.
parse
(
Utils
.
dataMap
[
'height'
]);
bmi
=
weight
/
(
height
*
height
);
setState
(()
{
if
(
Utils
.
fatValue
==
0.0
)
{
summary1
=
0
;
}
else
{
if
(
Utils
.
dataMap
[
'pal'
]
==
'Medium'
||
Utils
.
dataMap
[
'pal'
]
==
'High'
)
{
if
((
double
.
parse
(
Utils
.
dataMap
[
'fastbloodsugar'
])
<
100
&&
Utils
.
carbsValue
>
25
)
||
(
Utils
.
dataMap
[
'lp'
]
==
'Low'
&&
Utils
.
fatValue
>
35
))
{
summary1
=
2
;
}
}
}
if
(
Utils
.
fatValue
==
0.0
)
{
summary2
=
0
;
}
else
{
if
((
Utils
.
dataMap
[
'lp'
]
==
'Low'
&&
Utils
.
fatValue
>
6
)
||
((
Utils
.
dataMap
[
'lp'
]
==
'Low'
||
Utils
.
dataMap
[
'lp'
]
==
'Medium'
)
&&
Utils
.
fatValue
>
35
))
{
summary2
=
2
;
}
}
if
(
Utils
.
carbsValue
==
0.0
)
{
summary3
=
0
;
}
else
{
if
((
Utils
.
carbsValue
>
10
&&
double
.
parse
(
Utils
.
dataMap
[
'fastbloodsugar'
])
>
120
)
||
(
Utils
.
carbsValue
>
15
&&
double
.
parse
(
Utils
.
dataMap
[
'fastbloodsugar'
])
>
100
)
||
(
Utils
.
carbsValue
>
25
&&
double
.
parse
(
Utils
.
dataMap
[
'fastbloodsugar'
])
<
100
))
{
summary3
=
3
;
}
}
if
(
Utils
.
fatValue
==
0.0
)
{
summary4
=
0
;
}
else
{
if
(
Utils
.
fatValue
>
30
||
bmi
>
25
)
{
summary4
=
2
;
}
}
});
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Center
(
child:
Material
(
color:
Colors
.
transparent
,
child:
SizedBox
(
width:
Utils
.
displaySize
.
width
*
0.8
,
child:
Card
(
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
20.0
,
horizontal:
10.0
),
child:
Wrap
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'Summary'
,
style:
GoogleFonts
.
openSans
(
fontSize:
15.0
,
color:
UtilColors
.
primaryColor
),
),
const
SizedBox
(
height:
10.0
,
),
Text
(
'physical activity medium or high , then Fasting blood sugar < 100 and carbohydrates percentage > 25%'
),
SizedBox
(
height:
5.0
,
),
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
5.0
),
color:
colorList
[
summary1
]),
padding:
EdgeInsets
.
symmetric
(
vertical:
5.0
,
horizontal:
8.0
),
child:
Text
(
statusList
[
summary1
],
style:
GoogleFonts
.
openSans
(
fontSize:
15.0
,
color:
UtilColors
.
whiteColor
)),
),
const
SizedBox
(
height:
20.0
,
),
Text
(
'Lipid High and Fat > 6 % = bad , Lipid Normal or Low and Fat > 35%'
),
SizedBox
(
height:
5.0
,
),
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
5.0
),
color:
colorList
[
summary2
]),
padding:
EdgeInsets
.
symmetric
(
vertical:
5.0
,
horizontal:
8.0
),
child:
Text
(
statusList
[
summary2
],
style:
GoogleFonts
.
openSans
(
fontSize:
15.0
,
color:
UtilColors
.
whiteColor
)),
),
const
SizedBox
(
height:
20.0
,
),
Text
(
'Fasting blood sugar > 120 and Carbohydrates percentage > 10 % = bad , Fasting Blood Sugar > 100 and Carbohydrates percentage > 15 % = bad , Fasting Blood Sugar < 100 and Carbohydrates percentage > 25 %'
),
SizedBox
(
height:
5.0
,
),
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
5.0
),
color:
colorList
[
summary3
]),
padding:
EdgeInsets
.
symmetric
(
vertical:
5.0
,
horizontal:
8.0
),
child:
Text
(
statusList
[
summary3
],
style:
GoogleFonts
.
openSans
(
fontSize:
15.0
,
color:
UtilColors
.
whiteColor
)),
),
const
SizedBox
(
height:
20.0
,
),
Text
(
'Fat > 30 or BMI > 25'
),
SizedBox
(
height:
5.0
,
),
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
5.0
),
color:
colorList
[
summary4
]),
padding:
EdgeInsets
.
symmetric
(
vertical:
5.0
,
horizontal:
8.0
),
child:
Text
(
statusList
[
summary4
],
style:
GoogleFonts
.
openSans
(
fontSize:
15.0
,
color:
UtilColors
.
whiteColor
)),
),
const
SizedBox
(
height:
20.0
,
),
Align
(
alignment:
Alignment
.
center
,
child:
TextButton
(
child:
Text
(
"Cancel"
,
style:
GoogleFonts
.
openSans
(),
),
style:
ButtonStyle
(
foregroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
whiteColor
),
backgroundColor:
MaterialStateProperty
.
all
<
Color
>(
UtilColors
.
redColor
),
),
onPressed:
()
async
{
Navigator
.
pop
(
context
);
},
),
)
],
)
]),
),
),
),
),
);
}
}
frontend/lib/main.dart
View file @
f10acc47
import
'package:firebase_core/firebase_core.dart'
;
import
'package:flutter/material.dart'
;
void
main
(
)
{
runApp
(
const
MyApp
());
import
'package:flutter/services.dart'
;
import
'package:pettahmate/Views/Common/SplashScreen.dart'
;
void
main
(
)
async
{
WidgetsFlutterBinding
.
ensureInitialized
();
await
Firebase
.
initializeApp
();
SystemChrome
.
setSystemUIOverlayStyle
(
SystemUiOverlayStyle
.
dark
);
runApp
(
MyApp
());
}
class
MyApp
extends
StatelessWidget
{
const
MyApp
({
Key
?
key
})
:
super
(
key:
key
);
// This widget is the root of your application.
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
title:
'Flutter Demo'
,
theme:
ThemeData
(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch:
Colors
.
blue
,
),
home:
const
MyHomePage
(
title:
'Pettah Mate'
),
);
}
}
class
MyHomePage
extends
StatefulWidget
{
const
MyHomePage
({
Key
?
key
,
required
this
.
title
})
:
super
(
key:
key
);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final
String
title
;
@override
State
<
MyHomePage
>
createState
()
=>
_MyHomePageState
();
}
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
int
_counter
=
0
;
void
_incrementCounter
()
{
setState
(()
{
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter
++;
});
}
@override
Widget
build
(
BuildContext
context
)
{
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return
Scaffold
(
appBar:
AppBar
(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title:
Text
(
widget
.
title
),
),
body:
Center
(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child:
Column
(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
const
Text
(
'You have pushed the button this many times:'
,
),
Text
(
'
$_counter
'
,
style:
Theme
.
of
(
context
).
textTheme
.
headline4
,
),
],
),
debugShowCheckedModeBanner:
false
,
theme:
ThemeData
(),
title:
'Doc APP'
,
home:
const
Scaffold
(
body:
SplashScreen
(),
),
floatingActionButton:
FloatingActionButton
(
onPressed:
_incrementCounter
,
tooltip:
'Increment'
,
child:
const
Icon
(
Icons
.
add
),
),
// This trailing comma makes auto-formatting nicer for build methods.
);
}
}
frontend/pubspec.lock
View file @
f10acc47
...
...
@@ -8,6 +8,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
auto_size_text:
dependency: "direct main"
description:
name: auto_size_text
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
boolean_selector:
dependency: transitive
description:
...
...
@@ -15,6 +22,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
cached_network_image:
dependency: "direct main"
description:
name: cached_network_image
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
cached_network_image_platform_interface:
dependency: transitive
description:
name: cached_network_image_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
cached_network_image_web:
dependency: transitive
description:
name: cached_network_image_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
carousel_slider:
dependency: "direct main"
description:
name: carousel_slider
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
characters:
dependency: transitive
description:
...
...
@@ -43,6 +78,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
cupertino_icons:
dependency: "direct main"
description:
...
...
@@ -50,6 +99,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
email_validator:
dependency: "direct main"
description:
name: email_validator
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
fake_async:
dependency: transitive
description:
...
...
@@ -57,11 +113,109 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.2"
firebase_auth:
dependency: "direct main"
description:
name: firebase_auth
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.13"
firebase_auth_platform_interface:
dependency: transitive
description:
name: firebase_auth_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "6.2.2"
firebase_auth_web:
dependency: transitive
description:
name: firebase_auth_web
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.11"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.5"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.1"
firebase_database:
dependency: "direct main"
description:
name: firebase_database
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.10"
firebase_database_platform_interface:
dependency: transitive
description:
name: firebase_database_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1+2"
firebase_database_web:
dependency: transitive
description:
name: firebase_database_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0+9"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_blurhash:
dependency: transitive
description:
name: flutter_blurhash
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
flutter_cache_manager:
dependency: transitive
description:
name: flutter_cache_manager
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
flutter_datetime_picker:
dependency: "direct main"
description:
name: flutter_datetime_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
flutter_lints:
dependency: "direct dev"
description:
...
...
@@ -69,11 +223,170 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
flutter_slidable:
dependency: "direct main"
description:
name: flutter_slidable
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
fluttertoast:
dependency: "direct main"
description:
name: fluttertoast
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.9"
geolocator:
dependency: "direct main"
description:
name: geolocator
url: "https://pub.dartlang.org"
source: hosted
version: "8.2.0"
geolocator_android:
dependency: transitive
description:
name: geolocator_android
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.6"
geolocator_apple:
dependency: transitive
description:
name: geolocator_apple
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
geolocator_platform_interface:
dependency: transitive
description:
name: geolocator_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.4"
geolocator_web:
dependency: transitive
description:
name: geolocator_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
geolocator_windows:
dependency: transitive
description:
name: geolocator_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
google_sign_in:
dependency: "direct main"
description:
name: google_sign_in
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.4"
google_sign_in_platform_interface:
dependency: transitive
description:
name: google_sign_in_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
google_sign_in_web:
dependency: transitive
description:
name: google_sign_in_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.0+5"
http:
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.4"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5"
image_picker_android:
dependency: transitive
description:
name: image_picker_android
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.4+11"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.6"
image_picker_ios:
dependency: transitive
description:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.4+11"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.4"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
lints:
dependency: transitive
description:
...
...
@@ -102,6 +415,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
octo_image:
dependency: transitive
description:
name: octo_image
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
path:
dependency: transitive
description:
...
...
@@ -109,6 +429,125 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.12"
path_provider_ios:
dependency: transitive
description:
name: path_provider_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
percent_indicator:
dependency: "direct main"
description:
name: percent_indicator
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "8.3.0"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.7.0"
phone_number:
dependency: "direct main"
description:
name: phone_number
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.0+2"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1+1"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.27.3"
sky_engine:
dependency: transitive
description: flutter
...
...
@@ -121,6 +560,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
sqflite:
dependency: transitive
description:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
stack_trace:
dependency: transitive
description:
...
...
@@ -142,6 +595,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0+2"
term_glyph:
dependency: transitive
description:
...
...
@@ -156,6 +616,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
toggle_switch:
dependency: "direct main"
description:
name: toggle_switch
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
typed_data:
dependency: transitive
description:
...
...
@@ -163,6 +630,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
uuid:
dependency: transitive
description:
name: uuid
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.6"
vector_math:
dependency: transitive
description:
...
...
@@ -170,5 +644,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.1"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0+1"
sdks:
dart: ">=2.16.1 <3.0.0"
dart: ">=2.16.2 <3.0.0"
flutter: ">=2.10.0-0"
frontend/pubspec.yaml
View file @
f10acc47
name
:
frontend
name
:
pettahmate
description
:
A new Flutter project.
publish_to
:
'
none'
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version
:
1.0.0+1
environment
:
sdk
:
"
>=2.16.
1
<3.0.0"
sdk
:
"
>=2.16.
2
<3.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies
:
flutter
:
sdk
:
flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons
:
^1.0.2
fluttertoast
:
^8.0.8
email_validator
:
^2.0.1
cached_network_image
:
^3.2.0
permission_handler
:
^8.3.0
google_fonts
:
^2.2.0
google_sign_in
:
^5.2.3
percent_indicator
:
^4.0.0
flutter_slidable
:
^1.2.0
auto_size_text
:
^3.0.0
geolocator
:
^8.1.1
http
:
^0.13.4
firebase_core
:
^1.14.0
firebase_auth
:
^3.3.13
firebase_database
:
^9.0.10
toggle_switch
:
^1.4.0
phone_number
:
^0.12.0+1
flutter_datetime_picker
:
^1.5.1
intl
:
^0.17.0
carousel_slider
:
^4.0.0
image_picker
:
^0.8.5
dev_dependencies
:
flutter_test
:
sdk
:
flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints
:
^1.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter
:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design
:
true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
assets
:
-
assets/img/logo.png
-
assets/img/textlogo.png
-
assets/img/user_sample.png
-
assets/img/banner.png
-
assets/img/category.png
\ No newline at end of file
frontend/test/widget_test.dart
deleted
100644 → 0
View file @
bd066a99
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:frontend/main.dart'
;
void
main
(
)
{
testWidgets
(
'Counter increments smoke test'
,
(
WidgetTester
tester
)
async
{
// Build our app and trigger a frame.
await
tester
.
pumpWidget
(
const
MyApp
());
// Verify that our counter starts at 0.
expect
(
find
.
text
(
'0'
),
findsOneWidget
);
expect
(
find
.
text
(
'1'
),
findsNothing
);
// Tap the '+' icon and trigger a frame.
await
tester
.
tap
(
find
.
byIcon
(
Icons
.
add
));
await
tester
.
pump
();
// Verify that our counter has incremented.
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsOneWidget
);
});
}
frontend/web/index.html
View file @
f10acc47
...
...
@@ -23,13 +23,13 @@
<!-- iOS meta tags & icons -->
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<meta
name=
"apple-mobile-web-app-title"
content=
"
frontend
"
>
<meta
name=
"apple-mobile-web-app-title"
content=
"
pettahmate
"
>
<link
rel=
"apple-touch-icon"
href=
"icons/Icon-192.png"
>
<!-- Favicon -->
<link
rel=
"icon"
type=
"image/png"
href=
"favicon.png"
/>
<title>
frontend
</title>
<title>
pettahmate
</title>
<link
rel=
"manifest"
href=
"manifest.json"
>
</head>
<body>
...
...
frontend/web/manifest.json
View file @
f10acc47
{
"name"
:
"
frontend
"
,
"short_name"
:
"
frontend
"
,
"name"
:
"
pettahmate
"
,
"short_name"
:
"
pettahmate
"
,
"start_url"
:
"."
,
"display"
:
"standalone"
,
"background_color"
:
"#0175C2"
,
...
...
frontend/windows/CMakeLists.txt
View file @
f10acc47
cmake_minimum_required
(
VERSION 3.14
)
project
(
frontend
LANGUAGES CXX
)
project
(
pettahmate
LANGUAGES CXX
)
set
(
BINARY_NAME
"
frontend
"
)
set
(
BINARY_NAME
"
pettahmate
"
)
cmake_policy
(
SET CMP0063 NEW
)
...
...
frontend/windows/flutter/generated_plugin_registrant.cc
View file @
f10acc47
...
...
@@ -6,6 +6,9 @@
#include "generated_plugin_registrant.h"
#include <geolocator_windows/geolocator_windows.h>
void
RegisterPlugins
(
flutter
::
PluginRegistry
*
registry
)
{
GeolocatorWindowsRegisterWithRegistrar
(
registry
->
GetRegistrarForPlugin
(
"GeolocatorWindows"
));
}
frontend/windows/flutter/generated_plugins.cmake
View file @
f10acc47
...
...
@@ -3,6 +3,7 @@
#
list
(
APPEND FLUTTER_PLUGIN_LIST
geolocator_windows
)
set
(
PLUGIN_BUNDLED_LIBRARIES
)
...
...
frontend/windows/runner/Runner.rc
View file @
f10acc47
...
...
@@ -89,13 +89,13 @@ BEGIN
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "com.
example
" "\0"
VALUE "FileDescription", "
frontend
" "\0"
VALUE "CompanyName", "com.
aries
" "\0"
VALUE "FileDescription", "
pettahmate
" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "
frontend
" "\0"
VALUE "LegalCopyright", "Copyright (C) 2022 com.
example
. All rights reserved." "\0"
VALUE "OriginalFilename", "
frontend
.exe" "\0"
VALUE "ProductName", "
frontend
" "\0"
VALUE "InternalName", "
pettahmate
" "\0"
VALUE "LegalCopyright", "Copyright (C) 2022 com.
aries
. All rights reserved." "\0"
VALUE "OriginalFilename", "
pettahmate
.exe" "\0"
VALUE "ProductName", "
pettahmate
" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0"
END
END
...
...
frontend/windows/runner/main.cpp
View file @
f10acc47
...
...
@@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
FlutterWindow
window
(
project
);
Win32Window
::
Point
origin
(
10
,
10
);
Win32Window
::
Size
size
(
1280
,
720
);
if
(
!
window
.
CreateAndShow
(
L"
frontend
"
,
origin
,
size
))
{
if
(
!
window
.
CreateAndShow
(
L"
pettahmate
"
,
origin
,
size
))
{
return
EXIT_FAILURE
;
}
window
.
SetQuitOnClose
(
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment