├── .gitignore ├── Backend ├── account │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── admin.cpython-37.pyc │ │ ├── apps.cpython-37.pyc │ │ ├── models.cpython-37.pyc │ │ ├── serializers.cpython-37.pyc │ │ ├── urls.cpython-37.pyc │ │ └── views.cpython-37.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ └── __init__.cpython-37.pyc │ ├── models.py │ ├── serializers.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── db.sqlite3 ├── healthcare │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── settings.cpython-37.pyc │ │ ├── urls.cpython-37.pyc │ │ └── wsgi.cpython-37.pyc │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── help.txt ├── manage.py ├── records │ ├── admin.py │ ├── apps.py │ ├── models.py │ ├── serializers.py │ ├── tests.py │ ├── urls.py │ └── views.py └── requirements.txt ├── README.md ├── assets └── images │ ├── down.png │ ├── empty.png │ ├── fill2.png │ ├── no_internet.png │ ├── profile.png │ └── sheet.png ├── lib ├── api │ └── API.dart ├── common │ ├── CWidget.dart │ ├── Controller.dart │ ├── SnapConditions.dart │ └── ThemePage.dart ├── main.dart └── pages │ ├── Home.dart │ ├── profile │ ├── EditProfile.dart │ └── Profile.dart │ ├── records │ ├── basicdetails │ │ ├── GetBasicDetails.dart │ │ └── PatchDetails.dart │ └── dailyrecords │ │ ├── Chart.dart │ │ ├── DailyRecords.dart │ │ ├── GetRecord.dart │ │ └── PostDailyrecord.dart │ └── registration │ └── Signin.dart ├── pubspec.yaml ├── screenshots ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png └── 7.png └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | /Backend/myenv 2 | /Backend/myenv/help.txt 3 | /android 4 | /build 5 | /ios 6 | /web 7 | /windows 8 | /bin 9 | /help.txt 10 | /pubspec.lock -------------------------------------------------------------------------------- /Backend/account/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__init__.py -------------------------------------------------------------------------------- /Backend/account/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/__pycache__/apps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__pycache__/apps.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/__pycache__/serializers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__pycache__/serializers.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.contrib.auth.models import User 3 | from .models import * 4 | 5 | class AccountMClass(admin.ModelAdmin): 6 | list_display = ['id','username','first_name','last_name','email'] 7 | 8 | admin.site.unregister(User) 9 | admin.site.register(User,AccountMClass) 10 | -------------------------------------------------------------------------------- /Backend/account/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'account' 7 | -------------------------------------------------------------------------------- /Backend/account/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/migrations/__init__.py -------------------------------------------------------------------------------- /Backend/account/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/account/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/account/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Backend/account/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from django.contrib.auth.models import User 3 | 4 | class ProfileMS(serializers.ModelSerializer): 5 | class Meta: 6 | model = User 7 | fields = ['id','username','first_name','last_name','email'] -------------------------------------------------------------------------------- /Backend/account/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Backend/account/urls.py: -------------------------------------------------------------------------------- 1 | from account import views 2 | from rest_framework import routers 3 | from django.urls import path 4 | from django.conf.urls import include 5 | from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView 6 | 7 | router =routers.DefaultRouter() 8 | router.register('profile',views.UsersC ,basename='profile') 9 | 10 | 11 | urlpatterns = [ 12 | path('',include(router.urls)), 13 | ] -------------------------------------------------------------------------------- /Backend/account/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | from rest_framework import response,status,viewsets 5 | from django.contrib.auth.models import User 6 | from . import serializers as UserModelSerializer 7 | from django.shortcuts import get_object_or_404 8 | from rest_framework.authtoken.views import ObtainAuthToken 9 | from rest_framework.settings import api_settings 10 | 11 | from rest_framework import authentication, permissions 12 | 13 | class UsersC(viewsets.ViewSet): 14 | permission_classes = (permissions.IsAuthenticated,) 15 | serializer_class=UserModelSerializer.ProfileMS 16 | queryset=User.objects.all() 17 | 18 | def list(self,request): 19 | print(request.user) 20 | serializer=self.serializer_class(self.queryset,many=True) 21 | return response.Response(serializer.data) 22 | 23 | def retrieve(self,request,pk=None): 24 | blog=get_object_or_404(self.queryset,pk=pk) 25 | print('*'*20) 26 | print(blog) 27 | serializer=self.serializer_class(blog) 28 | return response.Response(serializer.data) 29 | 30 | def create(self,request): 31 | data=request.data 32 | serializer=self.serializer_class(data=data) 33 | serializer.is_valid(raise_exception=True) 34 | serializer.save() 35 | return response.Response(serializer.data) 36 | 37 | def update(self,request,pk=None): 38 | 39 | blog=get_object_or_404(self.queryset,pk=pk) 40 | data=request.data 41 | serializer=self.serializer_class(blog,data) 42 | serializer.is_valid(raise_exception=True) 43 | serializer.save() 44 | return response.Response(serializer.data) 45 | 46 | def partial_update(self,request,pk=None): 47 | blog=get_object_or_404(self.queryset,pk=pk) 48 | data=request.data 49 | serializer=self.serializer_class(blog,data,partial=True) 50 | serializer.is_valid(raise_exception=True) 51 | serializer.save() 52 | return response.Response(serializer.data,status=200) 53 | 54 | def destroy(self,request,pk=None): 55 | instances=get_object_or_404(self.queryset,pk=pk) 56 | instances.delete() 57 | return response.Response(status=200) 58 | 59 | # this is for browsable login API 60 | class UserLoginView(ObtainAuthToken): 61 | renderer_classes=api_settings.DEFAULT_RENDERER_CLASSES -------------------------------------------------------------------------------- /Backend/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/db.sqlite3 -------------------------------------------------------------------------------- /Backend/healthcare/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/healthcare/__init__.py -------------------------------------------------------------------------------- /Backend/healthcare/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/healthcare/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/healthcare/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/healthcare/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/healthcare/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/healthcare/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/healthcare/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/Backend/healthcare/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Backend/healthcare/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for healthcare project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'healthcare.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Backend/healthcare/settings.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | BASE_DIR = Path(__file__).resolve().parent.parent 4 | 5 | 6 | #FIXME 7 | # SECURITY WARNING: keep the secret key used in production secret! 8 | SECRET_KEY = '' 9 | 10 | DEBUG = True 11 | 12 | ALLOWED_HOSTS = [ 13 | '127.0.0.1', 14 | 15 | ] 16 | 17 | 18 | # Application definition 19 | 20 | INSTALLED_APPS = [ 21 | 'django.contrib.admin', 22 | 'django.contrib.auth', 23 | 'django.contrib.contenttypes', 24 | 'django.contrib.sessions', 25 | 'django.contrib.messages', 26 | 'django.contrib.staticfiles', 27 | 'records', 28 | 'account', 29 | # Third-Party Apps 30 | 'rest_framework', 31 | 'rest_framework.authtoken', 32 | 'rest_framework_simplejwt', 33 | ] 34 | 35 | MIDDLEWARE = [ 36 | 'django.middleware.security.SecurityMiddleware', 37 | 'django.contrib.sessions.middleware.SessionMiddleware', 38 | 'django.middleware.common.CommonMiddleware', 39 | 'django.middleware.csrf.CsrfViewMiddleware', 40 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 41 | 'django.contrib.messages.middleware.MessageMiddleware', 42 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 43 | ] 44 | 45 | ROOT_URLCONF = 'healthcare.urls' 46 | 47 | TEMPLATES = [ 48 | { 49 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 50 | 'DIRS': [], 51 | 'APP_DIRS': True, 52 | 'OPTIONS': { 53 | 'context_processors': [ 54 | 'django.template.context_processors.debug', 55 | 'django.template.context_processors.request', 56 | 'django.contrib.auth.context_processors.auth', 57 | 'django.contrib.messages.context_processors.messages', 58 | ], 59 | }, 60 | }, 61 | ] 62 | 63 | WSGI_APPLICATION = 'healthcare.wsgi.application' 64 | 65 | 66 | # Database 67 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases 68 | 69 | DATABASES = { 70 | 'default': { 71 | 'ENGINE': 'django.db.backends.sqlite3', 72 | 'NAME': BASE_DIR / 'db.sqlite3', 73 | } 74 | } 75 | 76 | 77 | # Password validation 78 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators 79 | 80 | AUTH_PASSWORD_VALIDATORS = [ 81 | { 82 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 83 | }, 84 | { 85 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 86 | }, 87 | { 88 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 89 | }, 90 | { 91 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 92 | }, 93 | ] 94 | 95 | 96 | LANGUAGE_CODE = 'en-us' 97 | 98 | TIME_ZONE = 'UTC' 99 | 100 | USE_I18N = True 101 | 102 | USE_L10N = True 103 | 104 | USE_TZ = True 105 | 106 | 107 | STATIC_URL = '/static/' 108 | 109 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 110 | REST_FRAMEWORK = { 111 | 'DEFAULT_AUTHENTICATION_CLASSES': [ 112 | 'rest_framework_simplejwt.authentication.JWTAuthentication', 113 | ], 114 | 115 | } 116 | -------------------------------------------------------------------------------- /Backend/healthcare/urls.py: -------------------------------------------------------------------------------- 1 | """healthcare URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from django.urls.conf import include 19 | # from rest_framework.authtoken.views import obtain_auth_token # token-auth 20 | from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView # jwt-auth 21 | 22 | urlpatterns = [ 23 | path('admin/', admin.site.urls), 24 | path('u/',include('account.urls')), 25 | path('',include('records.urls')), 26 | # path('api-auth',include('rest_framework.urls')), 27 | # path('token-auth/', obtain_auth_token, name='api_token_auth'), # token-auth 28 | path('api/token/', TokenObtainPairView.as_view()), # jwt-auth 29 | path('api/token/refresh/',TokenRefreshView.as_view()) 30 | ] 31 | -------------------------------------------------------------------------------- /Backend/healthcare/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for healthcare project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'healthcare.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Backend/help.txt: -------------------------------------------------------------------------------- 1 | conda activate ashabbenv 2 | python manage.py runserver 192.168.43.58:8000 3 | myenv\scripts\activate.bat 4 | python manage.py runserver 5 | 6 | python manage.py makemigrations 7 | python manage.py migrate 8 | 9 | 10 | django 11 | djangorestframework 12 | markdown 13 | djangorestframework-simplejwt 14 | 15 | src 16 | https://stackoverflow.com/questions/14838128/django-rest-framework-token-authentication 17 | 18 | 19 | Toekn Authentication 20 | ===================================== 21 | 1. 22 | settings.py 23 | 24 | INSTALLED_APPS = [ 25 | . 26 | . 27 | . 28 | 'rest_framework.authtoken', 29 | ] 30 | --- 31 | REST_FRAMEWORK = { 32 | 'DEFAULT_PERMISSION_CLASSES':('rest_framework.permissions.IsAuthenticated',) , 33 | 'DEFAULT_AUTHENTICATION_CLASSES': ( 34 | 'rest_framework.authentication.TokenAuthentication', 35 | ) 36 | } 37 | 2. 38 | project > urls.py 39 | 40 | from rest_framework.authtoken.views import obtain_auth_token 41 | 42 | urlpatterns = [ 43 | path('token-auth/', obtain_auth_token, name='api_token_auth'), 44 | ] 45 | 3. 46 | app > views.py 47 | 48 | from rest_framework.permissions import IsAuthenticated 49 | from rest_framework import authentication 50 | 51 | authentication_classes = (authentication.TokenAuthentication,) 52 | permission_classes = (IsAuthenticated,) 53 | ===================================== 54 | 55 | 56 | pip install httpie 57 | curl -X POST http://127.0.0.1:8000/token-auth/ username="admin" password="12345" -------------------------------------------------------------------------------- /Backend/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'healthcare.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Backend/records/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import * 3 | 4 | class BasicDetailsMClass(admin.ModelAdmin): 5 | list_display = ['id','user','covid_test_done','covid_test_type','covid_test_report'] 6 | 7 | admin.site.register(BasicDetailsM,BasicDetailsMClass) 8 | 9 | class CategoryMClass(admin.ModelAdmin): 10 | list_display = ['user','cname'] 11 | 12 | class DailyRecordsNameMA(admin.ModelAdmin): 13 | list_display = ['id','recordname'] 14 | 15 | admin.site.register(DailyRecordsNameM,DailyRecordsNameMA) 16 | 17 | class DailyRecordsValueMA(admin.ModelAdmin): 18 | list_display = ['user','recordname','value','datetime'] 19 | 20 | admin.site.register(DailyRecordsValueM,DailyRecordsValueMA) 21 | -------------------------------------------------------------------------------- /Backend/records/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class RecordsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'records' 7 | -------------------------------------------------------------------------------- /Backend/records/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | 4 | class BasicDetailsM(models.Model): 5 | user = models.ForeignKey(User, on_delete=models.CASCADE) 6 | date_of_diagnosis = models.DateTimeField(auto_now=True) 7 | admitted_in_hospital = models.DateTimeField(auto_now=True) 8 | covid_test_done = models.CharField(max_length=50) 9 | covid_test_type = models.CharField(max_length=50) 10 | covid_test_report = models.CharField(max_length=50) 11 | 12 | def __str__(self): 13 | return str(self.user) 14 | 15 | # class CategoryM(models.Model): 16 | # user = models.ForeignKey(User, on_delete=models.CASCADE) 17 | # cname = models.CharField(max_length=255) 18 | 19 | # def __str__(self): 20 | # return (self.cname) 21 | 22 | # class SubCategoryM(models.Model): 23 | # user = models.ForeignKey(User, on_delete=models.CASCADE) 24 | # cname = models.ForeignKey(CategoryM,on_delete=models.CASCADE) 25 | # sname = models.CharField(max_length=255) 26 | # value = models.CharField(max_length=255) 27 | # datetime=models.DateTimeField(auto_now=True) 28 | 29 | # def __str__(self): 30 | # return str(self.sname) 31 | 32 | class DailyRecordsNameM(models.Model): 33 | recordname = models.CharField(max_length=255) 34 | def __str__(self): 35 | return str(self.recordname) 36 | 37 | class DailyRecordsValueM(models.Model): 38 | user = models.ForeignKey(User, on_delete=models.CASCADE,related_name="user") 39 | recordname = models.ForeignKey(DailyRecordsNameM, on_delete=models.CASCADE,related_name="record") 40 | value = models.IntegerField() 41 | datetime = models.DateTimeField(auto_now=True) 42 | 43 | def __str__(self): 44 | return str(self.user) 45 | -------------------------------------------------------------------------------- /Backend/records/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import * 3 | 4 | class BasicDetailsMS(serializers.ModelSerializer): 5 | class Meta: 6 | model = BasicDetailsM 7 | fields = '__all__' 8 | 9 | # class CategoryMS(serializers.ModelSerializer): 10 | # class Meta: 11 | # model = CategoryM 12 | # fields = '__all__' 13 | 14 | # class SubCategoryMS(serializers.ModelSerializer): 15 | # class Meta: 16 | # model = SubCategoryM 17 | # fields = '__all__' 18 | 19 | class DailyRecordsNameMS(serializers.ModelSerializer): 20 | class Meta: 21 | model = DailyRecordsNameM 22 | fields = ['recordname'] 23 | 24 | class DailyRecordsValueMS(serializers.ModelSerializer): 25 | # recordname = DailyRecordsNameMS() 26 | 27 | class Meta: 28 | model = DailyRecordsValueM 29 | fields = '__all__' 30 | -------------------------------------------------------------------------------- /Backend/records/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Backend/records/urls.py: -------------------------------------------------------------------------------- 1 | from records import views 2 | from rest_framework import routers 3 | from django.urls import path 4 | from django.conf.urls import include 5 | 6 | router =routers.DefaultRouter() 7 | 8 | router.register('besicdetails',views.BasicDetailsC ,basename='BasicDetailsM') 9 | router.register('dailyrecords',views.DailyRecordsC ,basename='DailyRecordsC') 10 | 11 | urlpatterns = [ 12 | path('',include(router.urls)), 13 | ] -------------------------------------------------------------------------------- /Backend/records/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | from rest_framework import views,response,status,viewsets,permissions 4 | from . import models as RecordsModel 5 | from . import serializers as RecordsModelSerializer 6 | from django.shortcuts import get_object_or_404 7 | from rest_framework import authentication, permissions 8 | 9 | 10 | class BasicDetailsC(viewsets.ViewSet): 11 | permission_classes = (permissions.IsAuthenticated,) 12 | serializer_class=RecordsModelSerializer.BasicDetailsMS 13 | queryset=RecordsModel.BasicDetailsM.objects.all() 14 | 15 | def list(self,request): 16 | print(request.user) 17 | serializer=self.serializer_class(self.queryset,many=True) 18 | return response.Response(serializer.data) 19 | 20 | def retrieve(self,request,pk=None): 21 | blog=get_object_or_404(self.queryset,user_id=pk) 22 | print('*'*20) 23 | print(blog) 24 | serializer=self.serializer_class(blog) 25 | return response.Response(serializer.data) 26 | 27 | def create(self,request): 28 | data=request.data 29 | serializer=self.serializer_class(data=data) 30 | serializer.is_valid(raise_exception=True) 31 | serializer.save() 32 | return response.Response(serializer.data) 33 | 34 | def update(self,request,pk=None): 35 | blog=get_object_or_404(self.queryset,user_id=pk) 36 | data=request.data 37 | serializer=self.serializer_class(blog,data) 38 | serializer.is_valid(raise_exception=True) 39 | serializer.save() 40 | return response.Response(serializer.data) 41 | 42 | def partial_update(self,request,pk=None): 43 | blog=get_object_or_404(self.queryset,user_id=pk) 44 | data=request.data 45 | serializer=self.serializer_class(blog,data,partial=True) 46 | serializer.is_valid(raise_exception=True) 47 | serializer.save() 48 | return response.Response(serializer.data,status=200) 49 | 50 | def destroy(self,request,pk=None): 51 | instances=get_object_or_404(self.queryset,pk=pk) 52 | instances.delete() 53 | return response.Response(status=200) 54 | 55 | class DailyRecordsC(viewsets.ViewSet): 56 | permission_classes = (permissions.IsAuthenticated,) 57 | serializer_class=RecordsModelSerializer.DailyRecordsValueMS 58 | queryset=RecordsModel.DailyRecordsValueM.objects.all() 59 | 60 | def list(self,request): 61 | print(request.user) 62 | serializer=self.serializer_class(self.queryset,many=True) 63 | return response.Response(serializer.data) 64 | 65 | def retrieve(self,request,pk=None,): 66 | blog=RecordsModel.DailyRecordsValueM.objects.filter(user_id=pk) 67 | print('*'*20) 68 | print(blog) 69 | return response.Response(list(blog.values())) 70 | 71 | def create(self,request): 72 | data=request.data 73 | serializer=self.serializer_class(data=data) 74 | serializer.is_valid(raise_exception=True) 75 | serializer.save() 76 | return response.Response(serializer.data) 77 | 78 | def update(self,request,pk=None): 79 | blog=get_object_or_404(self.queryset,pk=pk) 80 | data=request.data 81 | serializer=self.serializer_class(blog,data) 82 | serializer.is_valid(raise_exception=True) 83 | serializer.save() 84 | return response.Response(serializer.data) 85 | 86 | def partial_update(self,request,pk=None): 87 | blog=get_object_or_404(self.queryset,pk=pk) 88 | data=request.data 89 | serializer=self.serializer_class(blog,data,partial=True) 90 | serializer.is_valid(raise_exception=True) 91 | serializer.save() 92 | return response.Response(serializer.data,status=200) 93 | 94 | def destroy(self,request,pk=None): 95 | instances=RecordsModel.DailyRecordsValueM.objects.filter(user_id=pk) 96 | instances.delete() 97 | return response.Response(status=200) 98 | -------------------------------------------------------------------------------- /Backend/requirements.txt: -------------------------------------------------------------------------------- 1 | django 2 | djangorestframework 3 | markdown 4 | djangorestframework-simplejwt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | *** 3 | # Django Flutter CRUD Operations - DoctorApp 4 | 5 | *** 6 | # About 7 | 8 | This is Full stack Applcaition. Frontend is developed using `Flutter` and Backend is `Django`. 9 | This is doctor demo application where patients their health data. 10 | 11 | *** 12 | # Tags 13 | 14 | `flutter` `djanog` `rest framework` `REST API` `permissions` `authentication` `authorization` `ORM` 15 | 16 | *** 17 | # Screenshots 18 | 19 | ![text](https://github.com/ashgole/Django-Flutter-Application-CRUD-operations-DoctorApp/blob/master/screenshots/1.png) 20 | ![text](https://github.com/ashgole/Django-Flutter-Application-CRUD-operations-DoctorApp/blob/master/screenshots/2.png) 21 | ![text](https://github.com/ashgole/Django-Flutter-Application-CRUD-operations-DoctorApp/blob/master/screenshots/3.png) 22 | ![text](https://github.com/ashgole/Django-Flutter-Application-CRUD-operations-DoctorApp/blob/master/screenshots/4.png) 23 | ![text](https://github.com/ashgole/Django-Flutter-Application-CRUD-operations-DoctorApp/blob/master/screenshots/5.png) 24 | ![text](https://github.com/ashgole/Django-Flutter-Application-CRUD-operations-DoctorApp/blob/master/screenshots/6.png) 25 | ![text](https://github.com/ashgole/Django-Flutter-Application-CRUD-operations-DoctorApp/blob/master/screenshots/7.png) 26 | 27 | *** 28 | # Help 29 | ``` 30 | Django commands 31 | 32 | 1. create virtual environment 33 | 2. run following commands 34 | pip install -r requirements.txt 35 | python manage.py runserver 36 | python manage.py makemigrations 37 | python manage.py migrate 38 | ``` 39 | 40 | ``` 41 | Flutter commands 42 | 43 | flutter pub get 44 | flutter run 45 | ``` 46 | -------------------------------------------------------------------------------- /assets/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/assets/images/down.png -------------------------------------------------------------------------------- /assets/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/assets/images/empty.png -------------------------------------------------------------------------------- /assets/images/fill2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/assets/images/fill2.png -------------------------------------------------------------------------------- /assets/images/no_internet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/assets/images/no_internet.png -------------------------------------------------------------------------------- /assets/images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/assets/images/profile.png -------------------------------------------------------------------------------- /assets/images/sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/assets/images/sheet.png -------------------------------------------------------------------------------- /lib/api/API.dart: -------------------------------------------------------------------------------- 1 | // https://flutter.dev/docs/cookbook#networking 2 | import 'dart:convert'; 3 | import 'package:doctorapp/common/CWidget.dart'; 4 | import 'package:doctorapp/common/Controller.dart'; 5 | import 'package:doctorapp/pages/Home.dart'; 6 | import 'package:get/get.dart'; 7 | import 'package:http/http.dart' as http; 8 | 9 | final controller = Get.put(ControllerPage()); 10 | final ControllerPage ctrl = Get.find(); 11 | 12 | loginData(url, data) async { 13 | print('--login--' * 5); 14 | final response = await http.post( 15 | Uri.parse(serversite + url), 16 | headers: { 17 | 'Content-Type': 'application/json; charset=UTF-8', 18 | }, 19 | body: jsonEncode(data), 20 | ); 21 | final responseJson = jsonDecode(response.body); 22 | if (response.statusCode == 200) { 23 | succesSnack('success', 'Signin successfully'); 24 | controller.setToken(responseJson['access']); 25 | Get.off(Home()); 26 | } else { 27 | failedSnack('success', 'Failed to Post'); 28 | } 29 | } 30 | 31 | getData(url) async { 32 | print('+--get--' * 5); 33 | final response = await http.get( 34 | Uri.parse(serversite + url), 35 | headers: { 36 | 'Content-Type': 'application/json; charset=UTF-8', 37 | "Authorization": ctrl.authtoken, 38 | }, 39 | ); 40 | final responseJson = jsonDecode(response.body); 41 | if (response.statusCode == 200) { 42 | return responseJson; 43 | } else { 44 | failedSnack('success', 'Failed to load'); 45 | } 46 | } 47 | 48 | postData(url, data) async { 49 | print('--post--' * 5); 50 | final response = await http.post( 51 | Uri.parse(serversite + url), 52 | headers: { 53 | 'Content-Type': 'application/json; charset=UTF-8', 54 | "Authorization": ctrl.authtoken, 55 | }, 56 | body: jsonEncode(data), 57 | ); 58 | if (response.statusCode == 200) { 59 | succesSnack('success', 'Posted successfully'); 60 | return null; 61 | } else { 62 | failedSnack('success', 'Failed to Post'); 63 | } 64 | } 65 | 66 | patchData(url, data) async { 67 | print('--patch--' * 5); 68 | final response = await http.patch( 69 | Uri.parse(serversite + url), 70 | headers: { 71 | 'Content-Type': 'application/json; charset=UTF-8', 72 | "Authorization": ctrl.authtoken, 73 | }, 74 | body: jsonEncode(data), 75 | ); 76 | if (response.statusCode == 200) { 77 | succesSnack('success', 'Updated successfully'); 78 | return null; 79 | } else { 80 | failedSnack('success', 'Failed to Update'); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/common/CWidget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_form_builder/flutter_form_builder.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | Widget lt(title, subtitle) { 6 | return ListTile( 7 | title: Text(title.toString()), subtitle: Text(subtitle.toString())); 8 | } 9 | 10 | Widget tf(c2, name, reg, use) { 11 | return Container( 12 | margin: const EdgeInsets.fromLTRB(0, 5, 0, 5), 13 | child: FormBuilderTextField( 14 | controller: c2, 15 | // initialValue: iv2, 16 | maxLength: 15, 17 | name: name, 18 | keyboardType: 19 | name == 'Phone no' ? TextInputType.number : TextInputType.text, 20 | textInputAction: TextInputAction.next, 21 | decoration: new InputDecoration( 22 | labelText: name, 23 | contentPadding: EdgeInsets.all(10), 24 | border: new OutlineInputBorder( 25 | borderRadius: new BorderRadius.circular(5.0), 26 | borderSide: new BorderSide(color: Colors.blue))), 27 | validator: (value) { 28 | if (value.isEmpty) { 29 | return "Please enter $name"; 30 | } 31 | if (reg.hasMatch(value)) { 32 | } else { 33 | return use; 34 | } 35 | return null; 36 | }), 37 | ); 38 | } 39 | 40 | //--okbutton 41 | button(name, function) { 42 | return ElevatedButton( 43 | child: Text(name, style: TextStyle(fontSize: 15)), 44 | onPressed: () => function(), 45 | // Perform some action 46 | ); 47 | } 48 | 49 | Widget d() { 50 | return Divider(thickness: 1.0); 51 | } 52 | 53 | Widget tf2(c2, name, reg, use, type) { 54 | return Container( 55 | margin: const EdgeInsets.all(5.0), 56 | child: FormBuilderTextField( 57 | controller: c2, 58 | // initialValue: iv2, 59 | maxLength: 20, 60 | name: name, 61 | keyboardType: type, 62 | textInputAction: TextInputAction.next, 63 | decoration: new InputDecoration( 64 | labelText: name, 65 | contentPadding: EdgeInsets.all(10), 66 | border: new OutlineInputBorder( 67 | borderRadius: new BorderRadius.circular(5.0), 68 | borderSide: new BorderSide(color: Colors.blue))), 69 | validator: (value) { 70 | if (value.isEmpty) { 71 | return "Please enter $name"; 72 | } 73 | if (reg.hasMatch(value)) { 74 | } else { 75 | return use; 76 | } 77 | return null; 78 | }), 79 | ); 80 | } 81 | 82 | //--oksnack 83 | succesSnack(title, subtitle) { 84 | Get.snackbar( 85 | title, 86 | subtitle, 87 | colorText: Colors.white, 88 | backgroundColor: Colors.black, 89 | snackPosition: SnackPosition.TOP, 90 | borderRadius: 5.0, 91 | margin: const EdgeInsets.all(10), 92 | duration: const Duration(milliseconds: 2000), 93 | ); 94 | } 95 | 96 | failedSnack(title, subtitle) { 97 | Get.snackbar( 98 | title, 99 | subtitle, 100 | colorText: Colors.white, 101 | backgroundColor: Colors.red, 102 | borderRadius: 5.0, 103 | snackPosition: SnackPosition.TOP, 104 | margin: const EdgeInsets.all(10), 105 | duration: const Duration(milliseconds: 1000), 106 | ); 107 | } 108 | 109 | // errorsnack(title, subtitle) { 110 | // Get.snackbar( 111 | // title, 112 | // subtitle, 113 | // colorText: Colors.white, 114 | // backgroundColor: Colors.redAccent, 115 | // snackPosition: SnackPosition.TOP, 116 | // borderRadius: 5.0, 117 | // margin: const EdgeInsets.all(10), 118 | // duration: const Duration(milliseconds: 2000), 119 | // ); 120 | // } 121 | 122 | // Widget datetimeW(setdate, type) { 123 | // return Container( 124 | // margin: const EdgeInsets.all(5.0), 125 | // child: FormBuilderDateTimePicker( 126 | // name: 'date', 127 | // inputType: type, 128 | // decoration: InputDecoration( 129 | // labelText: 'Select The Date', 130 | // border: new OutlineInputBorder( 131 | // borderRadius: new BorderRadius.circular(15.0), 132 | // )), 133 | // onChanged: (value) { 134 | // setdate(value.toString()); 135 | // }, 136 | // validator: (value) { 137 | // if (value == null) { 138 | // return "Please select date"; 139 | // } 140 | // return null; 141 | // }, 142 | // )); 143 | // } 144 | 145 | // Widget chip(title, page) { 146 | // return InkWell( 147 | // onTap: () => Get.to(page), 148 | // child: Container( 149 | // margin: const EdgeInsets.fromLTRB(5, 0, 0, 0), 150 | // child: Chip( 151 | // elevation: 3, 152 | // padding: const EdgeInsets.all(5), 153 | // backgroundColor: Colors.blue, 154 | // avatar: CircleAvatar( 155 | // backgroundColor: Colors.white, 156 | // child: Icon( 157 | // Icons.edit, 158 | // size: 15, 159 | // color: Colors.blue, 160 | // ), 161 | // ), 162 | // label: Text( 163 | // title, 164 | // style: TextStyle( 165 | // fontSize: 15, 166 | // color: Colors.white, 167 | // ), 168 | // )), 169 | // ), 170 | // ); 171 | // } 172 | -------------------------------------------------------------------------------- /lib/common/Controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get_state_manager/src/simple/get_controllers.dart'; 2 | 3 | var serversite = 'http://192.168.43.58:8000/'; 4 | 5 | class ControllerPage extends GetxController { 6 | String authtoken; 7 | void setToken(token) { 8 | print('*' * 20); 9 | print(token); 10 | authtoken = 'Bearer ' + token; 11 | update(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/common/SnapConditions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | Widget snapWaiting(context) { 4 | return Center( 5 | child: CircularProgressIndicator(), 6 | ); 7 | } 8 | 9 | Widget snapError() { 10 | return Center( 11 | child: SingleChildScrollView( 12 | child: Padding( 13 | padding: const EdgeInsets.all(10.0), 14 | child: Column( 15 | children: [ 16 | Container( 17 | height: 200, 18 | width: double.infinity, 19 | decoration: BoxDecoration( 20 | image: DecorationImage( 21 | fit: BoxFit.contain, 22 | image: Image.asset('assets/images/down.png').image, 23 | ), 24 | )), 25 | Text( 26 | 'check your internet econnection or server is down', 27 | style: TextStyle(color: Colors.red), 28 | ) 29 | ], 30 | ), 31 | ), 32 | ), 33 | ); 34 | } 35 | 36 | Widget snapNoData(context) { 37 | return Center( 38 | child: SingleChildScrollView( 39 | child: Column( 40 | children: [ 41 | Container( 42 | height: MediaQuery.of(context).size.height / 100 * 50, 43 | width: double.infinity, 44 | decoration: BoxDecoration( 45 | image: DecorationImage( 46 | fit: BoxFit.contain, 47 | image: Image.asset('assets/images/empty.png').image, 48 | ), 49 | )), 50 | Text( 51 | 'Empty', 52 | style: TextStyle(color: Colors.red), 53 | ) 54 | ], 55 | ), 56 | ), 57 | ); 58 | } 59 | 60 | Widget snapNoConnection(context) { 61 | return Center( 62 | child: SingleChildScrollView( 63 | child: Column( 64 | children: [ 65 | Container( 66 | height: MediaQuery.of(context).size.height / 100 * 50, 67 | width: double.infinity, 68 | decoration: BoxDecoration( 69 | image: DecorationImage( 70 | fit: BoxFit.contain, 71 | image: Image.asset('assets/images/no_internet.png').image, 72 | ), 73 | )), 74 | Text( 75 | 'No Internet', 76 | style: TextStyle(color: Colors.red), 77 | ) 78 | ], 79 | ), 80 | ), 81 | ); 82 | } 83 | -------------------------------------------------------------------------------- /lib/common/ThemePage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //-- 4 | 5 | ThemeData lightTheme() { 6 | return ThemeData( 7 | scaffoldBackgroundColor: Colors.white, 8 | primaryColor: Colors.blue, 9 | accentColor: Colors.blue, 10 | fontFamily: 'Georgia', 11 | appBarTheme: AppBarTheme( 12 | foregroundColor: Colors.white, 13 | backgroundColor: Colors.blue, 14 | iconTheme: IconThemeData(color: Colors.white), 15 | elevation: 5, 16 | titleTextStyle: TextStyle( 17 | color: Colors.white, fontSize: 20, fontWeight: FontWeight.normal), 18 | ), 19 | textTheme: TextTheme( 20 | headline1: TextStyle( 21 | color: Colors.black, fontSize: 17, fontWeight: FontWeight.normal), 22 | 23 | headline5: TextStyle( 24 | color: Colors.black, fontSize: 9, fontWeight: FontWeight.normal), 25 | 26 | //appbar listtile 27 | subtitle1: TextStyle( 28 | color: Colors.black, fontSize: 17, fontWeight: FontWeight.normal), 29 | // appBar: AppBar( 30 | // title: Text('My Doctor', 31 | // style: Theme.of(context).textTheme.subtitle1), 32 | // ), 33 | //appbar listtile white 34 | subtitle2: TextStyle( 35 | color: Colors.white, fontSize: 17, fontWeight: FontWeight.normal), 36 | //caption 37 | headline6: TextStyle( 38 | color: Colors.blue, fontSize: 17, fontWeight: FontWeight.normal), 39 | ), 40 | // buttonTheme: ButtonThemeData( 41 | // buttonColor: Colors.blueAccent, 42 | // shape: RoundedRectangleBorder( 43 | // borderRadius: new BorderRadius.circular(20.0), 44 | // ), 45 | // textTheme: ButtonTextTheme.accent, 46 | 47 | // ), 48 | elevatedButtonTheme: ElevatedButtonThemeData( 49 | style: ButtonStyle( 50 | // textStyle: MaterialStateProperty. ( 51 | // color: Colors.white, fontSize: 17, fontWeight: FontWeight.normal), 52 | shape: MaterialStateProperty.all( 53 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))), 54 | foregroundColor: MaterialStateProperty.all(Colors.white), 55 | padding: MaterialStateProperty.all( 56 | EdgeInsets.fromLTRB(25, 10, 25, 10)), 57 | backgroundColor: MaterialStateProperty.all(Colors.blue), 58 | )), 59 | outlinedButtonTheme: OutlinedButtonThemeData( 60 | style: ButtonStyle( 61 | foregroundColor: MaterialStateProperty.all(Colors.black), 62 | padding: MaterialStateProperty.all(EdgeInsets.all(10)), 63 | )), 64 | iconTheme: IconThemeData( 65 | color: Colors.black, 66 | size: 30, 67 | ), 68 | cardTheme: CardTheme( 69 | // color: Colors.blue[100], 70 | elevation: 5, 71 | margin: EdgeInsets.all(10), 72 | shape: RoundedRectangleBorder( 73 | borderRadius: const BorderRadius.all( 74 | Radius.circular(15.0), 75 | ))), 76 | ); 77 | } 78 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/pages/registration/Signin.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'common/ThemePage.dart'; 4 | import 'package:get/get.dart'; 5 | 6 | void main() { 7 | runApp(MyApp()); 8 | } 9 | 10 | class MyApp extends StatelessWidget { 11 | @override 12 | Widget build(BuildContext context) { 13 | return GetMaterialApp( 14 | theme: lightTheme(), 15 | debugShowCheckedModeBanner: false, 16 | home: Signin(), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/pages/Home.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/pages/profile/Profile.dart'; 2 | import 'package:doctorapp/pages/records/basicdetails/GetBasicDetails.dart'; 3 | import 'package:doctorapp/pages/records/dailyrecords/DailyRecords.dart'; 4 | import 'package:doctorapp/pages/registration/Signin.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:get/get.dart'; 7 | 8 | class Home extends StatefulWidget { 9 | @override 10 | _HomeState createState() => _HomeState(); 11 | } 12 | 13 | class _HomeState extends State { 14 | @override 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar(title: Text('Health Care')), 19 | body: GridView.count( 20 | physics: 21 | BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()), 22 | padding: const EdgeInsets.all(20), 23 | crossAxisSpacing: 10, 24 | mainAxisSpacing: 10, 25 | crossAxisCount: 2, 26 | children: [ 27 | grid(context, 'fill2', GetBasicDetails(), 'Basic Details'), 28 | grid(context, 'sheet', DailyRecords(), 'Enter Daily Records'), 29 | grid(context, 'profile', Profile(), 'My Profile'), 30 | ])); 31 | } 32 | } 33 | 34 | Widget grid(context, pic, page, label) { 35 | return InkWell( 36 | onTap: () => Get.to( 37 | page, 38 | ), 39 | child: Card( 40 | elevation: 5, 41 | child: Container( 42 | padding: const EdgeInsets.all(8), 43 | child: Column( 44 | children: [ 45 | Expanded( 46 | child: Container( 47 | decoration: new BoxDecoration( 48 | image: DecorationImage( 49 | fit: BoxFit.fitWidth, 50 | image: Image.asset('assets/images/$pic.png').image, 51 | ), 52 | ), 53 | ), 54 | ), 55 | Text("$label"), 56 | ], 57 | )), 58 | ), 59 | ); 60 | } 61 | -------------------------------------------------------------------------------- /lib/pages/profile/EditProfile.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/api/API.dart'; 2 | import 'package:doctorapp/common/CWidget.dart'; 3 | import 'package:doctorapp/common/SnapConditions.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | final nameR = RegExp(r'^[a-zA-Z]+$'); 7 | final String nameU = 'use a-z | A-Z'; 8 | TextEditingController username = TextEditingController(); 9 | TextEditingController firstName = TextEditingController(); 10 | TextEditingController lastName = TextEditingController(); 11 | TextEditingController email = TextEditingController(); 12 | 13 | class EditProfile extends StatefulWidget { 14 | @override 15 | _EditProfileState createState() => _EditProfileState(); 16 | } 17 | 18 | class _EditProfileState extends State { 19 | final _formKey = GlobalKey(); 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar(title: Text('Update Profile')), 24 | body: Form( 25 | key: _formKey, 26 | child: 27 | ListView(padding: const EdgeInsets.all(15), children: [show()])), 28 | ); 29 | } 30 | } 31 | 32 | Widget show() { 33 | return FutureBuilder( 34 | future: getData('u/profile/1/'), 35 | builder: (BuildContext context, snapshot) { 36 | if (snapshot.connectionState == ConnectionState.waiting) { 37 | return snapWaiting(context); 38 | } else if (snapshot.connectionState == ConnectionState.done) { 39 | if (snapshot.hasError) { 40 | return snapError(); 41 | } else if (!snapshot.hasData || snapshot.data?.length == 0) { 42 | return snapNoData(context); 43 | } 44 | } 45 | if (snapshot.hasData) { 46 | try { 47 | var data = snapshot.data; 48 | return Column(children: [ 49 | tf(username, data['username'].toString(), nameR, nameU), 50 | tf(firstName, data['first_name'].toString(), nameR, nameU), 51 | tf(lastName, data['last_name'].toString(), nameR, nameU), 52 | tf2(email, data['email'].toString(), nameR, nameU, 53 | TextInputType.emailAddress), 54 | button('Update', patch), 55 | ]); 56 | } catch (e) { 57 | print(e); 58 | return Center(child: Text('Something went wrong...')); 59 | } 60 | } 61 | return snapNoConnection(context); 62 | }); 63 | } 64 | 65 | patch() { 66 | Map data = { 67 | "username": username.text, 68 | "first_name": firstName.text, 69 | "last_name": lastName.text, 70 | "email": email.text, 71 | }; 72 | patchData('u/profile/1/', data); 73 | } 74 | -------------------------------------------------------------------------------- /lib/pages/profile/Profile.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/api/API.dart'; 2 | import 'package:doctorapp/common/CWidget.dart'; 3 | import 'package:doctorapp/common/SnapConditions.dart'; 4 | import 'package:doctorapp/pages/profile/EditProfile.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class Profile extends StatefulWidget { 8 | @override 9 | _ProfileState createState() => _ProfileState(); 10 | } 11 | 12 | class _ProfileState extends State { 13 | @override 14 | void initState() { 15 | super.initState(); 16 | } 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: AppBar(title: Text('Profile')), 22 | body: ListView( 23 | children: [ 24 | profileBox(context, 'ashabb', 'ashgole@gmail.com'), 25 | profilleData(), 26 | ], 27 | )); 28 | } 29 | } 30 | 31 | //--* 32 | Widget profileBox( 33 | context, 34 | name, 35 | email, 36 | ) { 37 | return Container( 38 | color: Colors.green, 39 | padding: const EdgeInsets.all(5), 40 | height: 180, 41 | child: Column( 42 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 43 | children: [ 44 | Padding( 45 | padding: EdgeInsets.all(10), 46 | child: CircleAvatar( 47 | radius: 50.0, 48 | backgroundImage: Image.asset('assets/images/profile.png').image, 49 | ), 50 | ), 51 | Padding( 52 | padding: EdgeInsets.all(0), 53 | child: Column( 54 | children: [ 55 | Text('$name', 56 | style: TextStyle(color: Colors.white, fontSize: 18)), 57 | Text('$email', 58 | style: TextStyle( 59 | color: Colors.white, 60 | )), 61 | ], 62 | ), 63 | ), 64 | ], 65 | )); 66 | } 67 | 68 | Widget profilleData() { 69 | return FutureBuilder( 70 | future: getData('u/profile/1/'), 71 | builder: (BuildContext context, snapshot) { 72 | if (snapshot.connectionState == ConnectionState.waiting) { 73 | return snapWaiting(context); 74 | } else if (snapshot.connectionState == ConnectionState.done) { 75 | if (snapshot.hasError) { 76 | return snapError(); 77 | } else if (!snapshot.hasData || snapshot.data?.length == 0) { 78 | return snapNoData(context); 79 | } 80 | } 81 | if (snapshot.hasData) { 82 | try { 83 | var data = snapshot.data; 84 | return Column(children: [ 85 | lt('Username', data['username'].toString()), 86 | d(), 87 | lt('Firstname:', data['first_name'].toString()), 88 | d(), 89 | lt('Lastname:', data['last_name'].toString()), 90 | d(), 91 | lt('Email:', data['email'].toString()), 92 | d(), 93 | ElevatedButton( 94 | child: Text('Update Profile', style: TextStyle(fontSize: 15)), 95 | onPressed: () => gottoEditProfile(context), 96 | // Perform some action 97 | ), 98 | ]); 99 | } catch (e) { 100 | print(e); 101 | return Center(child: Text('Something went wrong...')); 102 | } 103 | } 104 | return snapNoConnection(context); 105 | }); 106 | } 107 | 108 | gottoEditProfile(context) { 109 | Navigator.push( 110 | context, 111 | MaterialPageRoute( 112 | builder: (context) => EditProfile(), 113 | ), 114 | ); 115 | } 116 | -------------------------------------------------------------------------------- /lib/pages/records/basicdetails/GetBasicDetails.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/api/API.dart'; 2 | import 'package:doctorapp/common/CWidget.dart'; 3 | import 'package:doctorapp/common/SnapConditions.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | import 'PatchDetails.dart'; 8 | 9 | class GetBasicDetails extends StatefulWidget { 10 | @override 11 | _GetBasicDetailsState createState() => _GetBasicDetailsState(); 12 | } 13 | 14 | class _GetBasicDetailsState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar(title: Text('Basic Details')), 19 | body: ListView( 20 | children: [ 21 | profilleData(), 22 | ], 23 | )); 24 | } 25 | } 26 | 27 | Widget profilleData() { 28 | return FutureBuilder( 29 | future: getData('besicdetails/1/'), 30 | builder: (BuildContext context, snapshot) { 31 | if (snapshot.connectionState == ConnectionState.waiting) { 32 | return snapWaiting(context); 33 | } else if (snapshot.connectionState == ConnectionState.done) { 34 | if (snapshot.hasError) { 35 | return snapError(); 36 | } else if (!snapshot.hasData || snapshot.data?.length == 0) { 37 | return snapNoData(context); 38 | } 39 | } 40 | if (snapshot.hasData) { 41 | try { 42 | var data = snapshot.data; 43 | return Column(children: [ 44 | lt('Covid Test Done', data['covid_test_done'].toString()), 45 | d(), 46 | lt('Covid Test Type:', data['covid_test_type'].toString()), 47 | d(), 48 | lt('Covid Test Report:', data['covid_test_report'].toString()), 49 | ElevatedButton( 50 | child: Text('Update Basic Details', 51 | style: TextStyle(fontSize: 15)), 52 | onPressed: () => Get.to(PatchDetails()), 53 | // Perform some action 54 | ), 55 | ]); 56 | } catch (e) { 57 | print(e); 58 | return Center(child: Text('Something went wrong...')); 59 | } 60 | } 61 | return snapNoConnection(context); 62 | }); 63 | } 64 | -------------------------------------------------------------------------------- /lib/pages/records/basicdetails/PatchDetails.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/api/API.dart'; 2 | import 'package:doctorapp/common/CWidget.dart'; 3 | import 'package:doctorapp/common/SnapConditions.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | final nameR = RegExp(r'^[a-zA-Z]+$'); 7 | final String nameU = 'use a-z | A-Z'; 8 | TextEditingController ctd = TextEditingController(); 9 | TextEditingController ctt = TextEditingController(); 10 | TextEditingController ctr = TextEditingController(); 11 | 12 | class PatchDetails extends StatefulWidget { 13 | @override 14 | _PatchDetailsState createState() => _PatchDetailsState(); 15 | } 16 | 17 | class _PatchDetailsState extends State { 18 | final _formKey = GlobalKey(); 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: AppBar(title: Text('Update Basic Details')), 23 | body: Form( 24 | key: _formKey, 25 | child: 26 | ListView(padding: const EdgeInsets.all(15), children: [show()])), 27 | ); 28 | } 29 | 30 | Widget show() { 31 | return FutureBuilder( 32 | future: getData('besicdetails/1/'), 33 | builder: (BuildContext context, snapshot) { 34 | if (snapshot.connectionState == ConnectionState.waiting) { 35 | return snapWaiting(context); 36 | } else if (snapshot.connectionState == ConnectionState.done) { 37 | if (snapshot.hasError) { 38 | return snapError(); 39 | } else if (!snapshot.hasData || snapshot.data?.length == 0) { 40 | return snapNoData(context); 41 | } 42 | } 43 | if (snapshot.hasData) { 44 | try { 45 | var data = snapshot.data; 46 | return Column( 47 | crossAxisAlignment: CrossAxisAlignment.start, 48 | children: [ 49 | Text('Covid Test Done ? '), 50 | tf(ctd, data['covid_test_done'].toString(), nameR, nameU), 51 | Text('Covid Test Type'), 52 | tf(ctt, data['covid_test_type'].toString(), nameR, nameU), 53 | Text('Covid Test Report'), 54 | tf(ctr, data['covid_test_report'].toString(), nameR, nameU), 55 | button('Update', patch), 56 | ]); 57 | } catch (e) { 58 | print(e); 59 | return Center(child: Text('Something went wrong...')); 60 | } 61 | } 62 | return snapNoConnection(context); 63 | }); 64 | } 65 | } 66 | 67 | patch() { 68 | Map data = { 69 | 'covid_test_done': ctd.text, 70 | 'covid_test_type': ctt.text, 71 | 'covid_test_report': ctr.text 72 | }; 73 | patchData('besicdetails/1/', data); 74 | } 75 | -------------------------------------------------------------------------------- /lib/pages/records/dailyrecords/Chart.dart: -------------------------------------------------------------------------------- 1 | //https://pub.dev/packages/syncfusion_flutter_charts/example 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:syncfusion_flutter_charts/charts.dart'; 5 | 6 | Widget chart(title, timeArray, recordArray) { 7 | List dataL = []; 8 | for (int i = 0; i < timeArray.length; i++) { 9 | dataL.add(Record(timeArray[i], recordArray[i])); 10 | } 11 | return SfCartesianChart( 12 | primaryXAxis: CategoryAxis(), 13 | // title: ChartTitle(text: '$title'), 14 | // legend: Legend(isVisible: true, title: LegendTitle(text: "$title")), 15 | tooltipBehavior: TooltipBehavior(enable: true), 16 | series: [ 17 | LineSeries( 18 | name: '$title', 19 | color: Colors.red, 20 | xAxisName: 'Dates', 21 | yAxisName: 'Values', 22 | dataSource: dataL, 23 | xValueMapper: (Record value, _) => value.time.toString(), 24 | yValueMapper: (Record value, _) => value.r2), 25 | ]); 26 | } 27 | 28 | class Record { 29 | Record(this.time, this.r2); 30 | final int time; 31 | final int r2; 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/records/dailyrecords/DailyRecords.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/pages/records/dailyrecords/GetRecord.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | import 'PostDailyrecord.dart'; 6 | 7 | class DailyRecords extends StatefulWidget { 8 | DailyRecords({Key key}) : super(key: key); 9 | 10 | @override 11 | _DailyRecordsState createState() => _DailyRecordsState(); 12 | } 13 | 14 | class _DailyRecordsState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | body: MaterialApp( 19 | debugShowCheckedModeBanner: false, 20 | home: DefaultTabController( 21 | length: 4, 22 | child: Scaffold( 23 | appBar: AppBar( 24 | title: Text('Daily Records'), 25 | actions: [ 26 | IconButton( 27 | tooltip: 'Add Daily Records', 28 | icon: Icon(Icons.add), 29 | onPressed: () { 30 | Get.to( 31 | PostDailyrecord(), 32 | ); 33 | }, 34 | ), 35 | ], 36 | bottom: TabBar( 37 | isScrollable: true, 38 | labelPadding: EdgeInsets.all(15), 39 | tabs: [ 40 | Text('BP', 41 | style: Theme.of(context).textTheme.subtitle2), 42 | Text('Pulse Rate', 43 | style: Theme.of(context).textTheme.subtitle2), 44 | Text('Respiration Rate', 45 | style: Theme.of(context).textTheme.subtitle2), 46 | Text('Body Temperature', 47 | style: Theme.of(context).textTheme.subtitle2), 48 | ], 49 | )), 50 | body: TabBarView( 51 | children: [ 52 | getRecord(1), 53 | getRecord(2), 54 | getRecord(3), 55 | getRecord(4), 56 | ], 57 | ), 58 | )))); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/pages/records/dailyrecords/GetRecord.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/api/API.dart'; 2 | import 'package:doctorapp/common/SnapConditions.dart'; 3 | import 'package:doctorapp/pages/records/dailyrecords/Chart.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | Widget getRecord(recordId) { 7 | return FutureBuilder( 8 | future: getData('dailyrecords/1/'), 9 | builder: (BuildContext context, snapshot) { 10 | if (snapshot.connectionState == ConnectionState.waiting) { 11 | return snapWaiting(context); 12 | } else if (snapshot.connectionState == ConnectionState.done) { 13 | if (snapshot.hasError) { 14 | return snapError(); 15 | } else if (!snapshot.hasData || snapshot.data?.length == 0) { 16 | return snapNoData(context); 17 | } 18 | } 19 | if (snapshot.hasData) { 20 | try { 21 | var data = snapshot.data; 22 | var recordArray1 = 23 | data.where((e) => e['recordname_id'] == recordId).toList(); 24 | List recordArray = []; 25 | List timeArray = []; 26 | for (int i = 0; i < recordArray1.length; i++) { 27 | recordArray.add(recordArray1[i]['value']); 28 | timeArray 29 | .add(int.parse(recordArray1[i]['datetime'].substring(8, 10))); 30 | } 31 | 32 | return SingleChildScrollView( 33 | child: Column( 34 | children: [ 35 | Container( padding: const EdgeInsets.all(10), 36 | height: MediaQuery.of(context).size.height / 100 * 30, 37 | child: chart('Blood Pressure', timeArray, recordArray)), 38 | Container( 39 | padding: const EdgeInsets.all(10), 40 | height: MediaQuery.of(context).size.height / 100 * 50, 41 | child: ListView.builder( 42 | itemCount: timeArray.length, 43 | itemBuilder: (BuildContext context, int index) { 44 | return Row( 45 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 46 | children: [ 47 | Text(timeArray[index].toString()), 48 | Text(recordArray[index].toString()), 49 | IconButton( 50 | onPressed: () {}, 51 | icon: Icon(Icons.edit), 52 | color: Colors.black, 53 | ), 54 | IconButton( 55 | onPressed: () {}, 56 | icon: Icon(Icons.delete), 57 | color: Colors.black, 58 | ), 59 | ], 60 | ); 61 | }, 62 | )), 63 | ], 64 | )); 65 | } catch (e) { 66 | print(e); 67 | return Center(child: Text('Something went wrong...')); 68 | } 69 | } 70 | return snapNoConnection(context); 71 | }); 72 | } 73 | -------------------------------------------------------------------------------- /lib/pages/records/dailyrecords/PostDailyrecord.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/api/API.dart'; 2 | import 'package:doctorapp/common/CWidget.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_form_builder/flutter_form_builder.dart'; 5 | 6 | final nameR = RegExp(r'^[a-zA-Z]+$'); 7 | final String nameU = 'use a-z | A-Z'; 8 | 9 | class PostDailyrecord extends StatefulWidget { 10 | @override 11 | _PostDailyrecordState createState() => _PostDailyrecordState(); 12 | } 13 | 14 | class _PostDailyrecordState extends State { 15 | final _postDRKey = GlobalKey(); 16 | String recordname; 17 | TextEditingController value = TextEditingController(); 18 | List options = [ 19 | 'BP', 20 | 'Pulse Rate', 21 | 'Respiration Rate', 22 | 'Body Temperature' 23 | ]; 24 | 25 | void setRecordName(name) { 26 | setState(() { 27 | recordname = name; 28 | }); 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return Scaffold( 34 | appBar: AppBar(title: Text('Add Daily Records')), 35 | body: Form( 36 | key: _postDRKey, 37 | child: ListView(padding: const EdgeInsets.all(15), children: [ 38 | Container( 39 | padding: const EdgeInsets.all(5), 40 | child: FormBuilderDropdown( 41 | name: 'Deases', 42 | decoration: InputDecoration( 43 | border: new OutlineInputBorder( 44 | borderRadius: new BorderRadius.circular(5.0), 45 | borderSide: new BorderSide(color: Colors.blue)), 46 | ), 47 | allowClear: true, 48 | hint: Text('Select Deases'), 49 | validator: FormBuilderValidators.compose( 50 | [FormBuilderValidators.required(context)]), 51 | onChanged: (value) { 52 | setRecordName(value); 53 | }, 54 | items: options 55 | .map((name) => DropdownMenuItem( 56 | value: name, 57 | child: Text('$name'), 58 | )) 59 | .toList(), 60 | ), 61 | ), 62 | tf2(value, 'Reacord Value', nameR, nameU, TextInputType.number), 63 | button('Add Daily Record', postRecord), 64 | ])), 65 | ); 66 | } 67 | 68 | postRecord() { 69 | if (recordname == null) { 70 | } else { 71 | int id = options.indexOf(recordname); 72 | Map dataToBePost = {"user": 1, "recordname": id + 1, "value": value.text}; 73 | postData('dailyrecords/', dataToBePost); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/pages/registration/Signin.dart: -------------------------------------------------------------------------------- 1 | import 'package:doctorapp/api/API.dart'; 2 | import 'package:doctorapp/common/CWidget.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | final nameR = RegExp(r'^[a-zA-Z]+$'); 6 | final String nameU = 'use a-z | A-Z'; 7 | TextEditingController username = TextEditingController(); 8 | TextEditingController password = TextEditingController(); 9 | 10 | class Signin extends StatefulWidget { 11 | @override 12 | _SigninState createState() => _SigninState(); 13 | } 14 | 15 | class _SigninState extends State { 16 | final _signin = GlobalKey(); 17 | 18 | List options = [ 19 | 'BP', 20 | 'Pulse Rate', 21 | 'Respiration Rate', 22 | 'Body Temperature' 23 | ]; 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Scaffold( 28 | body: Container( 29 | padding: const EdgeInsets.all(15), 30 | child: Form( 31 | key: _signin, 32 | child: 33 | Column(mainAxisAlignment: MainAxisAlignment.center, children: [ 34 | tf( 35 | username, 36 | 'username', 37 | nameR, 38 | nameU, 39 | ), 40 | tf2(password, 'Password', nameR, nameU, TextInputType.number), 41 | button('Signin', login), 42 | ])), 43 | ), 44 | ); 45 | } 46 | } 47 | 48 | login() { 49 | Map data = { 50 | 'username': username.text, 51 | 'password': password.text, 52 | }; 53 | loginData('api/token/', data); 54 | } 55 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: doctorapp 2 | description: A new Flutter project. 3 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.7.0 <3.0.0" 8 | 9 | dependencies: 10 | cupertino_icons: ^1.0.2 11 | flutter: 12 | sdk: flutter 13 | flutter_form_builder: ^6.1.0+1 14 | get: ^4.3.8 15 | http: ^0.13.3 16 | syncfusion_flutter_charts: ^19.2.62 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | 22 | # For information on the generic Dart part of this file, see the 23 | # following page: https://dart.dev/tools/pub/pubspec 24 | # The following section is specific to Flutter. 25 | flutter: 26 | 27 | # The following line ensures that the Material Icons font is 28 | # included with your application, so that you can use the icons in 29 | # the material Icons class. 30 | uses-material-design: true 31 | 32 | # To add assets to your application, add an assets section, like this: 33 | assets: 34 | - assets/images/no_internet.png 35 | - assets/images/profile.png 36 | - assets/images/fill2.png 37 | - assets/images/sheet.png 38 | - assets/images/empty.png 39 | - assets/images/down.png 40 | -------------------------------------------------------------------------------- /screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/screenshots/1.png -------------------------------------------------------------------------------- /screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/screenshots/2.png -------------------------------------------------------------------------------- /screenshots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/screenshots/3.png -------------------------------------------------------------------------------- /screenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/screenshots/4.png -------------------------------------------------------------------------------- /screenshots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/screenshots/5.png -------------------------------------------------------------------------------- /screenshots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/screenshots/6.png -------------------------------------------------------------------------------- /screenshots/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashgole/Django-Flutter-CRUD-operations-DoctorApp/edb07ae83c7308ea4e283520bebbcd6cec866894/screenshots/7.png -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:doctorapp/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------