Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-297
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
Weththasinghe A.S
2023-297
Commits
4b76916e
Commit
4b76916e
authored
Dec 04, 2023
by
Deshan N.A.S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete Frontend
parent
df6da2c4
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
4365 additions
and
0 deletions
+4365
-0
IT20154530_Frontend/.gitignore
IT20154530_Frontend/.gitignore
+44
-0
IT20154530_Frontend/.metadata
IT20154530_Frontend/.metadata
+30
-0
IT20154530_Frontend/README.md
IT20154530_Frontend/README.md
+16
-0
IT20154530_Frontend/analysis_options.yaml
IT20154530_Frontend/analysis_options.yaml
+28
-0
IT20154530_Frontend/lib/CkdPred.dart
IT20154530_Frontend/lib/CkdPred.dart
+906
-0
IT20154530_Frontend/lib/actor.dart
IT20154530_Frontend/lib/actor.dart
+910
-0
IT20154530_Frontend/lib/disease.dart
IT20154530_Frontend/lib/disease.dart
+560
-0
IT20154530_Frontend/lib/forcast.dart
IT20154530_Frontend/lib/forcast.dart
+181
-0
IT20154530_Frontend/lib/home.dart
IT20154530_Frontend/lib/home.dart
+70
-0
IT20154530_Frontend/lib/loginPage.dart
IT20154530_Frontend/lib/loginPage.dart
+135
-0
IT20154530_Frontend/lib/main.dart
IT20154530_Frontend/lib/main.dart
+95
-0
IT20154530_Frontend/lib/registerPage.dart
IT20154530_Frontend/lib/registerPage.dart
+135
-0
IT20154530_Frontend/lib/service/apiDio.dart
IT20154530_Frontend/lib/service/apiDio.dart
+329
-0
IT20154530_Frontend/lib/suggestDietPlan.dart
IT20154530_Frontend/lib/suggestDietPlan.dart
+435
-0
IT20154530_Frontend/pubspec.lock
IT20154530_Frontend/pubspec.lock
+274
-0
IT20154530_Frontend/pubspec.yaml
IT20154530_Frontend/pubspec.yaml
+93
-0
IT20154530_Frontend/test/widget_test.dart
IT20154530_Frontend/test/widget_test.dart
+30
-0
IT20154530_Frontend/web/favicon.png
IT20154530_Frontend/web/favicon.png
+0
-0
IT20154530_Frontend/web/icons/Icon-192.png
IT20154530_Frontend/web/icons/Icon-192.png
+0
-0
IT20154530_Frontend/web/icons/Icon-512.png
IT20154530_Frontend/web/icons/Icon-512.png
+0
-0
IT20154530_Frontend/web/icons/Icon-maskable-192.png
IT20154530_Frontend/web/icons/Icon-maskable-192.png
+0
-0
IT20154530_Frontend/web/icons/Icon-maskable-512.png
IT20154530_Frontend/web/icons/Icon-maskable-512.png
+0
-0
IT20154530_Frontend/web/index.html
IT20154530_Frontend/web/index.html
+59
-0
IT20154530_Frontend/web/manifest.json
IT20154530_Frontend/web/manifest.json
+35
-0
No files found.
IT20154530_Frontend/.gitignore
0 → 100644
View file @
4b76916e
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
IT20154530_Frontend/.metadata
0 → 100644
View file @
4b76916e
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: "2524052335ec76bb03e04ede244b071f1b86d190"
channel: "stable"
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 2524052335ec76bb03e04ede244b071f1b86d190
base_revision: 2524052335ec76bb03e04ede244b071f1b86d190
- platform: web
create_revision: 2524052335ec76bb03e04ede244b071f1b86d190
base_revision: 2524052335ec76bb03e04ede244b071f1b86d190
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
IT20154530_Frontend/README.md
0 → 100644
View file @
4b76916e
# ckd
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
-
[
Lab: Write your first Flutter app
](
https://docs.flutter.dev/get-started/codelab
)
-
[
Cookbook: Useful Flutter samples
](
https://docs.flutter.dev/cookbook
)
For help getting started with Flutter development, view the
[
online documentation
](
https://docs.flutter.dev/
)
, which offers tutorials,
samples, guidance on mobile development, and a full API reference.
IT20154530_Frontend/analysis_options.yaml
0 → 100644
View file @
4b76916e
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include
:
package:flutter_lints/flutter.yaml
linter
:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules
:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
IT20154530_Frontend/lib/CkdPred.dart
0 → 100644
View file @
4b76916e
import
'package:flutter/material.dart'
;
import
'package:ckd/service/apiDio.dart'
;
// import 'package:file_picker/file_picker.dart';
import
'dart:typed_data'
;
import
'package:go_router/go_router.dart'
;
class
CkdPred
extends
StatefulWidget
{
const
CkdPred
({
super
.
key
});
@override
State
<
CkdPred
>
createState
()
=>
_CkdPredState
();
}
class
_CkdPredState
extends
State
<
CkdPred
>
{
late
String
name
;
late
int
age
;
late
double
blood_pressure
;
late
double
specific_gravity
;
late
double
albumin
;
late
double
sugar
;
late
int
red_blood_cells
;
late
int
pus_cell
;
late
int
pus_cell_clumps
;
late
int
bacteria
;
late
double
blood_glucose_random
;
late
double
blood_urea
;
late
double
serum_creatinine
;
late
double
sodium
;
late
double
potassium
;
late
double
haemoglobin
;
late
double
packed_cell_volume
;
late
double
white_blood_cell_count
;
late
double
red_blood_cell_count
;
late
int
hypertension
;
late
int
diabetes_mellitus
;
late
int
coronary_artery_disease
;
late
int
appetite
;
late
int
peda_edema
;
late
int
aanemia
;
String
_hasCkd
=
""
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
black
),
onPressed:
()
=>
context
.
goNamed
(
'home'
),
),
centerTitle:
true
,
backgroundColor:
Colors
.
blueGrey
,
title:
Text
(
"C-K-D"
),
),
backgroundColor:
Colors
.
blueGrey
.
shade200
,
body:
Center
(
child:
Container
(
width:
450
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
1.2
,
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
blurRadius:
10.0
,
color:
Colors
.
black54
,
//134
),
],
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
40.0
),
bottomRight:
Radius
.
circular
(
40.0
),
topLeft:
Radius
.
circular
(
40.0
),
bottomLeft:
Radius
.
circular
(
40.0
),
),
color:
Colors
.
blueGrey
,
),
child:
SingleChildScrollView
(
child:
Column
(
// shrinkWrap: true,
// padding: EdgeInsets.all(15.0),
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children:
[
// Container(
// width: 750,
// height: 100,
// decoration: const BoxDecoration(
// boxShadow: [
// BoxShadow(
// blurRadius: 10.0,
// color: Colors.black54, //134
// ),
// ],
// borderRadius: BorderRadius.only(
// topRight: Radius.circular(40.0),
// bottomRight: Radius.circular(40.0),
// topLeft: Radius.circular(40.0),
// bottomLeft: Radius.circular(40.0),
// ),
// color: Colors.blueGrey,
// ),
// ),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Age'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
age
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Blood Pressure'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
blood_pressure
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Specific gravity'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
specific_gravity
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Albumin'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
albumin
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Sugar'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
sugar
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'red_blood_cells'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
red_blood_cells
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'pus_cell'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
pus_cell
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'pus_cell_clumps'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
pus_cell_clumps
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'bacteria'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
bacteria
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'blood_glucose_random'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
blood_glucose_random
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'blood_urea'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
blood_urea
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'serum_creatinine'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
serum_creatinine
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'sodium'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
sodium
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'potassium'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
potassium
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'haemoglobin'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
haemoglobin
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'packed_cell_volume'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
packed_cell_volume
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'white_blood_cell_count'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
white_blood_cell_count
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'red_blood_cell_count'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
red_blood_cell_count
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'hypertension'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
hypertension
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'diabetes_mellitus'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
diabetes_mellitus
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'coronary_artery_disease'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
coronary_artery_disease
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'appetite'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
appetite
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'peda_edema'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
peda_edema
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'aanemia'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
aanemia
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
ElevatedButton
(
onPressed:
()
async
{
var
response
=
await
apiDio
().
checkCkD
(
age
,
blood_pressure
,
specific_gravity
,
albumin
,
sugar
,
red_blood_cells
,
pus_cell
,
pus_cell_clumps
,
bacteria
,
blood_glucose_random
,
blood_urea
,
serum_creatinine
,
sodium
,
potassium
,
haemoglobin
,
packed_cell_volume
,
white_blood_cell_count
,
red_blood_cell_count
,
hypertension
,
diabetes_mellitus
,
coronary_artery_disease
,
appetite
,
peda_edema
,
aanemia
,
);
print
(
response
);
if
(
response
!=
1
)
{
setState
(()
{
_hasCkd
=
"Has Ckd"
;
});
}
else
{
setState
(()
{
_hasCkd
=
"No Ckd"
;
});
}
// await apiDio().addActor(name, Talents, movie, character,
// emotion_feedback, interview_feedback, context);
},
child:
Text
(
"Test"
)),
// ElevatedButton(
// child: Text('UPLOAD FILE'),
// onPressed: () async {
// var picked = await FilePicker.platform.pickFiles(
// type: FileType.video, // Allow only video files
// );
// if (picked != null) {
// Uint8List? fileBytes = picked.files.first.bytes;
// if (fileBytes != null) {
// setState(() {
// videoBytes = fileBytes;
// });
// apiDio().addActor(name, Talents, movie, character,
// emotion_feedback, interview_feedback, context);
// apiDio().addRating(
// name, emotion_feedback, interview_feedback, context);
// apiDio().uploadVideo(videoBytes!, name);
// } else {
// print('File bytes are null');
// }
// }
// },
// ),
SizedBox
(
height:
10
,
),
Text
(
_hasCkd
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
30
),
),
SizedBox
(
height:
10
,
),
],
),
),
),
),
);
}
}
IT20154530_Frontend/lib/actor.dart
0 → 100644
View file @
4b76916e
// import 'package:act_x/service/apiDio.dart';
// import 'dart:core';
import
'package:ckd/service/apiDio.dart'
;
import
'package:flutter/material.dart'
;
// import 'package:file_picker/file_picker.dart';
import
'dart:typed_data'
;
import
'package:go_router/go_router.dart'
;
class
Actor
extends
StatefulWidget
{
const
Actor
({
super
.
key
});
@override
State
<
Actor
>
createState
()
=>
_ActorState
();
}
class
_ActorState
extends
State
<
Actor
>
{
Uint8List
?
videoBytes
;
// Store the selected video file as bytes
late
String
name
;
late
int
age
;
late
double
blood_pressure
;
late
double
specific_gravity
;
late
double
albumin
;
late
double
sugar
;
late
int
red_blood_cells
;
late
int
pus_cell
;
late
int
pus_cell_clumps
;
late
int
bacteria
;
late
double
blood_glucose_random
;
late
double
blood_urea
;
late
double
serum_creatinine
;
late
double
sodium
;
late
double
potassium
;
late
double
haemoglobin
;
late
double
packed_cell_volume
;
late
double
white_blood_cell_count
;
late
double
red_blood_cell_count
;
late
int
hypertension
;
late
int
diabetes_mellitus
;
late
int
coronary_artery_disease
;
late
int
appetite
;
late
int
peda_edema
;
late
int
aanemia
;
String
_hasCkd
=
""
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
black
),
onPressed:
()
=>
context
.
goNamed
(
'home'
),
),
centerTitle:
true
,
backgroundColor:
Colors
.
blueGrey
,
title:
Text
(
"C-K-D"
),
),
backgroundColor:
Colors
.
blueGrey
.
shade200
,
body:
Center
(
child:
Container
(
width:
450
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
1.2
,
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
blurRadius:
10.0
,
color:
Colors
.
black54
,
//134
),
],
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
40.0
),
bottomRight:
Radius
.
circular
(
40.0
),
topLeft:
Radius
.
circular
(
40.0
),
bottomLeft:
Radius
.
circular
(
40.0
),
),
color:
Colors
.
blueGrey
,
),
child:
SingleChildScrollView
(
child:
Column
(
// shrinkWrap: true,
// padding: EdgeInsets.all(15.0),
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children:
[
// Container(
// width: 750,
// height: 100,
// decoration: const BoxDecoration(
// boxShadow: [
// BoxShadow(
// blurRadius: 10.0,
// color: Colors.black54, //134
// ),
// ],
// borderRadius: BorderRadius.only(
// topRight: Radius.circular(40.0),
// bottomRight: Radius.circular(40.0),
// topLeft: Radius.circular(40.0),
// bottomLeft: Radius.circular(40.0),
// ),
// color: Colors.blueGrey,
// ),
// ),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Age'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
age
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Blood Pressure'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
blood_pressure
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Specific gravity'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
specific_gravity
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Albumin'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
albumin
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Sugar'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
sugar
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'red_blood_cells'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
red_blood_cells
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'pus_cell'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
pus_cell
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'pus_cell_clumps'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
pus_cell_clumps
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'bacteria'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
bacteria
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'blood_glucose_random'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
blood_glucose_random
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'blood_urea'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
blood_urea
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'serum_creatinine'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
serum_creatinine
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'sodium'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
sodium
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'potassium'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
potassium
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'haemoglobin'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
haemoglobin
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'packed_cell_volume'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
packed_cell_volume
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'white_blood_cell_count'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
white_blood_cell_count
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'red_blood_cell_count'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
red_blood_cell_count
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'hypertension'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
hypertension
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'diabetes_mellitus'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
diabetes_mellitus
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'coronary_artery_disease'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
coronary_artery_disease
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'appetite'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
appetite
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'peda_edema'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
peda_edema
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'aanemia'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
aanemia
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
ElevatedButton
(
onPressed:
()
async
{
var
response
=
await
apiDio
().
checkCkD
(
age
,
blood_pressure
,
specific_gravity
,
albumin
,
sugar
,
red_blood_cells
,
pus_cell
,
pus_cell_clumps
,
bacteria
,
blood_glucose_random
,
blood_urea
,
serum_creatinine
,
sodium
,
potassium
,
haemoglobin
,
packed_cell_volume
,
white_blood_cell_count
,
red_blood_cell_count
,
hypertension
,
diabetes_mellitus
,
coronary_artery_disease
,
appetite
,
peda_edema
,
aanemia
,
);
print
(
response
);
if
(
response
!=
1
)
{
setState
(()
{
_hasCkd
=
"Has Ckd"
;
});
}
else
{
setState
(()
{
_hasCkd
=
"No Ckd"
;
});
}
// await apiDio().addActor(name, Talents, movie, character,
// emotion_feedback, interview_feedback, context);
},
child:
Text
(
"Test"
)),
// ElevatedButton(
// child: Text('UPLOAD FILE'),
// onPressed: () async {
// var picked = await FilePicker.platform.pickFiles(
// type: FileType.video, // Allow only video files
// );
// if (picked != null) {
// Uint8List? fileBytes = picked.files.first.bytes;
// if (fileBytes != null) {
// setState(() {
// videoBytes = fileBytes;
// });
// apiDio().addActor(name, Talents, movie, character,
// emotion_feedback, interview_feedback, context);
// apiDio().addRating(
// name, emotion_feedback, interview_feedback, context);
// apiDio().uploadVideo(videoBytes!, name);
// } else {
// print('File bytes are null');
// }
// }
// },
// ),
SizedBox
(
height:
10
,
),
Text
(
_hasCkd
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
30
),
),
SizedBox
(
height:
10
,
),
],
),
),
),
),
);
}
}
IT20154530_Frontend/lib/disease.dart
0 → 100644
View file @
4b76916e
import
'package:ckd/service/apiDio.dart'
;
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
class
DiseasePred
extends
StatefulWidget
{
const
DiseasePred
({
super
.
key
});
@override
State
<
DiseasePred
>
createState
()
=>
_DiseasePredState
();
}
class
_DiseasePredState
extends
State
<
DiseasePred
>
{
int
Age
=
0
;
String
Gender
=
""
;
String
AKIDiagnosis
=
""
;
double
InitialCreatinine
=
0
;
double
PeakCreatinine
=
0
;
int
UrineOutput
=
0
;
String
Proteinuria
=
""
;
String
Edema
=
""
;
String
Albumin_Level
=
""
;
int
Change_in_Urination
=
0
;
int
Swelling
=
0
;
int
Metallic_Taste_in_Mouth
=
0
;
int
Dizziness_Trouble_Concentrating
=
0
;
int
Pain_in_Back_or_Sides
=
0
;
int
Nausea_Vomiting
=
0
;
String
_Disease
=
""
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
black
),
onPressed:
()
=>
context
.
goNamed
(
'home'
),
),
centerTitle:
true
,
backgroundColor:
Colors
.
blueGrey
,
title:
Text
(
"C-K-D"
),
),
backgroundColor:
Colors
.
blueGrey
.
shade200
,
body:
Center
(
child:
Container
(
width:
450
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
1.2
,
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
blurRadius:
10.0
,
color:
Colors
.
black54
,
//134
),
],
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
40.0
),
bottomRight:
Radius
.
circular
(
40.0
),
topLeft:
Radius
.
circular
(
40.0
),
bottomLeft:
Radius
.
circular
(
40.0
),
),
color:
Colors
.
blueGrey
,
),
child:
SingleChildScrollView
(
child:
Column
(
children:
[
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Age'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Age
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Gender'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Gender
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'AKIDiagnosis'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
AKIDiagnosis
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'InitialCreatinine'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
InitialCreatinine
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'PeakCreatinine'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
PeakCreatinine
=
double
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'UrineOutput'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
UrineOutput
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Proteinuria'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Proteinuria
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Edema'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Edema
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Albumin_Level'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Albumin_Level
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Change_in_Urination'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Change_in_Urination
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Swelling'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Swelling
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Metallic_Taste_in_Mouth'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Metallic_Taste_in_Mouth
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Dizziness_Trouble_Concentrating'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Dizziness_Trouble_Concentrating
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Pain_in_Back_or_Sides'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Pain_in_Back_or_Sides
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Nausea_Vomiting'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Nausea_Vomiting
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
ElevatedButton
(
onPressed:
()
async
{
var
results
=
await
apiDio
().
pedDisease
(
Age
,
Gender
,
AKIDiagnosis
,
InitialCreatinine
,
PeakCreatinine
,
UrineOutput
,
Proteinuria
,
Edema
,
Albumin_Level
,
Change_in_Urination
,
Swelling
,
Metallic_Taste_in_Mouth
,
Dizziness_Trouble_Concentrating
,
Pain_in_Back_or_Sides
,
Nausea_Vomiting
);
setState
(()
{
_Disease
=
results
;
});
},
child:
Text
(
"Check"
),
),
SizedBox
(
height:
10
,
),
Text
(
_Disease
,
style:
TextStyle
(
fontSize:
20
,
color:
Colors
.
white
),
),
SizedBox
(
height:
10
,
),
],
),
),
),
),
);
}
}
IT20154530_Frontend/lib/forcast.dart
0 → 100644
View file @
4b76916e
import
'package:ckd/service/apiDio.dart'
;
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
class
ForeCast
extends
StatefulWidget
{
const
ForeCast
({
super
.
key
});
@override
State
<
ForeCast
>
createState
()
=>
_ForeCastState
();
}
class
_ForeCastState
extends
State
<
ForeCast
>
{
late
String
_date
;
late
int
_sales
;
String
_pred
=
""
;
List
<
dynamic
>
_predictionData
=
[];
bool
_showPredictions
=
false
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
black
),
onPressed:
()
=>
context
.
goNamed
(
'home'
),
),
centerTitle:
true
,
backgroundColor:
Colors
.
blueGrey
,
title:
Text
(
"C-K-D"
),
),
backgroundColor:
Colors
.
blueGrey
.
shade200
,
body:
Center
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
100
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
4
,
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
blurRadius:
10.0
,
color:
Colors
.
black54
,
//134
),
],
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
40.0
),
bottomRight:
Radius
.
circular
(
40.0
),
topLeft:
Radius
.
circular
(
40.0
),
bottomLeft:
Radius
.
circular
(
40.0
),
),
color:
Colors
.
blueGrey
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
10
,
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Date'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
_date
=
value
;
});
},
),
),
SizedBox
(
width:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'sales'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
_sales
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
width:
10
,
),
ElevatedButton
(
onPressed:
()
async
{
var
results
=
await
apiDio
().
predSales
(
_date
,
_sales
);
print
(
results
);
setState
(()
{
_predictionData
=
results
;
_showPredictions
=
true
;
});
},
child:
Text
(
"Predict"
),
),
],
),
SizedBox
(
height:
10
,
),
if
(
_showPredictions
)
SizedBox
(
height:
100
,
width:
600
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
_predictionData
.
map
((
item
)
{
return
PredictionItem
(
date:
item
[
'date'
],
prediction:
item
[
'prediction'
],
);
}).
toList
(),
),
),
],
),
),
),
);
}
}
class
PredictionItem
extends
StatelessWidget
{
final
String
date
;
final
int
prediction
;
PredictionItem
({
required
this
.
date
,
required
this
.
prediction
});
@override
Widget
build
(
BuildContext
context
)
{
return
SizedBox
(
width:
200
,
height:
200
,
child:
Column
(
children:
[
Text
(
"Date:
$date
"
),
Text
(
"Prediction:
$prediction
"
),
],
),
);
// return ListTile(
// title: Text("Date: $date"),
// subtitle: Text("Prediction: $prediction"),
// );
}
}
IT20154530_Frontend/lib/home.dart
0 → 100644
View file @
4b76916e
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
class
Home
extends
StatefulWidget
{
const
Home
({
super
.
key
});
@override
State
<
Home
>
createState
()
=>
_HomeState
();
}
class
_HomeState
extends
State
<
Home
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
backgroundColor:
Colors
.
blueGrey
,
title:
Text
(
"C-K-D"
),
),
backgroundColor:
Colors
.
blueGrey
.
shade200
,
body:
Center
(
child:
Container
(
width:
600
,
height:
600
,
child:
GridView
.
count
(
crossAxisCount:
2
,
padding:
const
EdgeInsets
.
all
(
20
),
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
// shrinkWrap: true,
children:
<
Widget
>[
ElevatedButton
(
onPressed:
()
{
context
.
goNamed
(
'CkdPred'
);
},
style:
ElevatedButton
.
styleFrom
(
shape:
BeveledRectangleBorder
()),
child:
const
Text
(
"CKD"
),
),
ElevatedButton
(
onPressed:
()
{
context
.
goNamed
(
'forcast'
);
},
style:
ElevatedButton
.
styleFrom
(
shape:
BeveledRectangleBorder
()),
child:
const
Text
(
"Forecast"
),
),
ElevatedButton
(
onPressed:
()
{
context
.
goNamed
(
'SuggestDPlan'
);
},
style:
ElevatedButton
.
styleFrom
(
shape:
BeveledRectangleBorder
()),
child:
const
Text
(
"Suggest Diet Plan"
),
),
ElevatedButton
(
onPressed:
()
{
context
.
goNamed
(
'Diseases'
);
},
style:
ElevatedButton
.
styleFrom
(
shape:
BeveledRectangleBorder
()),
child:
const
Text
(
"Diseases"
),
),
],
),
),
),
);
}
}
IT20154530_Frontend/lib/loginPage.dart
0 → 100644
View file @
4b76916e
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
class
LoginPage
extends
StatefulWidget
{
const
LoginPage
({
super
.
key
});
@override
State
<
LoginPage
>
createState
()
=>
_LoginPageState
();
}
class
_LoginPageState
extends
State
<
LoginPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Center
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
120
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
3
,
// color: Colors.deepPurple[200],
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
blurRadius:
10.0
,
color:
Colors
.
blueGrey
,
//134
),
],
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
40.0
),
bottomRight:
Radius
.
circular
(
40.0
),
topLeft:
Radius
.
circular
(
40.0
),
bottomLeft:
Radius
.
circular
(
40.0
),
),
color:
Colors
.
blueGrey
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
const
SizedBox
(
height:
10
,
),
Text
(
"Login"
,
style:
TextStyle
(
fontSize:
30
),
),
const
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Enter your Username'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
// Set border for enabled state (default)
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
// Set border for focused state
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
deepPurple
),
borderRadius:
BorderRadius
.
circular
(
15
),
)),
),
),
const
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
obscureText:
true
,
decoration:
InputDecoration
(
labelText:
'Enter your Password'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
// Set border for enabled state (default)
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
// Set border for focused state
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
deepPurple
),
borderRadius:
BorderRadius
.
circular
(
15
),
)),
),
),
const
SizedBox
(
height:
10
,
),
ElevatedButton
(
onPressed:
()
{
context
.
goNamed
(
'home'
);
},
child:
Text
(
"LogIn"
)),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
"Dont you have an Account :"
),
])),
TextButton
(
style:
TextButton
.
styleFrom
(
foregroundColor:
Colors
.
blue
,
padding:
const
EdgeInsets
.
all
(
16.0
),
textStyle:
const
TextStyle
(
fontSize:
15
),
),
onPressed:
()
{
context
.
goNamed
(
'register'
);
},
child:
const
Text
(
'Register'
),
),
],
),
const
SizedBox
(
height:
10
,
),
],
),
),
),
);
}
}
IT20154530_Frontend/lib/main.dart
0 → 100644
View file @
4b76916e
import
'package:ckd/CkdPred.dart'
;
import
'package:ckd/disease.dart'
;
import
'package:ckd/forcast.dart'
;
import
'package:ckd/registerPage.dart'
;
import
'package:ckd/suggestDietPlan.dart'
;
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
import
'actor.dart'
;
import
'home.dart'
;
import
'loginPage.dart'
;
void
main
(
)
{
runApp
(
const
MyApp
());
}
final
_router
=
GoRouter
(
initialLocation:
'/'
,
routes:
[
GoRoute
(
name:
'Main'
,
path:
'/'
,
builder:
(
context
,
state
)
=>
MyHomePage
(
title:
'C-K-D'
),
),
GoRoute
(
name:
'home'
,
path:
'/home'
,
builder:
(
context
,
state
)
=>
Home
(),
),
GoRoute
(
name:
'CkdPred'
,
path:
'/CkdPred'
,
builder:
(
context
,
state
)
=>
CkdPred
(),
),
GoRoute
(
name:
'login'
,
path:
'/login'
,
builder:
(
context
,
state
)
=>
LoginPage
(),
),
GoRoute
(
name:
'register'
,
path:
'/register'
,
builder:
(
context
,
state
)
=>
RegisterPage
(),
),
GoRoute
(
name:
'forcast'
,
path:
'/forcast'
,
builder:
(
context
,
state
)
=>
ForeCast
(),
),
GoRoute
(
name:
'SuggestDPlan'
,
path:
'/SuggestDPlan'
,
builder:
(
context
,
state
)
=>
SuggestDietPlan
(),
),
GoRoute
(
name:
'Diseases'
,
path:
'/Diseases'
,
builder:
(
context
,
state
)
=>
DiseasePred
(),
),
],
);
class
MyApp
extends
StatelessWidget
{
const
MyApp
({
super
.
key
});
// This widget is the root of your application.
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
.
router
(
routerConfig:
_router
,
title:
'ActX'
,
theme:
ThemeData
(
// colorScheme: ColorScheme.fromSeed(seedColor: Colors.black54),
useMaterial3:
true
,
),
// home: const MyHomePage(title: 'ActX'),
debugShowCheckedModeBanner:
false
,
);
}
}
class
MyHomePage
extends
StatefulWidget
{
const
MyHomePage
({
super
.
key
,
required
this
.
title
});
final
String
title
;
@override
State
<
MyHomePage
>
createState
()
=>
_MyHomePageState
();
}
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
LoginPage
();
}
}
IT20154530_Frontend/lib/registerPage.dart
0 → 100644
View file @
4b76916e
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
class
RegisterPage
extends
StatefulWidget
{
const
RegisterPage
({
super
.
key
});
@override
State
<
RegisterPage
>
createState
()
=>
_RegisterPageState
();
}
class
_RegisterPageState
extends
State
<
RegisterPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Center
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
120
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
3
,
// color: Colors.deepPurple[200],
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
blurRadius:
10.0
,
color:
Colors
.
blueGrey
,
//134
),
],
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
40.0
),
bottomRight:
Radius
.
circular
(
40.0
),
topLeft:
Radius
.
circular
(
40.0
),
bottomLeft:
Radius
.
circular
(
40.0
),
),
color:
Colors
.
blueGrey
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
const
SizedBox
(
height:
10
,
),
Text
(
"Register"
,
style:
TextStyle
(
fontSize:
30
),
),
const
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Enter your Username'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
// Set border for enabled state (default)
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
// Set border for focused state
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
deepPurple
),
borderRadius:
BorderRadius
.
circular
(
15
),
)),
),
),
const
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
obscureText:
true
,
decoration:
InputDecoration
(
labelText:
'Enter your Password'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
// Set border for enabled state (default)
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
// Set border for focused state
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
deepPurple
),
borderRadius:
BorderRadius
.
circular
(
15
),
)),
),
),
const
SizedBox
(
height:
10
,
),
ElevatedButton
(
onPressed:
()
{
context
.
goNamed
(
'home'
);
},
child:
Text
(
"Register"
)),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
"Do you have an Account :"
),
])),
TextButton
(
style:
TextButton
.
styleFrom
(
foregroundColor:
Colors
.
blue
,
padding:
const
EdgeInsets
.
all
(
16.0
),
textStyle:
const
TextStyle
(
fontSize:
15
),
),
onPressed:
()
{
context
.
goNamed
(
'login'
);
},
child:
const
Text
(
'Login'
),
),
],
),
const
SizedBox
(
height:
10
,
),
],
),
),
),
);
}
}
IT20154530_Frontend/lib/service/apiDio.dart
0 → 100644
View file @
4b76916e
import
'dart:convert'
;
import
'dart:typed_data'
;
import
'package:dio/dio.dart'
;
var
options
=
BaseOptions
(
baseUrl:
'http://127.0.0.1:8000'
,
);
var
dio
=
Dio
(
options
);
class
apiDio
{
Map
<
String
,
dynamic
>
createDateSales
(
String
date
,
int
sales
)
{
return
{
"date"
:
date
,
"sales"
:
sales
};
}
Map
<
String
,
dynamic
>
createDisease
(
int
Age
,
String
Gender
,
String
AKIDiagnosis
,
double
InitialCreatinine
,
double
PeakCreatinine
,
int
UrineOutput
,
String
Proteinuria
,
String
Edema
,
String
Albumin_Level
,
int
Change_in_Urination
,
int
Swelling
,
int
Metallic_Taste_in_Mouth
,
int
Dizziness_Trouble_Concentrating
,
int
Pain_in_Back_or_Sides
,
int
Nausea_Vomiting
,
)
{
return
{
"Age"
:
Age
,
"Gender"
:
Gender
,
"AKIDiagnosis"
:
AKIDiagnosis
,
"InitialCreatinine"
:
InitialCreatinine
,
"PeakCreatinine"
:
PeakCreatinine
,
"UrineOutput"
:
UrineOutput
,
"Proteinuria"
:
Proteinuria
,
"Edema"
:
Edema
,
"Albumin_Level"
:
Albumin_Level
,
"Change_in_Urination"
:
Change_in_Urination
,
"Swelling"
:
Swelling
,
"Metallic_Taste_in_Mouth"
:
Metallic_Taste_in_Mouth
,
"Dizziness_Trouble_Concentrating"
:
Dizziness_Trouble_Concentrating
,
"Pain_in_Back_or_Sides"
:
Pain_in_Back_or_Sides
,
'Nausea_Vomiting'
:
Nausea_Vomiting
,
};
}
pedDisease
(
int
Age
,
String
Gender
,
String
AKIDiagnosis
,
double
InitialCreatinine
,
double
PeakCreatinine
,
int
UrineOutput
,
String
Proteinuria
,
String
Edema
,
String
Albumin_Level
,
int
Change_in_Urination
,
int
Swelling
,
int
Metallic_Taste_in_Mouth
,
int
Dizziness_Trouble_Concentrating
,
int
Pain_in_Back_or_Sides
,
int
Nausea_Vomiting
,
)
async
{
try
{
// Create the Dart object with the desired structure
var
createDiseaseData
=
createDisease
(
Age
,
Gender
,
AKIDiagnosis
,
InitialCreatinine
,
PeakCreatinine
,
UrineOutput
,
Proteinuria
,
Edema
,
Albumin_Level
,
Change_in_Urination
,
Swelling
,
Metallic_Taste_in_Mouth
,
Dizziness_Trouble_Concentrating
,
Pain_in_Back_or_Sides
,
Nausea_Vomiting
);
// Convert the Dart object to JSON
String
createDiseaseDataJson
=
json
.
encode
(
createDiseaseData
);
// Make the Dio POST request with JSON data
Response
response
=
await
dio
.
post
(
'/predict_diseas/'
,
data:
createDiseaseDataJson
,
options:
Options
(
contentType:
Headers
.
jsonContentType
,
// Set content type to JSON
));
print
(
response
.
data
);
return
response
.
data
;
// Assuming your FastAPI endpoint returns a message.
}
catch
(
e
)
{
// Handle any errors here
print
(
e
);
return
null
;
// Or return an error message
}
}
Map
<
String
,
dynamic
>
createSuggestPlane
(
int
Age
,
String
Gender
,
int
BMI
,
int
Current_Protein_Intake
,
int
Current_Sodium_Intake
,
int
Current_Potassium_Intake
,
int
Current_Phosphorus_Intake
,
String
Other_Conditions
,
int
GFR
,
int
Proteinuria
,
String
Preferred_Food
,
)
{
return
{
"Age"
:
Age
,
"Gender"
:
Gender
,
"BMI"
:
BMI
,
"Current_Protein_Intake"
:
Current_Protein_Intake
,
"Current_Sodium_Intake"
:
Current_Sodium_Intake
,
"Current_Potassium_Intake"
:
Current_Potassium_Intake
,
"Current_Phosphorus_Intake"
:
Current_Phosphorus_Intake
,
"Other_Conditions"
:
Other_Conditions
,
"GFR"
:
GFR
,
"Proteinuria"
:
Proteinuria
,
"Preferred_Food"
:
Preferred_Food
};
}
SuggestPlane
(
int
Age
,
String
Gender
,
int
BMI
,
int
Current_Protein_Intake
,
int
Current_Sodium_Intake
,
int
Current_Potassium_Intake
,
int
Current_Phosphorus_Intake
,
String
Other_Conditions
,
int
GFR
,
int
Proteinuria
,
String
Preferred_Food
,
)
async
{
try
{
// Create the Dart object with the desired structure
var
SuggestPlaneData
=
createSuggestPlane
(
Age
,
Gender
,
BMI
,
Current_Protein_Intake
,
Current_Sodium_Intake
,
Current_Potassium_Intake
,
Current_Phosphorus_Intake
,
Other_Conditions
,
GFR
,
Proteinuria
,
Preferred_Food
);
// Convert the Dart object to JSON
String
SuggestPlaneDataJson
=
json
.
encode
(
SuggestPlaneData
);
// Make the Dio POST request with JSON data
Response
response
=
await
dio
.
post
(
'/Suggest_Diet_Plan/'
,
data:
SuggestPlaneDataJson
,
options:
Options
(
contentType:
Headers
.
jsonContentType
,
// Set content type to JSON
));
print
(
response
.
data
);
return
response
.
data
;
// Assuming your FastAPI endpoint returns a message.
}
catch
(
e
)
{
// Handle any errors here
print
(
e
);
return
null
;
// Or return an error message
}
}
predSales
(
String
date
,
int
sales
)
async
{
try
{
// Create the Dart object with the desired structure
var
dateSaleData
=
createDateSales
(
date
,
sales
);
// Convert the Dart object to JSON
String
dateSaleDataJson
=
json
.
encode
(
dateSaleData
);
// Make the Dio POST request with JSON data
Response
response
=
await
dio
.
post
(
'/forecast/'
,
data:
dateSaleDataJson
,
options:
Options
(
contentType:
Headers
.
jsonContentType
,
// Set content type to JSON
));
print
(
response
.
data
);
return
response
.
data
;
// Assuming your FastAPI endpoint returns a message.
}
catch
(
e
)
{
// Handle any errors here
print
(
e
);
return
null
;
// Or return an error message
}
}
Map
<
String
,
dynamic
>
createCkdMap
(
int
age
,
double
blood_pressure
,
double
specific_gravity
,
double
albumin
,
double
sugar
,
int
red_blood_cells
,
int
pus_cell
,
int
pus_cell_clumps
,
int
bacteria
,
double
blood_glucose_random
,
double
blood_urea
,
double
serum_creatinine
,
double
sodium
,
double
potassium
,
double
haemoglobin
,
double
packed_cell_volume
,
double
white_blood_cell_count
,
double
red_blood_cell_count
,
int
hypertension
,
int
diabetes_mellitus
,
int
coronary_artery_disease
,
int
appetite
,
int
peda_edema
,
int
aanemia
,
)
{
return
{
"age"
:
age
,
"blood_pressure"
:
blood_pressure
,
"specific_gravity"
:
specific_gravity
,
"albumin"
:
albumin
,
"sugar"
:
sugar
,
"red_blood_cells"
:
red_blood_cells
,
"pus_cell"
:
pus_cell
,
"pus_cell_clumps"
:
pus_cell_clumps
,
"bacteria"
:
bacteria
,
"blood_glucose_random"
:
blood_glucose_random
,
"blood_urea"
:
blood_urea
,
"serum_creatinine"
:
serum_creatinine
,
"sodium"
:
sodium
,
"potassium"
:
potassium
,
"haemoglobin"
:
haemoglobin
,
"packed_cell_volume"
:
packed_cell_volume
,
"white_blood_cell_count"
:
white_blood_cell_count
,
"red_blood_cell_count"
:
red_blood_cell_count
,
"hypertension"
:
hypertension
,
"diabetes_mellitus"
:
diabetes_mellitus
,
"coronary_artery_disease"
:
coronary_artery_disease
,
"appetite"
:
appetite
,
"peda_edema"
:
peda_edema
,
"aanemia"
:
aanemia
};
}
checkCkD
(
int
age
,
double
blood_pressure
,
double
specific_gravity
,
double
albumin
,
double
sugar
,
int
red_blood_cells
,
int
pus_cell
,
int
pus_cell_clumps
,
int
bacteria
,
double
blood_glucose_random
,
double
blood_urea
,
double
serum_creatinine
,
double
sodium
,
double
potassium
,
double
haemoglobin
,
double
packed_cell_volume
,
double
white_blood_cell_count
,
double
red_blood_cell_count
,
int
hypertension
,
int
diabetes_mellitus
,
int
coronary_artery_disease
,
int
appetite
,
int
peda_edema
,
int
aanemia
)
async
{
try
{
var
ckdData
=
createCkdMap
(
age
,
blood_pressure
,
specific_gravity
,
albumin
,
sugar
,
red_blood_cells
,
pus_cell
,
pus_cell_clumps
,
bacteria
,
blood_glucose_random
,
blood_urea
,
serum_creatinine
,
sodium
,
potassium
,
haemoglobin
,
packed_cell_volume
,
white_blood_cell_count
,
red_blood_cell_count
,
hypertension
,
diabetes_mellitus
,
coronary_artery_disease
,
appetite
,
peda_edema
,
aanemia
);
// Convert the Dart object to JSON
String
ckdDataJson
=
json
.
encode
(
ckdData
);
Response
response
=
await
dio
.
post
(
'/predict_ckd/'
,
data:
ckdDataJson
,
options:
Options
(
contentType:
Headers
.
jsonContentType
,
// Set content type to JSON
));
// Response response = await dio.post('/actors/', data: formDataJson);
print
(
response
.
data
);
return
response
.
data
;
}
catch
(
e
)
{
print
(
e
);
return
null
;
}
}
}
IT20154530_Frontend/lib/suggestDietPlan.dart
0 → 100644
View file @
4b76916e
import
'package:ckd/service/apiDio.dart'
;
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
class
SuggestDietPlan
extends
StatefulWidget
{
const
SuggestDietPlan
({
super
.
key
});
@override
State
<
SuggestDietPlan
>
createState
()
=>
_SuggestDietPlanState
();
}
class
_SuggestDietPlanState
extends
State
<
SuggestDietPlan
>
{
late
int
Age
;
late
String
Gender
;
late
int
BMI
;
late
int
Current_Protein_Intake
;
late
int
Current_Sodium_Intake
;
late
int
Current_Potassium_Intake
;
late
int
Current_Phosphorus_Intake
;
late
String
Other_Conditions
;
late
int
GFR
;
late
int
Proteinuria
;
late
String
Preferred_Food
;
String
_Plan
=
""
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
black
),
onPressed:
()
=>
context
.
goNamed
(
'home'
),
),
centerTitle:
true
,
backgroundColor:
Colors
.
blueGrey
,
title:
Text
(
"C-K-D"
),
),
backgroundColor:
Colors
.
blueGrey
.
shade200
,
body:
Center
(
child:
Container
(
width:
450
,
height:
MediaQuery
.
of
(
context
).
size
.
height
/
1.2
,
decoration:
const
BoxDecoration
(
boxShadow:
[
BoxShadow
(
blurRadius:
10.0
,
color:
Colors
.
black54
,
//134
),
],
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
40.0
),
bottomRight:
Radius
.
circular
(
40.0
),
topLeft:
Radius
.
circular
(
40.0
),
bottomLeft:
Radius
.
circular
(
40.0
),
),
color:
Colors
.
blueGrey
,
),
child:
SingleChildScrollView
(
child:
Column
(
// shrinkWrap: true,
// padding: EdgeInsets.all(15.0),
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children:
[
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Age'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Age
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Gender'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Gender
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'BMI'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
BMI
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Current_Protein_Intake'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Current_Protein_Intake
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Current_Sodium_Intake'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Current_Sodium_Intake
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Current_Potassium_Intake'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Current_Potassium_Intake
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Current_Phosphorus_Intake'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Current_Phosphorus_Intake
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Other_Conditions'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Other_Conditions
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'GFR'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
GFR
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Proteinuria'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Proteinuria
=
int
.
parse
(
value
);
});
},
),
),
SizedBox
(
height:
10
,
),
SizedBox
(
width:
250
,
child:
TextField
(
decoration:
InputDecoration
(
labelText:
'Preferred_Food'
,
labelStyle:
const
TextStyle
(
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
),
),
enabledBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Color
.
fromARGB
(
255
,
255
,
255
,
255
)),
borderRadius:
BorderRadius
.
circular
(
15
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
const
BorderSide
(
width:
3
,
color:
Colors
.
black54
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
onChanged:
(
value
)
{
setState
(()
{
Preferred_Food
=
value
;
});
},
),
),
SizedBox
(
height:
10
,
),
ElevatedButton
(
onPressed:
()
async
{
var
results
=
await
apiDio
().
SuggestPlane
(
Age
,
Gender
,
BMI
,
Current_Protein_Intake
,
Current_Sodium_Intake
,
Current_Potassium_Intake
,
Current_Phosphorus_Intake
,
Other_Conditions
,
GFR
,
Proteinuria
,
Preferred_Food
);
print
(
results
);
setState
(()
{
_Plan
=
results
;
});
},
child:
Text
(
"Suggest Plan"
),
),
SizedBox
(
height:
10
,
),
Text
(
_Plan
,
style:
TextStyle
(
fontSize:
20
,
color:
Colors
.
white
),
),
SizedBox
(
height:
10
,
),
],
),
),
),
),
);
}
}
IT20154530_Frontend/pubspec.lock
0 → 100644
View file @
4b76916e
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.17.2"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
url: "https://pub.dev"
source: hosted
version: "1.0.6"
dio:
dependency: "direct main"
description:
name: dio
sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7"
url: "https://pub.dev"
source: hosted
version: "5.3.3"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
file_picker:
dependency: "direct main"
description:
name: file_picker
sha256: be325344c1f3070354a1d84a231a1ba75ea85d413774ec4bdf444c023342e030
url: "https://pub.dev"
source: hosted
version: "5.5.0"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
url: "https://pub.dev"
source: hosted
version: "2.0.3"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
url: "https://pub.dev"
source: hosted
version: "2.0.17"
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"
go_router:
dependency: "direct main"
description:
name: go_router
sha256: a206cc4621a644531a2e05e7774616ab4d9d85eab1f3b0e255f3102937fccab1
url: "https://pub.dev"
source: hosted
version: "12.0.0"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
lints:
dependency: transitive
description:
name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
logging:
dependency: transitive
description:
name: logging
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
matcher:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
path:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
url: "https://pub.dev"
source: hosted
version: "2.1.6"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
url: "https://pub.dev"
source: hosted
version: "1.3.2"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
win32:
dependency: transitive
description:
name: win32
sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3"
url: "https://pub.dev"
source: hosted
version: "5.0.9"
sdks:
dart: ">=3.1.1 <4.0.0"
flutter: ">=3.7.0"
IT20154530_Frontend/pubspec.yaml
0 → 100644
View file @
4b76916e
name
:
ckd
description
:
A new Flutter project.
# 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 is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version
:
1.0.0+1
environment
:
sdk
:
'
>=3.1.1
<4.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
go_router
:
^12.0.0
dio
:
^5.3.2
file_picker
:
^5.5.0
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
:
^2.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 packages.
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
IT20154530_Frontend/test/widget_test.dart
0 → 100644
View file @
4b76916e
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. 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:ckd/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
);
});
}
IT20154530_Frontend/web/favicon.png
0 → 100644
View file @
4b76916e
917 Bytes
IT20154530_Frontend/web/icons/Icon-192.png
0 → 100644
View file @
4b76916e
5.17 KB
IT20154530_Frontend/web/icons/Icon-512.png
0 → 100644
View file @
4b76916e
8.06 KB
IT20154530_Frontend/web/icons/Icon-maskable-192.png
0 → 100644
View file @
4b76916e
5.46 KB
IT20154530_Frontend/web/icons/Icon-maskable-512.png
0 → 100644
View file @
4b76916e
20.5 KB
IT20154530_Frontend/web/index.html
0 → 100644
View file @
4b76916e
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base
href=
"$FLUTTER_BASE_HREF"
>
<meta
charset=
"UTF-8"
>
<meta
content=
"IE=Edge"
http-equiv=
"X-UA-Compatible"
>
<meta
name=
"description"
content=
"A new Flutter project."
>
<!-- 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=
"ckd"
>
<link
rel=
"apple-touch-icon"
href=
"icons/Icon-192.png"
>
<!-- Favicon -->
<link
rel=
"icon"
type=
"image/png"
href=
"favicon.png"
/>
<title>
ckd
</title>
<link
rel=
"manifest"
href=
"manifest.json"
>
<script>
// The value below is injected by flutter build, do not touch.
const
serviceWorkerVersion
=
null
;
</script>
<!-- This script adds the flutter initialization JS code -->
<script
src=
"flutter.js"
defer
></script>
</head>
<body>
<script>
window
.
addEventListener
(
'
load
'
,
function
(
ev
)
{
// Download main.dart.js
_flutter
.
loader
.
loadEntrypoint
({
serviceWorker
:
{
serviceWorkerVersion
:
serviceWorkerVersion
,
},
onEntrypointLoaded
:
function
(
engineInitializer
)
{
engineInitializer
.
initializeEngine
().
then
(
function
(
appRunner
)
{
appRunner
.
runApp
();
});
}
});
});
</script>
</body>
</html>
IT20154530_Frontend/web/manifest.json
0 → 100644
View file @
4b76916e
{
"name"
:
"ckd"
,
"short_name"
:
"ckd"
,
"start_url"
:
"."
,
"display"
:
"standalone"
,
"background_color"
:
"#0175C2"
,
"theme_color"
:
"#0175C2"
,
"description"
:
"A new Flutter project."
,
"orientation"
:
"portrait-primary"
,
"prefer_related_applications"
:
false
,
"icons"
:
[
{
"src"
:
"icons/Icon-192.png"
,
"sizes"
:
"192x192"
,
"type"
:
"image/png"
},
{
"src"
:
"icons/Icon-512.png"
,
"sizes"
:
"512x512"
,
"type"
:
"image/png"
},
{
"src"
:
"icons/Icon-maskable-192.png"
,
"sizes"
:
"192x192"
,
"type"
:
"image/png"
,
"purpose"
:
"maskable"
},
{
"src"
:
"icons/Icon-maskable-512.png"
,
"sizes"
:
"512x512"
,
"type"
:
"image/png"
,
"purpose"
:
"maskable"
}
]
}
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