inserido o progress indicator
@@ -25,8 +25,14 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
compileSdkVersion 33
|
||||||
ndkVersion flutter.ndkVersion
|
ndkVersion flutter.ndkVersion
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@@ -43,21 +49,40 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
||||||
applicationId "com.ab.rkm.rkm"
|
applicationId "com.ab.rkm.rkm"
|
||||||
// You can update the following values to match your application needs.
|
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
debug {
|
||||||
|
keyAlias keystoreProperties['keyAlias']
|
||||||
|
keyPassword keystoreProperties['keyPassword']
|
||||||
|
storeFile file(keystoreProperties['storeFile'])
|
||||||
|
storePassword keystoreProperties['storePassword']
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
keyAlias keystoreProperties['keyAlias']
|
||||||
|
keyPassword keystoreProperties['keyPassword']
|
||||||
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||||
|
storePassword keystoreProperties['storePassword']
|
||||||
|
}
|
||||||
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
minifyEnabled true
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
shrinkResources false
|
||||||
|
lintOptions {
|
||||||
|
disable 'InvalidPackage'
|
||||||
|
disable "Instantiatable"
|
||||||
|
checkReleaseBuilds false
|
||||||
|
abortOnError false
|
||||||
|
|
||||||
|
}
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
android/app/src/debug/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
||||||
BIN
android/app/src/debug/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
android/app/src/debug/res/mipmap-hdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
android/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
android/app/src/debug/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
android/app/src/debug/res/mipmap-mdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
android/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 12 KiB |
BIN
android/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 23 KiB |
BIN
android/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 35 KiB |
BIN
android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#B7E0FD</color>
|
||||||
|
</resources>
|
||||||
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536M
|
org.gradle.jvmargs=-Xmx1536M
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
android.suppressUnsupportedCompileSdk=33
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
distributionUrl=https://services.gradle.org/distributions/gradle-7.2-all.zip
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:gainer_crypto/crypto.dart';
|
import 'package:gainer_crypto/crypto.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:rkm/service/db/db_querys.dart';
|
import 'package:rkm/service/db/db_querys.dart';
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class _ImportSigtapScreenState extends State<ImportSigtapScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
stage = "Etapa 2 de 4 - Gravando os Procedimentos no Aplicativo";
|
stage = "Etapa 2 de 4 - Gravando os Procedimentos no Aplicativo";
|
||||||
});
|
});
|
||||||
// print(value['procedimentos']);
|
// print(valueAPI['procedimentos']);
|
||||||
await DbSqliteSigtap().saveProceduresSigtapDB(valueAPI['procedimentos']).then((value)async{
|
await DbSqliteSigtap().saveProceduresSigtapDB(valueAPI['procedimentos']).then((value)async{
|
||||||
await DbSqliteSigtap().saveProceduresRegisterSigtapDB(valueAPI['procedimentosRegistros']).then((value)async{
|
await DbSqliteSigtap().saveProceduresRegisterSigtapDB(valueAPI['procedimentosRegistros']).then((value)async{
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:rkm/config/color_palette.dart';
|
|||||||
import 'package:rkm/widgets/alert_dialog_default.dart';
|
import 'package:rkm/widgets/alert_dialog_default.dart';
|
||||||
import 'package:rkm/widgets/button_default.dart';
|
import 'package:rkm/widgets/button_default.dart';
|
||||||
import 'package:rkm/widgets/text_default.dart';
|
import 'package:rkm/widgets/text_default.dart';
|
||||||
|
import '../config/const_variable.dart';
|
||||||
import '../service/api/api_data_load.dart';
|
import '../service/api/api_data_load.dart';
|
||||||
import '../service/db/db_sqlite_load.dart';
|
import '../service/db/db_sqlite_load.dart';
|
||||||
import '../service/shared_preferences/shared_preferences_service.dart';
|
import '../service/shared_preferences/shared_preferences_service.dart';
|
||||||
@@ -25,6 +26,8 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
|||||||
bool loading = false;
|
bool loading = false;
|
||||||
String nameCityApi = '';
|
String nameCityApi = '';
|
||||||
String user = '';
|
String user = '';
|
||||||
|
double countProg = 0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@@ -53,16 +56,30 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
|||||||
print('idUsuario $idUsuario');
|
print('idUsuario $idUsuario');
|
||||||
_prefService.createCacheidUsuario(idUsuario).then((value)async{
|
_prefService.createCacheidUsuario(idUsuario).then((value)async{
|
||||||
await ApiDataLoad().loadUnidades(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadUnidades(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
if(value.length !=0){
|
List list = value;
|
||||||
|
if(list.length !=0){
|
||||||
setState(() {
|
setState(() {
|
||||||
messageSteps = "Etapa 1 de 7 - Gravando as Unidades no Aplicativo";
|
messageSteps = "Etapa 1 de 7 - Gravando as Unidades no Aplicativo";
|
||||||
});
|
});
|
||||||
await DbSqliteLoad().saveUnidadesDB(value).then((value)async{
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteLoad().saveUnidadesDB(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataLoad().loadProcedimentos(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadProcedimentos(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
setState(() {
|
setState(() {
|
||||||
messageSteps = "Etapa 2 de 7 - Gravando os Procedimentos no Aplicativo";
|
messageSteps = "Etapa 2 de 7 - Gravando os Procedimentos no Aplicativo";
|
||||||
});
|
});
|
||||||
await DbSqliteLoad().saveProceduresDB(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteLoad().saveProceduresDB(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
print('finalizou save Procedures');
|
print('finalizou save Procedures');
|
||||||
await ApiDataLoad().loadProcedimentosRegistros(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadProcedimentosRegistros(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
await DbSqliteLoad().saveProceduresRegisterDB(value).then((value)async{
|
await DbSqliteLoad().saveProceduresRegisterDB(value).then((value)async{
|
||||||
@@ -72,7 +89,14 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
messageSteps = "Etapa 3 de 7 - Gravando os CIDs no Aplicativo";
|
messageSteps = "Etapa 3 de 7 - Gravando os CIDs no Aplicativo";
|
||||||
});
|
});
|
||||||
await DbSqliteLoad().saveCID(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteLoad().saveCID(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
print('finalizou saveCID');
|
print('finalizou saveCID');
|
||||||
await ApiDataLoad().loadProcedimentosCID(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadProcedimentosCID(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
print('loadProcedimentosCID');
|
print('loadProcedimentosCID');
|
||||||
@@ -83,7 +107,14 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
messageSteps = "Etapa 4 de 7 - Gravando os CBOs no Aplicativo";
|
messageSteps = "Etapa 4 de 7 - Gravando os CBOs no Aplicativo";
|
||||||
});
|
});
|
||||||
await DbSqliteLoad().saveCBO(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteLoad().saveCBO(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
print('finalizou saveCBO');
|
print('finalizou saveCBO');
|
||||||
await ApiDataLoad().loadProcedimentosCBO(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadProcedimentosCBO(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
print('loadProcedimentosCBO');
|
print('loadProcedimentosCBO');
|
||||||
@@ -94,21 +125,41 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
messageSteps = "Etapa 5 de 7 - Gravando os CIAPs no Aplicativo";
|
messageSteps = "Etapa 5 de 7 - Gravando os CIAPs no Aplicativo";
|
||||||
});
|
});
|
||||||
await DbSqliteLoad().saveCIAP(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteLoad().saveCIAP(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
print('finalizou saveCIAP');
|
print('finalizou saveCIAP');
|
||||||
await ApiDataLoad().loadMunicipios(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadMunicipios(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
print('loadMunicipios');
|
print('loadMunicipios');
|
||||||
setState(() {
|
setState(() {
|
||||||
messageSteps = "Etapa 6 de 7 - Gravando os Municípios no Aplicativo";
|
messageSteps = "Etapa 6 de 7 - Gravando os Municípios no Aplicativo";
|
||||||
});
|
});
|
||||||
await DbSqliteLoad().saveCity(value).then((value)async{
|
List list = value;
|
||||||
print('finalizou saveCity');
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteLoad().saveCity(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataLoad().loadEquipes(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadEquipes(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
print('loadEquipes');
|
print('loadEquipes');
|
||||||
setState(() {
|
setState(() {
|
||||||
messageSteps = "Etapa 7 de 7 - Gravando as Equipes no Aplicativo";
|
messageSteps = "Etapa 7 de 7 - Gravando as Equipes no Aplicativo";
|
||||||
});
|
});
|
||||||
await DbSqliteLoad().saveTeam(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteLoad().saveTeam(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
print('finalizou saveTeam');
|
print('finalizou saveTeam');
|
||||||
await ApiDataLoad().loadEquipeComponentes(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataLoad().loadEquipeComponentes(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
print('loadEquipeComponentes');
|
print('loadEquipeComponentes');
|
||||||
@@ -131,13 +182,6 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}else{
|
}else{
|
||||||
AlertDialogDefault().alert(context, 'Error', 'Unidades não carregada, tente novamente!', 'Voltar');
|
AlertDialogDefault().alert(context, 'Error', 'Unidades não carregada, tente novamente!', 'Voltar');
|
||||||
}
|
}
|
||||||
@@ -223,7 +267,11 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
|||||||
fontWeigth: FontWeight.bold,
|
fontWeigth: FontWeight.bold,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
)
|
),
|
||||||
|
SizedBox(height: 30),
|
||||||
|
TextDefault(text: countProg>0.94?'100 % finalizando etapa atual':(countProg*100).toStringAsFixed(0) + '%',color: Colors.black,textAlign: TextAlign.center,fontWeigth: FontWeight.bold,fontSize: 20),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
LinearProgressIndicator(value: countProg,minHeight: 15,color: ColorPalette.appBar,backgroundColor: ColorPalette.titleContainer,)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rkm/controllers/main_controllers.dart';
|
import 'package:rkm/controllers/main_controllers.dart';
|
||||||
|
import 'package:rkm/screens/home_screen.dart';
|
||||||
import 'package:rkm/service/api/url_api_const.dart';
|
import 'package:rkm/service/api/url_api_const.dart';
|
||||||
import 'package:rkm/config/color_palette.dart';
|
import 'package:rkm/config/color_palette.dart';
|
||||||
import 'package:rkm/config/const_variable.dart';
|
import 'package:rkm/config/const_variable.dart';
|
||||||
@@ -10,6 +11,7 @@ import 'package:rkm/widgets/text_default.dart';
|
|||||||
import '../../service/api/api_data_load.dart';
|
import '../../service/api/api_data_load.dart';
|
||||||
import '../../service/db/db_sqlite_load.dart';
|
import '../../service/db/db_sqlite_load.dart';
|
||||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||||
|
import '../../widgets/title_input.dart';
|
||||||
import '../load_init_screen.dart';
|
import '../load_init_screen.dart';
|
||||||
class LoginLoadScreen extends StatefulWidget {
|
class LoginLoadScreen extends StatefulWidget {
|
||||||
const LoginLoadScreen({Key? key}) : super(key: key);
|
const LoginLoadScreen({Key? key}) : super(key: key);
|
||||||
@@ -28,8 +30,8 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
|||||||
String? now;
|
String? now;
|
||||||
String? selectCity;
|
String? selectCity;
|
||||||
int contLogo = 0;
|
int contLogo = 0;
|
||||||
String mode = 'desenvolvimento';
|
String mode = 'online';
|
||||||
String urlAPI = UrlApiConst.ApiUrlDesenvolvimento;
|
String urlAPI = UrlApiConst.ApiUrlOnline;
|
||||||
bool loading = false;
|
bool loading = false;
|
||||||
String nameCityApi = '';
|
String nameCityApi = '';
|
||||||
String nameCityFront = '';
|
String nameCityFront = '';
|
||||||
@@ -97,7 +99,8 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
|||||||
nameCityApi,
|
nameCityApi,
|
||||||
nameCityFront,
|
nameCityFront,
|
||||||
codState,
|
codState,
|
||||||
codCityIbge).then((value) {
|
codCityIbge
|
||||||
|
).then((value) {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
@@ -189,23 +192,24 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
|||||||
height: mode == 'desenvolvimento'?height*0.4:height*0.3,
|
height: mode == 'desenvolvimento'?height*0.4:height*0.3,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
|
TitleInput(title:'Usuário'),
|
||||||
InputText(
|
InputText(
|
||||||
hint: 'Usuário',
|
title: 'Usuário',
|
||||||
label: 'Usuário',
|
|
||||||
controller: inputUser,
|
controller: inputUser,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
colorBorder: Colors.white,
|
colorBorder: Colors.white,
|
||||||
onChanged: (v)=>setState((){}),
|
onChanged: (v)=>setState((){}),
|
||||||
),
|
),
|
||||||
|
TitleInput(title:'Senha'),
|
||||||
InputText(
|
InputText(
|
||||||
hint: 'Senha',
|
title: 'Senha',
|
||||||
label: 'Senha',
|
|
||||||
obscure: true,
|
obscure: true,
|
||||||
controller: inputPassword,
|
controller: inputPassword,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
colorBorder: Colors.white,
|
colorBorder: Colors.white,
|
||||||
onChanged: (v)=>setState((){}),
|
onChanged: (v)=>setState((){}),
|
||||||
),
|
),
|
||||||
|
TitleInput(title:'Cidade'),
|
||||||
DropDownButtonCity(
|
DropDownButtonCity(
|
||||||
error: 'Campo obrigatório',
|
error: 'Campo obrigatório',
|
||||||
validator: mandatory,
|
validator: mandatory,
|
||||||
@@ -217,18 +221,18 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
mode == 'desenvolvimento'?TitleInput(title:'IP'):Container(),
|
||||||
mode == 'desenvolvimento'?InputText(
|
mode == 'desenvolvimento'?InputText(
|
||||||
hint: 'IP',
|
title: 'IP',
|
||||||
label: 'IP',
|
|
||||||
obscure: false,
|
obscure: false,
|
||||||
controller: inputIP,
|
controller: inputIP,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
colorBorder: Colors.white,
|
colorBorder: Colors.white,
|
||||||
onChanged: (v)=>setState((){}),
|
onChanged: (v)=>setState((){}),
|
||||||
):Container(),
|
):Container(),
|
||||||
|
mode == 'desenvolvimento'?TitleInput(title:'Porta'):Container(),
|
||||||
mode == 'desenvolvimento'?InputText(
|
mode == 'desenvolvimento'?InputText(
|
||||||
hint: 'Porta',
|
title: 'Porta',
|
||||||
label: 'Porta',
|
|
||||||
obscure: false,
|
obscure: false,
|
||||||
controller: inputPort,
|
controller: inputPort,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
@@ -240,6 +244,12 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
loading?Container():ButtonDefault(
|
loading?Container():ButtonDefault(
|
||||||
|
// onPressed: (){
|
||||||
|
// Navigator.push(
|
||||||
|
// context,
|
||||||
|
// MaterialPageRoute(
|
||||||
|
// builder: (context) => HomeScreen()));
|
||||||
|
// },
|
||||||
onPressed: ()=>checkLogin(),
|
onPressed: ()=>checkLogin(),
|
||||||
title: 'Carga Inicial',
|
title: 'Carga Inicial',
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:rkm/widgets/text_default.dart';
|
|||||||
import '../../controllers/main_controllers.dart';
|
import '../../controllers/main_controllers.dart';
|
||||||
import '../../service/api/api_data_load.dart';
|
import '../../service/api/api_data_load.dart';
|
||||||
import '../../service/db/db_sqlite_load.dart';
|
import '../../service/db/db_sqlite_load.dart';
|
||||||
|
import '../../widgets/title_input.dart';
|
||||||
class LoginSavedScreen extends StatefulWidget {
|
class LoginSavedScreen extends StatefulWidget {
|
||||||
List listControl;
|
List listControl;
|
||||||
|
|
||||||
@@ -156,17 +157,17 @@ class _LoginSavedScreenState extends State<LoginSavedScreen> {
|
|||||||
height: height*0.2,
|
height: height*0.2,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
|
TitleInput(title:'Usuário'),
|
||||||
InputText(
|
InputText(
|
||||||
hint: 'Usuário',
|
title: 'Usuário',
|
||||||
label: inputUser.text.isNotEmpty?'':'Usuário',
|
|
||||||
controller: inputUser,
|
controller: inputUser,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
colorBorder: Colors.white,
|
colorBorder: Colors.white,
|
||||||
onChanged: (v)=>setState((){}),
|
onChanged: (v)=>setState((){}),
|
||||||
),
|
),
|
||||||
|
TitleInput(title:'Senha'),
|
||||||
InputText(
|
InputText(
|
||||||
hint: 'Senha',
|
title: 'Senha',
|
||||||
label: inputPassword.text.isNotEmpty?'':'Senha',
|
|
||||||
obscure: true,
|
obscure: true,
|
||||||
controller: inputPassword,
|
controller: inputPassword,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import '../../controllers/main_controllers.dart';
|
|||||||
import '../../service/api/api_data_load.dart';
|
import '../../service/api/api_data_load.dart';
|
||||||
import '../../service/db/db_sqlite_load.dart';
|
import '../../service/db/db_sqlite_load.dart';
|
||||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||||
|
import '../../widgets/title_input.dart';
|
||||||
class SyncLoginScreen extends StatefulWidget {
|
class SyncLoginScreen extends StatefulWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -197,26 +198,27 @@ class _SyncLoginScreenState extends State<SyncLoginScreen> {
|
|||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
height: height*0.35,
|
height: height*0.4,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
|
TitleInput(title:'Usuário'),
|
||||||
InputText(
|
InputText(
|
||||||
hint: 'Usuário',
|
title: 'Usuário',
|
||||||
label: inputUser.text.isNotEmpty?'':'Usuário',
|
|
||||||
controller: inputUser,
|
controller: inputUser,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
colorBorder: Colors.white,
|
colorBorder: Colors.white,
|
||||||
onChanged: (v)=>setState((){}),
|
onChanged: (v)=>setState((){}),
|
||||||
),
|
),
|
||||||
|
TitleInput(title:'Senha'),
|
||||||
InputText(
|
InputText(
|
||||||
hint: 'Senha',
|
title: 'Senha',
|
||||||
label: inputPassword.text.isNotEmpty?'':'Senha',
|
|
||||||
obscure: true,
|
obscure: true,
|
||||||
controller: inputPassword,
|
controller: inputPassword,
|
||||||
width: width*0.6,
|
width: width*0.6,
|
||||||
colorBorder: Colors.white,
|
colorBorder: Colors.white,
|
||||||
onChanged: (v)=>setState((){}),
|
onChanged: (v)=>setState((){}),
|
||||||
),
|
),
|
||||||
|
TitleInput(title:'Unidade'),
|
||||||
DropDownButtonDefault(
|
DropDownButtonDefault(
|
||||||
width: width*0.7,
|
width: width*0.7,
|
||||||
title: 'Unidade',
|
title: 'Unidade',
|
||||||
@@ -231,6 +233,7 @@ class _SyncLoginScreenState extends State<SyncLoginScreen> {
|
|||||||
getTeam();
|
getTeam();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
TitleInput(title:'Equipe'),
|
||||||
DropDownButtonDefault(
|
DropDownButtonDefault(
|
||||||
width: width*0.7,
|
width: width*0.7,
|
||||||
title: 'Equipe',
|
title: 'Equipe',
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
|
|||||||
'ATENDIMENTOS' : '',
|
'ATENDIMENTOS' : '',
|
||||||
'SINCRONIZADO' : 'N',
|
'SINCRONIZADO' : 'N',
|
||||||
};
|
};
|
||||||
await DbSqliteSync().insertCidadaos(row,editing?'update':'new',codSus).then((value){
|
await DbSqliteSync().insertCidadaos(row,editing?'update':'new',codSus,0).then((value){
|
||||||
if(checkCNS != 'ok' || CNSController.text.isEmpty){
|
if(checkCNS != 'ok' || CNSController.text.isEmpty){
|
||||||
AlertDialogDefault().alert(
|
AlertDialogDefault().alert(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ class _RegisterHomeScreenState extends State<RegisterHomeScreen> {
|
|||||||
'CARGO_RESP_TECNICO_INST' : CARGO_RESP_TECNICO_INST,
|
'CARGO_RESP_TECNICO_INST' : CARGO_RESP_TECNICO_INST,
|
||||||
'TEL_RESP_TECNICO_INST' : TEL_RESP_TECNICO_INST,
|
'TEL_RESP_TECNICO_INST' : TEL_RESP_TECNICO_INST,
|
||||||
};
|
};
|
||||||
await DbSqliteSync().insertCadastrosDomiciliares(row,TIPO_SALVAR,ID_DOMICILIO,ID_CIDADAO,CD_USUARIO_SUS).then((value){
|
await DbSqliteSync().insertCadastrosDomiciliares(row,TIPO_SALVAR,ID_DOMICILIO,ID_CIDADAO,CD_USUARIO_SUS,0).then((value){
|
||||||
AlertDialogDefault().alert(
|
AlertDialogDefault().alert(
|
||||||
context,
|
context,
|
||||||
'Aviso',
|
'Aviso',
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ class _RegisterIndividualScreenState extends State<RegisterIndividualScreen> {
|
|||||||
'CRIANCAS_OUTRO' : CRIANCAS_OUTRO?1:2,
|
'CRIANCAS_OUTRO' : CRIANCAS_OUTRO?1:2,
|
||||||
'IDENTIDADE_GENERO' : IDENTIDADE_GENERO_COD,
|
'IDENTIDADE_GENERO' : IDENTIDADE_GENERO_COD,
|
||||||
};
|
};
|
||||||
await DbSqliteSync().insertCadastrosIndividuais(row,TIPO_SALVAR,ID_CIDADAO).then((value){
|
await DbSqliteSync().insertCadastrosIndividuais(row,TIPO_SALVAR,ID_CIDADAO,0).then((value){
|
||||||
AlertDialogDefault().alert(
|
AlertDialogDefault().alert(
|
||||||
context,
|
context,
|
||||||
'Aviso',
|
'Aviso',
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class _SyncInitScreenState extends State<SyncInitScreen> {
|
|||||||
int codCity = 0;
|
int codCity = 0;
|
||||||
int codCityIbge = 0;
|
int codCityIbge = 0;
|
||||||
String codState = '';
|
String codState = '';
|
||||||
|
double countProg = 0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -85,63 +86,126 @@ class _SyncInitScreenState extends State<SyncInitScreen> {
|
|||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 2 de 10 - Gravando os Bairros no Aplicativo");
|
setState(()=> messageSteps = "Etapa 2 de 10 - Gravando os Bairros no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertBairros(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertBairros(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncTiposLogradouros(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataSync().syncTiposLogradouros(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Tipos de Logradouros - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os Tipos de Logradouros - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 3 de 10 - Gravando os Tipos de Logradouros no Aplicativo");
|
setState(()=> messageSteps = "Etapa 3 de 10 - Gravando os Tipos de Logradouros no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertTiposLogradouros(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertTiposLogradouros(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncLogradouros(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataSync().syncLogradouros(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Logradouros - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os Logradouros - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 4 de 10 - Gravando os Logradouros no Aplicativo");
|
setState(()=> messageSteps = "Etapa 4 de 10 - Gravando os Logradouros no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertLogradouros(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertLogradouros(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncLoteamentos(urlAPI,mode,nameCityApi,user).then((value)async{
|
await ApiDataSync().syncLoteamentos(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Loteamentos - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os Loteamentos - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 5 de 10 - Gravando os Loteamentos no Aplicativo");
|
setState(()=> messageSteps = "Etapa 5 de 10 - Gravando os Loteamentos no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertLoteamentos(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertLoteamentos(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncProfissionais(urlAPI,mode,nameCityApi,user,idUnidade).then((value)async{
|
await ApiDataSync().syncProfissionais(urlAPI,mode,nameCityApi,user,idUnidade).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Profissionais - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os Profissionais - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 6 de 10 - Gravando os Profissionais no Aplicativo");
|
setState(()=> messageSteps = "Etapa 6 de 10 - Gravando os Profissionais no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertProfissionais(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertProfissionais(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncProfissionaisCBOs(urlAPI,mode,nameCityApi,user,idUnidade).then((value)async{
|
await ApiDataSync().syncProfissionaisCBOs(urlAPI,mode,nameCityApi,user,idUnidade).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os CBOs dos Profissionais - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os CBOs dos Profissionais - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 7 de 10 - Gravando os CBO´s dos Profissionais no Aplicativo");
|
setState(()=> messageSteps = "Etapa 7 de 10 - Gravando os CBO´s dos Profissionais no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertProfissionaisCBOs(value).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertProfissionaisCBOs(value,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncCidadaos(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
await ApiDataSync().syncCidadaos(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros dos Cidadãos - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros dos Cidadãos - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 8 de 10 - Gravando os Cidadãos no Aplicativo");
|
setState(()=> messageSteps = "Etapa 8 de 10 - Gravando os Cidadãos no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertCidadaos(value,'sync','').then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertCidadaos(value,'sync','',i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncCadastrosDomiciliares(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
await ApiDataSync().syncCadastrosDomiciliares(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Domiciliares - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Domiciliares - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 9 de 10 - Gravando os Cadastros Domiciliares no Aplicativo");
|
setState(()=> messageSteps = "Etapa 9 de 10 - Gravando os Cadastros Domiciliares no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertCadastrosDomiciliares(value,'sync',0,0,'').then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertCadastrosDomiciliares(value,'sync',0,0,'',i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await ApiDataSync().syncCadastrosIndividuais(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
await ApiDataSync().syncCadastrosIndividuais(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
||||||
if(value.length == 0){
|
if(value.length == 0){
|
||||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Individuais - Por favor, tente novamente!");
|
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Individuais - Por favor, tente novamente!");
|
||||||
}else{
|
}else{
|
||||||
setState(()=> messageSteps = "Etapa 10 de 10 - Gravando os Cadastros Individuais no Aplicativo");
|
setState(()=> messageSteps = "Etapa 10 de 10 - Gravando os Cadastros Individuais no Aplicativo");
|
||||||
}
|
}
|
||||||
await DbSqliteSync().insertCadastrosIndividuais(value,'sync',0).then((value)async{
|
List list = value;
|
||||||
|
for(int i=0;list.length > i;i++){
|
||||||
|
await DbSqliteSync().insertCadastrosIndividuais(value,'sync',0,i).then((value)async{
|
||||||
|
int cont = list.length!=0?list.length:0;
|
||||||
|
countProg = i/cont;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
await DbSqliteSync().saveSync(codCity,codState,urlAPI,mode,nameCityApi,nameCityFront,codCityIbge,user,idUnidade,nomeUnidade,area,microarea).then((value)async{
|
await DbSqliteSync().saveSync(codCity,codState,urlAPI,mode,nameCityApi,nameCityFront,codCityIbge,user,idUnidade,nomeUnidade,area,microarea).then((value)async{
|
||||||
Navigator.pushNamed(context, '/home');
|
Navigator.pushNamed(context, '/home');
|
||||||
});
|
});
|
||||||
@@ -154,15 +218,6 @@ class _SyncInitScreenState extends State<SyncInitScreen> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -245,7 +300,11 @@ class _SyncInitScreenState extends State<SyncInitScreen> {
|
|||||||
fontWeigth: FontWeight.bold,
|
fontWeigth: FontWeight.bold,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
)
|
),
|
||||||
|
SizedBox(height: 30),
|
||||||
|
TextDefault(text: countProg>0.94?'100 % finalizando etapa atual':(countProg*100).toStringAsFixed(0) + '%',color: Colors.black,textAlign: TextAlign.center,fontWeigth: FontWeight.bold,fontSize: 20),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
LinearProgressIndicator(value: countProg,minHeight: 15,color: ColorPalette.appBar,backgroundColor: ColorPalette.titleContainer,)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ class DbSqliteSigtap{
|
|||||||
// {"codProcedimento":"0701020580","nome":"MANUTEN\u00c7\u00c3O DE OPM ORTOP\u00c9DICA","codGrupo":"07","qtdeMax":2,"idadeMin":833,"idadeMax":833,"sexo":"N"}
|
// {"codProcedimento":"0701020580","nome":"MANUTEN\u00c7\u00c3O DE OPM ORTOP\u00c9DICA","codGrupo":"07","qtdeMax":2,"idadeMin":833,"idadeMax":833,"sexo":"N"}
|
||||||
for(int i=0;value.length > i;i++){
|
for(int i=0;value.length > i;i++){
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'COD_PROC_SIGTAP' : value['codProcedimento'],
|
'COD_PROC_SIGTAP' : value[i]['codProcedimento'],
|
||||||
'DESC_PROC_SIGTAP' : value['nome'],
|
'DESC_PROC_SIGTAP' : value[i]['nome'],
|
||||||
'GRUPO_PROC_SIGTAP' : value['codGrupo'],
|
'GRUPO_PROC_SIGTAP' : value[i]['codGrupo'],
|
||||||
'QTDE_MAXIMA' : value['qtdeMax'],
|
'QTDE_MAXIMA' : value[i]['qtdeMax'],
|
||||||
'IDADE_MIN' : value['idadeMin'],
|
'IDADE_MIN' : value[i]['idadeMin'],
|
||||||
'IDADE_MAX' : value['idadeMax'],
|
'IDADE_MAX' : value[i]['idadeMax'],
|
||||||
'SEXO' : value['sexo'],
|
'SEXO' : value[i]['sexo'],
|
||||||
};
|
};
|
||||||
int id = await db.insert('PROCEDIMENTOS_SIGTAP', row);
|
int id = await db.insert('PROCEDIMENTOS_SIGTAP', row);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:rkm/config/const_variable.dart';
|
||||||
|
import 'package:rkm/controllers/main_controllers.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
import 'package:path/path.dart';
|
import 'package:path/path.dart';
|
||||||
|
|
||||||
@@ -141,9 +143,8 @@ class DbSqliteLoad{
|
|||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future saveUnidadesDB(var value)async{
|
Future saveUnidadesDB(var value,int i)async{
|
||||||
Database db = await intialDB();
|
Database db = await intialDB();
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_UNIDADE' : value[i]['idUnidade'],
|
'ID_UNIDADE' : value[i]['idUnidade'],
|
||||||
'NOME_UNIDADE' : value[i]['nomeFantasia'],
|
'NOME_UNIDADE' : value[i]['nomeFantasia'],
|
||||||
@@ -152,15 +153,13 @@ class DbSqliteLoad{
|
|||||||
int id = await db.insert('UNIDADES', row);
|
int id = await db.insert('UNIDADES', row);
|
||||||
// print('id increment $id');
|
// print('id increment $id');
|
||||||
// print(await db.query('UNIDADES'));
|
// print(await db.query('UNIDADES'));
|
||||||
}
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future saveProceduresDB(var value)async{
|
Future saveProceduresDB(var value,int i)async{
|
||||||
Database db = await intialDB();
|
Database db = await intialDB();
|
||||||
|
|
||||||
// var query = "INSERT OR REPLACE INTO PROCEDIMENTOS_SIGTAP (COD_PROC_SIGTAP, DESC_PROC_SIGTAP, GRUPO_PROC_SIGTAP, QTDE_MAXIMA, IDADE_MIN, IDADE_MAX, SEXO) VALUES (?,?,?,?,?,?,?)";
|
// var query = "INSERT OR REPLACE INTO PROCEDIMENTOS_SIGTAP (COD_PROC_SIGTAP, DESC_PROC_SIGTAP, GRUPO_PROC_SIGTAP, QTDE_MAXIMA, IDADE_MIN, IDADE_MAX, SEXO) VALUES (?,?,?,?,?,?,?)";
|
||||||
// {"codProcedimento":"0701020580","nome":"MANUTEN\u00c7\u00c3O DE OPM ORTOP\u00c9DICA","codGrupo":"07","qtdeMax":2,"idadeMin":833,"idadeMax":833,"sexo":"N"}
|
// {"codProcedimento":"0701020580","nome":"MANUTEN\u00c7\u00c3O DE OPM ORTOP\u00c9DICA","codGrupo":"07","qtdeMax":2,"idadeMin":833,"idadeMax":833,"sexo":"N"}
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'COD_PROC_SIGTAP' : value[i]['codProcedimento'],
|
'COD_PROC_SIGTAP' : value[i]['codProcedimento'],
|
||||||
'DESC_PROC_SIGTAP' : value[i]['nome'],
|
'DESC_PROC_SIGTAP' : value[i]['nome'],
|
||||||
@@ -173,7 +172,6 @@ class DbSqliteLoad{
|
|||||||
int id = await db.insert('PROCEDIMENTOS_SIGTAP', row);
|
int id = await db.insert('PROCEDIMENTOS_SIGTAP', row);
|
||||||
// print('id increment $id');
|
// print('id increment $id');
|
||||||
// print(await db.query('PROCEDIMENTOS_SIGTAP'));
|
// print(await db.query('PROCEDIMENTOS_SIGTAP'));
|
||||||
}
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future saveProceduresRegisterDB(var value)async{
|
Future saveProceduresRegisterDB(var value)async{
|
||||||
@@ -191,11 +189,10 @@ class DbSqliteLoad{
|
|||||||
}
|
}
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future saveCID(var value)async{
|
Future saveCID(var value,int i)async{
|
||||||
Database db = await intialDB();
|
Database db = await intialDB();
|
||||||
// "INSERT OR REPLACE INTO CIDS (CODIGO_CID, DESCRICAO_CID, RESTRICAO_SEXO) VALUES (?,?,?)"
|
// "INSERT OR REPLACE INTO CIDS (CODIGO_CID, DESCRICAO_CID, RESTRICAO_SEXO) VALUES (?,?,?)"
|
||||||
// {"codCID":"A000","descCID":"A00.0 Colera dev Vibrio cholerae 01 biot cholerae","restSexo":"5"},
|
// {"codCID":"A000","descCID":"A00.0 Colera dev Vibrio cholerae 01 biot cholerae","restSexo":"5"},
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'CODIGO_CID' : value[i]['codCID'],
|
'CODIGO_CID' : value[i]['codCID'],
|
||||||
'DESCRICAO_CID' : value[i]['descCID'],
|
'DESCRICAO_CID' : value[i]['descCID'],
|
||||||
@@ -203,7 +200,6 @@ class DbSqliteLoad{
|
|||||||
};
|
};
|
||||||
int id = await db.insert('CIDS', row);
|
int id = await db.insert('CIDS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
}
|
|
||||||
// print(await db.query('CIDS'));
|
// print(await db.query('CIDS'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
@@ -222,18 +218,16 @@ class DbSqliteLoad{
|
|||||||
// print(await db.query('PROCEDIMENTOS_SIGTAP_CID'));
|
// print(await db.query('PROCEDIMENTOS_SIGTAP_CID'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future saveCBO(var value)async{
|
Future saveCBO(var value,int i)async{
|
||||||
Database db = await intialDB();
|
Database db = await intialDB();
|
||||||
// "INSERT OR REPLACE INTO CBOS (CODIGO_CBO, DESCRICAO_CBO) VALUES (?,?)"
|
// "INSERT OR REPLACE INTO CBOS (CODIGO_CBO, DESCRICAO_CBO) VALUES (?,?)"
|
||||||
// "codCBO":"223208","descCBO":"Cirurgi\u00e3o dentista - cl\u00ednico geral"
|
// "codCBO":"223208","descCBO":"Cirurgi\u00e3o dentista - cl\u00ednico geral"
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'CODIGO_CBO' : value[i]['codCBO'],
|
'CODIGO_CBO' : value[i]['codCBO'],
|
||||||
'DESCRICAO_CBO' : value[i]['descCBO'],
|
'DESCRICAO_CBO' : value[i]['descCBO'],
|
||||||
};
|
};
|
||||||
int id = await db.insert('CBOS', row);
|
int id = await db.insert('CBOS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
}
|
|
||||||
// print(await db.query('CBOS'));
|
// print(await db.query('CBOS'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
@@ -252,11 +246,10 @@ class DbSqliteLoad{
|
|||||||
// print(await db.query('PROCEDIMENTOS_SIGTAP_CBO'));
|
// print(await db.query('PROCEDIMENTOS_SIGTAP_CBO'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future saveCIAP(var value)async{
|
Future saveCIAP(var value,int i)async{
|
||||||
Database db = await intialDB();
|
Database db = await intialDB();
|
||||||
// "INSERT OR REPLACE INTO CIAPS (CODIGO_CIAP, DESC_CIAP, TIPO_CIAP) VALUES (?,?,?)";
|
// "INSERT OR REPLACE INTO CIAPS (CODIGO_CIAP, DESC_CIAP, TIPO_CIAP) VALUES (?,?,?)";
|
||||||
// "codCIAP":"30","descCIAP":"EXAME M\u00c9DICO\/AVALIA\u00c7\u00c3ODE SA\u00daDE - COMPLETO","tipoCIAP":"PROC"
|
// "codCIAP":"30","descCIAP":"EXAME M\u00c9DICO\/AVALIA\u00c7\u00c3ODE SA\u00daDE - COMPLETO","tipoCIAP":"PROC"
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'CODIGO_CIAP' : value[i]['codCIAP'],
|
'CODIGO_CIAP' : value[i]['codCIAP'],
|
||||||
'DESC_CIAP' : value[i]['descCIAP'],
|
'DESC_CIAP' : value[i]['descCIAP'],
|
||||||
@@ -264,15 +257,13 @@ class DbSqliteLoad{
|
|||||||
};
|
};
|
||||||
int id = await db.insert('CIAPS', row);
|
int id = await db.insert('CIAPS', row);
|
||||||
// print('id increment $id CIAPS');
|
// print('id increment $id CIAPS');
|
||||||
}
|
|
||||||
// print(await db.query('CIAPS'));
|
// print(await db.query('CIAPS'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future saveCity(var value)async{
|
Future saveCity(var value,int i)async{
|
||||||
Database db = await intialDB();
|
Database db = await intialDB();
|
||||||
// "INSERT OR REPLACE INTO MUNICIPIOS (ID_MUNICIPIO, CODIGO_IBGE, NO_MUNICIPIO, UF_ESTADO, ID_PAIS) VALUES (?,?,?,?,?)"
|
// "INSERT OR REPLACE INTO MUNICIPIOS (ID_MUNICIPIO, CODIGO_IBGE, NO_MUNICIPIO, UF_ESTADO, ID_PAIS) VALUES (?,?,?,?,?)"
|
||||||
// "idMunicipio":1,"codIBGE":"000000","nomeMunicipio":"MUNICIPIO IGNORADO","UF":"--","idPais":33
|
// "idMunicipio":1,"codIBGE":"000000","nomeMunicipio":"MUNICIPIO IGNORADO","UF":"--","idPais":33
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_MUNICIPIO' : value[i]['idMunicipio'],
|
'ID_MUNICIPIO' : value[i]['idMunicipio'],
|
||||||
'CODIGO_IBGE' : value[i]['codIBGE'],
|
'CODIGO_IBGE' : value[i]['codIBGE'],
|
||||||
@@ -282,15 +273,13 @@ class DbSqliteLoad{
|
|||||||
};
|
};
|
||||||
int id = await db.insert('MUNICIPIOS', row);
|
int id = await db.insert('MUNICIPIOS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
}
|
|
||||||
// print(await db.query('MUNICIPIOS'));
|
// print(await db.query('MUNICIPIOS'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future saveTeam(var value)async{
|
Future saveTeam(var value,int i)async{
|
||||||
Database db = await intialDB();
|
Database db = await intialDB();
|
||||||
// INSERT OR REPLACE INTO EQUIPES (ID_EQUIPE, ID_UNIDADE, INE, ID_ATB_AREA, AREA, ID_ATB_MICROAREA, MICROAREA) VALUES (?,?,?,?,?,?,?)";
|
// INSERT OR REPLACE INTO EQUIPES (ID_EQUIPE, ID_UNIDADE, INE, ID_ATB_AREA, AREA, ID_ATB_MICROAREA, MICROAREA) VALUES (?,?,?,?,?,?,?)";
|
||||||
// {"idEquipe":1,"idUnidade":3,"INE":"0001485628","idAtbArea":1,"area":1,"idAtbMicroarea":null,"microarea":null}
|
// {"idEquipe":1,"idUnidade":3,"INE":"0001485628","idAtbArea":1,"area":1,"idAtbMicroarea":null,"microarea":null}
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_EQUIPE' : value[i]['idEquipe'],
|
'ID_EQUIPE' : value[i]['idEquipe'],
|
||||||
'ID_UNIDADE' : value[i]['idUnidade'],
|
'ID_UNIDADE' : value[i]['idUnidade'],
|
||||||
@@ -302,7 +291,6 @@ class DbSqliteLoad{
|
|||||||
};
|
};
|
||||||
int id = await db.insert('EQUIPES', row);
|
int id = await db.insert('EQUIPES', row);
|
||||||
// print('id increment $id EQUIPES');
|
// print('id increment $id EQUIPES');
|
||||||
}
|
|
||||||
// print(await db.query('EQUIPES'));
|
// print(await db.query('EQUIPES'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,27 +22,24 @@ class DbSqliteSync{
|
|||||||
db.execute(querys[i]);
|
db.execute(querys[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Future insertBairros(var value)async{
|
Future insertBairros(var value,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
//"idBairro":2,"nomeBairro":"RURAL"
|
//"idBairro":2,"nomeBairro":"RURAL"
|
||||||
// BAIRROS (ID_BAIRRO INTEGER PRIMARY KEY AUTOINCREMENT, NO_BAIRRO TEXT);');
|
// BAIRROS (ID_BAIRRO INTEGER PRIMARY KEY AUTOINCREMENT, NO_BAIRRO TEXT);');
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_BAIRRO' : value[i]['idBairro'],
|
'ID_BAIRRO' : value[i]['idBairro'],
|
||||||
'NO_BAIRRO' : value[i]['nomeBairro'],
|
'NO_BAIRRO' : value[i]['nomeBairro'],
|
||||||
};
|
};
|
||||||
int id = await db.insert('BAIRROS', row);
|
int id = await db.insert('BAIRROS', row);
|
||||||
// print('id increment $id');
|
// print('id increment $id');
|
||||||
}
|
|
||||||
// print(await db.query('BAIRROS'));
|
// print(await db.query('BAIRROS'));
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertTiposLogradouros(var value)async{
|
Future insertTiposLogradouros(var value,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
|
|
||||||
// LOGRADOUROS_TIPOS (ID_LOGR_TIPO INTEGER PRIMARY KEY AUTOINCREMENT, NO_LOGR_TIPO TEXT);
|
// LOGRADOUROS_TIPOS (ID_LOGR_TIPO INTEGER PRIMARY KEY AUTOINCREMENT, NO_LOGR_TIPO TEXT);
|
||||||
// {"idTipoLogradouro":0,"nomeTipoLogradouro":"NAO DEFINIDO"}
|
// {"idTipoLogradouro":0,"nomeTipoLogradouro":"NAO DEFINIDO"}
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
||||||
'NO_LOGR_TIPO' : value[i]['nomeTipoLogradouro'],
|
'NO_LOGR_TIPO' : value[i]['nomeTipoLogradouro'],
|
||||||
@@ -50,14 +47,13 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('LOGRADOUROS_TIPOS', row);
|
int id = await db.insert('LOGRADOUROS_TIPOS', row);
|
||||||
// print('id increment $id');
|
// print('id increment $id');
|
||||||
// print(await db.query('LOGRADOUROS_TIPOS'));
|
// print(await db.query('LOGRADOUROS_TIPOS'));
|
||||||
}
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertLogradouros(var value)async{
|
Future insertLogradouros(var value,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
// LOGRADOUROS_ENDERECOS (ID_LOGR_ENDERECO INTEGER, ID_LOGR_TIPO INTEGER, DESC_LOGR_ENDERECO TEXT, ID_BAIRRO INTEGER);
|
// LOGRADOUROS_ENDERECOS (ID_LOGR_ENDERECO INTEGER, ID_LOGR_TIPO INTEGER, DESC_LOGR_ENDERECO TEXT, ID_BAIRRO INTEGER);
|
||||||
// "idLogradouro":7,"descLogradouro":"1A","idTipoLogradouro":6,"idBairro":65
|
// "idLogradouro":7,"descLogradouro":"1A","idTipoLogradouro":6,"idBairro":65
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_LOGR_ENDERECO' : value[i]['idLogradouro'],
|
'ID_LOGR_ENDERECO' : value[i]['idLogradouro'],
|
||||||
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
||||||
@@ -67,14 +63,13 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('LOGRADOUROS_ENDERECOS', row);
|
int id = await db.insert('LOGRADOUROS_ENDERECOS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
// print(await db.query('LOGRADOUROS_ENDERECOS'));
|
// print(await db.query('LOGRADOUROS_ENDERECOS'));
|
||||||
}
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertLoteamentos(var value)async{
|
Future insertLoteamentos(var value,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
// LOGRADOUROS_LOTEAMENTOS (ID_LOGR_LOTEAMENTO INTEGER PRIMARY KEY AUTOINCREMENT, DESC_LOGR_LOTEAMENTO TEXT);
|
// LOGRADOUROS_LOTEAMENTOS (ID_LOGR_LOTEAMENTO INTEGER PRIMARY KEY AUTOINCREMENT, DESC_LOGR_LOTEAMENTO TEXT);
|
||||||
// "idLoteamento":1,"descLoteamento":"ASSENTAMENTO MARINEL"
|
// "idLoteamento":1,"descLoteamento":"ASSENTAMENTO MARINEL"
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_LOGR_LOTEAMENTO' : value[i]['idLoteamento'],
|
'ID_LOGR_LOTEAMENTO' : value[i]['idLoteamento'],
|
||||||
'DESC_LOGR_LOTEAMENTO' : value[i]['descLoteamento'],
|
'DESC_LOGR_LOTEAMENTO' : value[i]['descLoteamento'],
|
||||||
@@ -82,14 +77,12 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('LOGRADOUROS_LOTEAMENTOS', row);
|
int id = await db.insert('LOGRADOUROS_LOTEAMENTOS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
// print(await db.query('LOGRADOUROS_LOTEAMENTOS'));
|
// print(await db.query('LOGRADOUROS_LOTEAMENTOS'));
|
||||||
}
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertProfissionais(var value)async{
|
Future insertProfissionais(var value,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
// PROFISSIONAIS (ID_PROFISSIONAL INTEGER PRIMARY KEY AUTOINCREMENT, NOME_PROFISSIONAL TEXT, CNS_PROFISSIONAL TEXT, USERNAME TEXT, SENHA TEXT, BLOQUEIO_ACESSO INTEGER);');
|
// PROFISSIONAIS (ID_PROFISSIONAL INTEGER PRIMARY KEY AUTOINCREMENT, NOME_PROFISSIONAL TEXT, CNS_PROFISSIONAL TEXT, USERNAME TEXT, SENHA TEXT, BLOQUEIO_ACESSO INTEGER);');
|
||||||
// "idProfissional":1,"nomeProfissional":"ADMINISTRADOR","CNSProfissional":"999999999999999","username":"ADMIN","senha":"1$c124af0fb0b0941b907a9ddf3d5fb3c921d64e7d","bloqueioAcesso":0
|
// "idProfissional":1,"nomeProfissional":"ADMINISTRADOR","CNSProfissional":"999999999999999","username":"ADMIN","senha":"1$c124af0fb0b0941b907a9ddf3d5fb3c921d64e7d","bloqueioAcesso":0
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
||||||
'NOME_PROFISSIONAL': value[i]['nomeProfissional'],
|
'NOME_PROFISSIONAL': value[i]['nomeProfissional'],
|
||||||
@@ -101,14 +94,12 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('PROFISSIONAIS', row);
|
int id = await db.insert('PROFISSIONAIS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
// print(await db.query('PROFISSIONAIS'));
|
// print(await db.query('PROFISSIONAIS'));
|
||||||
}
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertProfissionaisCBOs(var value)async{
|
Future insertProfissionaisCBOs(var value,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
// PROFISSIONAIS_CBOS (ID_PROFISSIONAL INTEGER, CODIGO_CBO TEXT);');
|
// PROFISSIONAIS_CBOS (ID_PROFISSIONAL INTEGER, CODIGO_CBO TEXT);');
|
||||||
// "idProfissional":1,"codCBO":"225125"
|
// "idProfissional":1,"codCBO":"225125"
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
||||||
'CODIGO_CBO' : value[i]['codCBO'],
|
'CODIGO_CBO' : value[i]['codCBO'],
|
||||||
@@ -116,10 +107,9 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('PROFISSIONAIS_CBOS', row);
|
int id = await db.insert('PROFISSIONAIS_CBOS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
// print(await db.query('PROFISSIONAIS_CBOS'));
|
// print(await db.query('PROFISSIONAIS_CBOS'));
|
||||||
}
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertCidadaos(var value,String type,String CD_USUARIO_SUS)async{
|
Future insertCidadaos(var value,String type,String CD_USUARIO_SUS,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
// CIDADAOS (ID_CIDADAO,CD_USUARIO_SUS,NOME_CIDADAO,NOME_SOCIAL,SEXO,DT_NASCIMENTO,ID_ESTADO_CIVIL,NOME_CONJUGE,NACIONALIDADE,ID_MUNICIPIO_NASC,NO_MUNICIPIO_NASC,ESTADO_UF_NASC
|
// CIDADAOS (ID_CIDADAO,CD_USUARIO_SUS,NOME_CIDADAO,NOME_SOCIAL,SEXO,DT_NASCIMENTO,ID_ESTADO_CIVIL,NOME_CONJUGE,NACIONALIDADE,ID_MUNICIPIO_NASC,NO_MUNICIPIO_NASC,ESTADO_UF_NASC
|
||||||
// ID_ETNIA,ID_ESCOLARIDADE,ID_DEFICIENCIA,NOME_MAE,DESCONHECE_MAE,NOME_PAI,DESCONHECE_PAI,ID_UNIDADE,NUM_PRONTUARIO,NUM_PRONTUARIO_PROV,CLASSIFICACAO,CLASSIFICACAO_SUB,
|
// ID_ETNIA,ID_ESCOLARIDADE,ID_DEFICIENCIA,NOME_MAE,DESCONHECE_MAE,NOME_PAI,DESCONHECE_PAI,ID_UNIDADE,NUM_PRONTUARIO,NUM_PRONTUARIO_PROV,CLASSIFICACAO,CLASSIFICACAO_SUB,
|
||||||
@@ -141,7 +131,6 @@ class DbSqliteSync{
|
|||||||
'"idUsuarioCadastro":null';
|
'"idUsuarioCadastro":null';
|
||||||
|
|
||||||
if(type=='sync'){
|
if(type=='sync'){
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_CIDADAO' : value[i]['idCidadao'],
|
'ID_CIDADAO' : value[i]['idCidadao'],
|
||||||
'CD_USUARIO_SUS' : value[i]['cdUsuarioSus'],
|
'CD_USUARIO_SUS' : value[i]['cdUsuarioSus'],
|
||||||
@@ -228,7 +217,6 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('CIDADAOS', row);
|
int id = await db.insert('CIDADAOS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
// print(await db.query('CIDADAOS'));
|
// print(await db.query('CIDADAOS'));
|
||||||
}
|
|
||||||
}else if(type=='new'){
|
}else if(type=='new'){
|
||||||
int id = await db.insert('CIDADAOS', value);
|
int id = await db.insert('CIDADAOS', value);
|
||||||
// print('novo id $id');
|
// print('novo id $id');
|
||||||
@@ -237,7 +225,7 @@ class DbSqliteSync{
|
|||||||
}
|
}
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertCadastrosDomiciliares(var value,String type,int ID_DOMICILIO,int ID_CIDADAO,String CD_USUARIO_SUS)async{
|
Future insertCadastrosDomiciliares(var value,String type,int ID_DOMICILIO,int ID_CIDADAO,String CD_USUARIO_SUS,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
// CIDADAO_DOMICILIO (ID_DOMICILIO,TIPO_IMOVEL,ID_AREA_DOMICILIO,ID_MICROAREA_DOMICILIO,FORA_AREA,SITUACAO_MORADIA,TIPO_LOCALIDADE,TIPO_DOMICILIO,NUM_MORADORES,
|
// CIDADAO_DOMICILIO (ID_DOMICILIO,TIPO_IMOVEL,ID_AREA_DOMICILIO,ID_MICROAREA_DOMICILIO,FORA_AREA,SITUACAO_MORADIA,TIPO_LOCALIDADE,TIPO_DOMICILIO,NUM_MORADORES,
|
||||||
// NUM_COMODOS,SITUACAO_RURAL,TIPO_ACESSO,MAT_PREDOMINANTE,DISPONIBILIDADE_ENERGIA,TIPO_ABASTECIMENTO,TRATAMENTO_AGUA,DESTINO_LIXO,ESCOAMENTO,FL_ANIMAIS,
|
// NUM_COMODOS,SITUACAO_RURAL,TIPO_ACESSO,MAT_PREDOMINANTE,DISPONIBILIDADE_ENERGIA,TIPO_ABASTECIMENTO,TRATAMENTO_AGUA,DESTINO_LIXO,ESCOAMENTO,FL_ANIMAIS,
|
||||||
@@ -251,7 +239,6 @@ class DbSqliteSync{
|
|||||||
// "cnesUnidade":"9372253","cboRespCadastro":"515105","ine":"0001485628","dtCadastro":"2021-11-10","cdEquipe":5,"noInstPermanencia":null,"outrosProfissionaisInst":null,
|
// "cnesUnidade":"9372253","cboRespCadastro":"515105","ine":"0001485628","dtCadastro":"2021-11-10","cdEquipe":5,"noInstPermanencia":null,"outrosProfissionaisInst":null,
|
||||||
// "noResponsavelInst":null,"cnsResponsavelInst":null,"gargoResponsavelInst":null,"telefoneResponsavelInst":null
|
// "noResponsavelInst":null,"cnsResponsavelInst":null,"gargoResponsavelInst":null,"telefoneResponsavelInst":null
|
||||||
if(type=='sync'){
|
if(type=='sync'){
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_DOMICILIO' : value[i]['cdDomicilio'],
|
'ID_DOMICILIO' : value[i]['cdDomicilio'],
|
||||||
'TIPO_IMOVEL' : value[i]['cdTipoImovel'],
|
'TIPO_IMOVEL' : value[i]['cdTipoImovel'],
|
||||||
@@ -294,7 +281,6 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('CIDADAO_DOMICILIO', row);
|
int id = await db.insert('CIDADAO_DOMICILIO', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
// print(await db.query('CIDADAO_DOMICILIO'));
|
// print(await db.query('CIDADAO_DOMICILIO'));
|
||||||
}
|
|
||||||
}else if(type=='new'){
|
}else if(type=='new'){
|
||||||
int id = await db.insert('CIDADAO_DOMICILIO', value);
|
int id = await db.insert('CIDADAO_DOMICILIO', value);
|
||||||
print('novo id $id');
|
print('novo id $id');
|
||||||
@@ -325,7 +311,7 @@ class DbSqliteSync{
|
|||||||
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
Future insertCadastrosIndividuais(var value,String type,int ID_CIDADAO)async{
|
Future insertCadastrosIndividuais(var value,String type,int ID_CIDADAO,int i)async{
|
||||||
Database db = await DbSqliteLoad().intialDB();
|
Database db = await DbSqliteLoad().intialDB();
|
||||||
// CADASTROS_INDIVIDUAIS (ID_CAD_INDIVIDUAL,STATUS_CADASTRO,ID_CIDADAO,CD_USUARIO_SUS,ID_AREA_CIDADAO,ID_MICROAREA_CIDADAO,FORA_AREA,RESPONSAVEL_FAMILIAR,
|
// CADASTROS_INDIVIDUAIS (ID_CAD_INDIVIDUAL,STATUS_CADASTRO,ID_CIDADAO,CD_USUARIO_SUS,ID_AREA_CIDADAO,ID_MICROAREA_CIDADAO,FORA_AREA,RESPONSAVEL_FAMILIAR,
|
||||||
// ID_RESPONSAVEL_FAMILIAR,NOME_RESPONSAVEL_FAMILIAR,PARENTESCO,ESCOLARIDADE,FREQ_ESCOLA_CRECHE,SITUACAO_MERCADO,CUIDADOR_TRADICIONAL,GRUPO_COMUNITARIO,PLANO_PRIVADO,
|
// ID_RESPONSAVEL_FAMILIAR,NOME_RESPONSAVEL_FAMILIAR,PARENTESCO,ESCOLARIDADE,FREQ_ESCOLA_CRECHE,SITUACAO_MERCADO,CUIDADOR_TRADICIONAL,GRUPO_COMUNITARIO,PLANO_PRIVADO,
|
||||||
@@ -351,7 +337,6 @@ class DbSqliteSync{
|
|||||||
// "criancasAdulto":2,"criancasOutrasCriancas":2,"criancasAdolescente":2,"criancasSozinha":2,"criancasCresce":2,"criancasOutro":2,"identidadeGenero":null,"statusCadastro":null}
|
// "criancasAdulto":2,"criancasOutrasCriancas":2,"criancasAdolescente":2,"criancasSozinha":2,"criancasCresce":2,"criancasOutro":2,"identidadeGenero":null,"statusCadastro":null}
|
||||||
|
|
||||||
if(type=='sync'){
|
if(type=='sync'){
|
||||||
for(int i=0;value.length > i;i++){
|
|
||||||
Map<String, dynamic> row = {
|
Map<String, dynamic> row = {
|
||||||
'ID_CAD_INDIVIDUAL' : value[i]['idCadIndividual'],
|
'ID_CAD_INDIVIDUAL' : value[i]['idCadIndividual'],
|
||||||
'STATUS_CADASTRO' : value[i]['statusCadastro'],
|
'STATUS_CADASTRO' : value[i]['statusCadastro'],
|
||||||
@@ -447,7 +432,6 @@ class DbSqliteSync{
|
|||||||
int id = await db.insert('CADASTROS_INDIVIDUAIS', row);
|
int id = await db.insert('CADASTROS_INDIVIDUAIS', row);
|
||||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||||
// print(await db.query('CADASTROS_INDIVIDUAIS'));
|
// print(await db.query('CADASTROS_INDIVIDUAIS'));
|
||||||
}
|
|
||||||
}else if(type=='new'){
|
}else if(type=='new'){
|
||||||
int id = await db.insert('CADASTROS_INDIVIDUAIS', value);
|
int id = await db.insert('CADASTROS_INDIVIDUAIS', value);
|
||||||
// print('novo id $id');
|
// print('novo id $id');
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class InputSearchText extends StatelessWidget {
|
|||||||
fillColor: ColorPalette.appBar,
|
fillColor: ColorPalette.appBar,
|
||||||
prefixIcon: Icon(Icons.search),
|
prefixIcon: Icon(Icons.search),
|
||||||
border: border?OutlineInputBorder():null,
|
border: border?OutlineInputBorder():null,
|
||||||
hintText: this.hint,
|
// hintText: this.hint,
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: this.fontSizeHint,
|
fontSize: this.fontSizeHint,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:rkm/config/color_palette.dart';
|
import 'package:rkm/config/color_palette.dart';
|
||||||
|
import 'package:rkm/widgets/text_default.dart';
|
||||||
import '../controllers/format_txt.dart';
|
import '../controllers/format_txt.dart';
|
||||||
|
|
||||||
class InputText extends StatelessWidget {
|
class InputText extends StatelessWidget {
|
||||||
bool obscure;
|
bool obscure;
|
||||||
var controller;
|
var controller;
|
||||||
double fontSize;
|
double fontSize;
|
||||||
String hint;
|
String title;
|
||||||
double width;
|
double width;
|
||||||
String label;
|
|
||||||
bool enabled;
|
bool enabled;
|
||||||
TextInputType textInputType;
|
TextInputType textInputType;
|
||||||
int maxLines;
|
int maxLines;
|
||||||
@@ -21,8 +21,7 @@ class InputText extends StatelessWidget {
|
|||||||
required this.width,
|
required this.width,
|
||||||
this.obscure = false,
|
this.obscure = false,
|
||||||
this.fontSize = 15.0,
|
this.fontSize = 15.0,
|
||||||
this.hint = '',
|
this.title = '',
|
||||||
this.label = '',
|
|
||||||
this.enabled = true,
|
this.enabled = true,
|
||||||
this.textInputType = TextInputType.text,
|
this.textInputType = TextInputType.text,
|
||||||
this.maxLines = 1,
|
this.maxLines = 1,
|
||||||
@@ -34,8 +33,8 @@ class InputText extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: enabled?ColorPalette.white:ColorPalette.disable,
|
color: enabled?ColorPalette.white:ColorPalette.disable,
|
||||||
margin: EdgeInsets.only(top: 5),
|
|
||||||
width: width,
|
width: width,
|
||||||
|
margin: EdgeInsets.only(bottom: 5),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
keyboardType: textInputType,
|
keyboardType: textInputType,
|
||||||
maxLines: maxLines,
|
maxLines: maxLines,
|
||||||
@@ -51,7 +50,7 @@ class InputText extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: ColorPalette.appBar,
|
fillColor: ColorPalette.appBar,
|
||||||
labelText: label,
|
// labelText: label,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderSide: BorderSide(width: 1,color: colorBorder)
|
borderSide: BorderSide(width: 1,color: colorBorder)
|
||||||
),
|
),
|
||||||
@@ -67,7 +66,7 @@ class InputText extends StatelessWidget {
|
|||||||
borderSide: BorderSide(width: 1, color: colorBorder),
|
borderSide: BorderSide(width: 1, color: colorBorder),
|
||||||
borderRadius: BorderRadius.circular(3),
|
borderRadius: BorderRadius.circular(3),
|
||||||
),
|
),
|
||||||
hintText: this.hint,
|
// hintText: this.hint,
|
||||||
enabled: enabled,
|
enabled: enabled,
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rkm/widgets/title_input.dart';
|
||||||
import '../config/color_palette.dart';
|
import '../config/color_palette.dart';
|
||||||
import 'error_default.dart';
|
import 'error_default.dart';
|
||||||
import 'input_text.dart';
|
import 'input_text.dart';
|
||||||
@@ -53,11 +54,11 @@ class InputWithSubtitle extends StatelessWidget {
|
|||||||
// fontWeigth: FontWeight.bold,
|
// fontWeigth: FontWeight.bold,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
|
TitleInput(title:labelInput),
|
||||||
InputText(
|
InputText(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
width: widthInput,
|
width: widthInput,
|
||||||
hint: hintInput,
|
title: hintInput,
|
||||||
label: labelInput,
|
|
||||||
enabled: enabled,
|
enabled: enabled,
|
||||||
textInputType: textInputType,
|
textInputType: textInputType,
|
||||||
maxLines:maxLines,
|
maxLines:maxLines,
|
||||||
|
|||||||
17
lib/widgets/title_input.dart
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rkm/config/color_palette.dart';
|
||||||
|
import 'package:rkm/config/const_variable.dart';
|
||||||
|
import 'package:rkm/widgets/text_default.dart';
|
||||||
|
|
||||||
|
class TitleInput extends StatelessWidget {
|
||||||
|
String title;
|
||||||
|
|
||||||
|
TitleInput({
|
||||||
|
required this.title,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextDefault(text: title,color: Colors.black,fontSize: 13,textAlign: TextAlign.start);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -421,5 +421,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.18.6 <3.0.0"
|
dart: ">=2.18.0 <3.0.0"
|
||||||
flutter: ">=3.3.0"
|
flutter: ">=3.3.0"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ publish_to: 'none'
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.18.6 <3.0.0'
|
sdk: '>=2.17.6 <3.0.0'
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||