inserido o progress indicator
@@ -25,8 +25,14 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
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 {
|
||||
compileSdkVersion 32
|
||||
compileSdkVersion 33
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
@@ -43,21 +49,40 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
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
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
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 {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
minifyEnabled true
|
||||
shrinkResources false
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
disable "Instantiatable"
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
|
||||
}
|
||||
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>
|
||||
@@ -3,7 +3,7 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<application
|
||||
android:usesCleartextTraffic="true"
|
||||
android:label="RKMAB"
|
||||
android:label="RKM AB"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
|
||||
@@ -6,7 +6,7 @@ buildscript {
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.suppressUnsupportedCompileSdk=33
|
||||
|
||||
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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 'package:gainer_crypto/crypto.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rkm/service/db/db_querys.dart';
|
||||
|
||||
@@ -49,7 +49,7 @@ class _ImportSigtapScreenState extends State<ImportSigtapScreen> {
|
||||
setState(() {
|
||||
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().saveProceduresRegisterSigtapDB(valueAPI['procedimentosRegistros']).then((value)async{
|
||||
setState(() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:rkm/config/color_palette.dart';
|
||||
import 'package:rkm/widgets/alert_dialog_default.dart';
|
||||
import 'package:rkm/widgets/button_default.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import '../config/const_variable.dart';
|
||||
import '../service/api/api_data_load.dart';
|
||||
import '../service/db/db_sqlite_load.dart';
|
||||
import '../service/shared_preferences/shared_preferences_service.dart';
|
||||
@@ -25,6 +26,8 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
||||
bool loading = false;
|
||||
String nameCityApi = '';
|
||||
String user = '';
|
||||
double countProg = 0.0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -53,76 +56,117 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
||||
print('idUsuario $idUsuario');
|
||||
_prefService.createCacheidUsuario(idUsuario).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(() {
|
||||
messageSteps = "Etapa 1 de 7 - Gravando as Unidades no Aplicativo";
|
||||
});
|
||||
await DbSqliteLoad().saveUnidadesDB(value).then((value)async{
|
||||
await ApiDataLoad().loadProcedimentos(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
setState(() {
|
||||
messageSteps = "Etapa 2 de 7 - Gravando os Procedimentos no Aplicativo";
|
||||
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{
|
||||
setState(() {
|
||||
messageSteps = "Etapa 2 de 7 - Gravando os Procedimentos no Aplicativo";
|
||||
});
|
||||
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(() {});
|
||||
});
|
||||
await DbSqliteLoad().saveProceduresDB(value).then((value)async{
|
||||
print('finalizou save Procedures');
|
||||
await ApiDataLoad().loadProcedimentosRegistros(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
await DbSqliteLoad().saveProceduresRegisterDB(value).then((value)async{
|
||||
print('finalizou saveProceduresRegisterDB');
|
||||
await ApiDataLoad().loadCID(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadCID');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 3 de 7 - Gravando os CIDs no Aplicativo";
|
||||
});
|
||||
await DbSqliteLoad().saveCID(value).then((value)async{
|
||||
print('finalizou saveCID');
|
||||
await ApiDataLoad().loadProcedimentosCID(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadProcedimentosCID');
|
||||
await DbSqliteLoad().saveProceduresCID(value).then((value)async{
|
||||
print('finalizou saveProceduresCID');
|
||||
await ApiDataLoad().loadCBO(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadCBO');
|
||||
}
|
||||
print('finalizou save Procedures');
|
||||
await ApiDataLoad().loadProcedimentosRegistros(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
await DbSqliteLoad().saveProceduresRegisterDB(value).then((value)async{
|
||||
print('finalizou saveProceduresRegisterDB');
|
||||
await ApiDataLoad().loadCID(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadCID');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 3 de 7 - Gravando os CIDs no Aplicativo";
|
||||
});
|
||||
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');
|
||||
await ApiDataLoad().loadProcedimentosCID(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadProcedimentosCID');
|
||||
await DbSqliteLoad().saveProceduresCID(value).then((value)async{
|
||||
print('finalizou saveProceduresCID');
|
||||
await ApiDataLoad().loadCBO(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadCBO');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 4 de 7 - Gravando os CBOs no Aplicativo";
|
||||
});
|
||||
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');
|
||||
await ApiDataLoad().loadProcedimentosCBO(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadProcedimentosCBO');
|
||||
await DbSqliteLoad().saveProceduresCBO(value).then((value)async{
|
||||
print('finalizou saveProceduresCBO');
|
||||
await ApiDataLoad().loadCIAP(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadCIAP');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 4 de 7 - Gravando os CBOs no Aplicativo";
|
||||
messageSteps = "Etapa 5 de 7 - Gravando os CIAPs no Aplicativo";
|
||||
});
|
||||
await DbSqliteLoad().saveCBO(value).then((value)async{
|
||||
print('finalizou saveCBO');
|
||||
await ApiDataLoad().loadProcedimentosCBO(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadProcedimentosCBO');
|
||||
await DbSqliteLoad().saveProceduresCBO(value).then((value)async{
|
||||
print('finalizou saveProceduresCBO');
|
||||
await ApiDataLoad().loadCIAP(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadCIAP');
|
||||
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');
|
||||
await ApiDataLoad().loadMunicipios(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadMunicipios');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 6 de 7 - Gravando os Municípios no Aplicativo";
|
||||
});
|
||||
List list = value;
|
||||
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{
|
||||
print('loadEquipes');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 7 de 7 - Gravando as Equipes no Aplicativo";
|
||||
});
|
||||
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');
|
||||
await ApiDataLoad().loadEquipeComponentes(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadEquipeComponentes');
|
||||
await DbSqliteLoad().saveTeamComponents(value).then((value)async{
|
||||
print('finalizou saveTeamComponents');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 5 de 7 - Gravando os CIAPs no Aplicativo";
|
||||
});
|
||||
await DbSqliteLoad().saveCIAP(value).then((value)async{
|
||||
print('finalizou saveCIAP');
|
||||
await ApiDataLoad().loadMunicipios(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadMunicipios');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 6 de 7 - Gravando os Municípios no Aplicativo";
|
||||
});
|
||||
await DbSqliteLoad().saveCity(value).then((value)async{
|
||||
print('finalizou saveCity');
|
||||
await ApiDataLoad().loadEquipes(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadEquipes');
|
||||
setState(() {
|
||||
messageSteps = "Etapa 7 de 7 - Gravando as Equipes no Aplicativo";
|
||||
});
|
||||
await DbSqliteLoad().saveTeam(value).then((value)async{
|
||||
print('finalizou saveTeam');
|
||||
await ApiDataLoad().loadEquipeComponentes(urlAPI,mode,nameCityApi,user).then((value)async{
|
||||
print('loadEquipeComponentes');
|
||||
await DbSqliteLoad().saveTeamComponents(value).then((value)async{
|
||||
print('finalizou saveTeamComponents');
|
||||
setState(() {
|
||||
finish = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
finish = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -223,7 +267,11 @@ class _LoadInitScreenState extends State<LoadInitScreen> {
|
||||
fontWeigth: FontWeight.bold,
|
||||
textAlign: TextAlign.center,
|
||||
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:rkm/controllers/main_controllers.dart';
|
||||
import 'package:rkm/screens/home_screen.dart';
|
||||
import 'package:rkm/service/api/url_api_const.dart';
|
||||
import 'package:rkm/config/color_palette.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/db/db_sqlite_load.dart';
|
||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||
import '../../widgets/title_input.dart';
|
||||
import '../load_init_screen.dart';
|
||||
class LoginLoadScreen extends StatefulWidget {
|
||||
const LoginLoadScreen({Key? key}) : super(key: key);
|
||||
@@ -28,8 +30,8 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
String? now;
|
||||
String? selectCity;
|
||||
int contLogo = 0;
|
||||
String mode = 'desenvolvimento';
|
||||
String urlAPI = UrlApiConst.ApiUrlDesenvolvimento;
|
||||
String mode = 'online';
|
||||
String urlAPI = UrlApiConst.ApiUrlOnline;
|
||||
bool loading = false;
|
||||
String nameCityApi = '';
|
||||
String nameCityFront = '';
|
||||
@@ -97,7 +99,8 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
nameCityApi,
|
||||
nameCityFront,
|
||||
codState,
|
||||
codCityIbge).then((value) {
|
||||
codCityIbge
|
||||
).then((value) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
@@ -189,23 +192,24 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
height: mode == 'desenvolvimento'?height*0.4:height*0.3,
|
||||
child: ListView(
|
||||
children: [
|
||||
TitleInput(title:'Usuário'),
|
||||
InputText(
|
||||
hint: 'Usuário',
|
||||
label: 'Usuário',
|
||||
title: 'Usuário',
|
||||
controller: inputUser,
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
TitleInput(title:'Senha'),
|
||||
InputText(
|
||||
hint: 'Senha',
|
||||
label: 'Senha',
|
||||
title: 'Senha',
|
||||
obscure: true,
|
||||
controller: inputPassword,
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
TitleInput(title:'Cidade'),
|
||||
DropDownButtonCity(
|
||||
error: 'Campo obrigatório',
|
||||
validator: mandatory,
|
||||
@@ -217,18 +221,18 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
});
|
||||
},
|
||||
),
|
||||
mode == 'desenvolvimento'?TitleInput(title:'IP'):Container(),
|
||||
mode == 'desenvolvimento'?InputText(
|
||||
hint: 'IP',
|
||||
label: 'IP',
|
||||
title: 'IP',
|
||||
obscure: false,
|
||||
controller: inputIP,
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
):Container(),
|
||||
mode == 'desenvolvimento'?TitleInput(title:'Porta'):Container(),
|
||||
mode == 'desenvolvimento'?InputText(
|
||||
hint: 'Porta',
|
||||
label: 'Porta',
|
||||
title: 'Porta',
|
||||
obscure: false,
|
||||
controller: inputPort,
|
||||
width: width*0.6,
|
||||
@@ -240,6 +244,12 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
),
|
||||
),
|
||||
loading?Container():ButtonDefault(
|
||||
// onPressed: (){
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => HomeScreen()));
|
||||
// },
|
||||
onPressed: ()=>checkLogin(),
|
||||
title: 'Carga Inicial',
|
||||
width: width*0.6,
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:rkm/widgets/text_default.dart';
|
||||
import '../../controllers/main_controllers.dart';
|
||||
import '../../service/api/api_data_load.dart';
|
||||
import '../../service/db/db_sqlite_load.dart';
|
||||
import '../../widgets/title_input.dart';
|
||||
class LoginSavedScreen extends StatefulWidget {
|
||||
List listControl;
|
||||
|
||||
@@ -156,17 +157,17 @@ class _LoginSavedScreenState extends State<LoginSavedScreen> {
|
||||
height: height*0.2,
|
||||
child: ListView(
|
||||
children: [
|
||||
TitleInput(title:'Usuário'),
|
||||
InputText(
|
||||
hint: 'Usuário',
|
||||
label: inputUser.text.isNotEmpty?'':'Usuário',
|
||||
title: 'Usuário',
|
||||
controller: inputUser,
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
TitleInput(title:'Senha'),
|
||||
InputText(
|
||||
hint: 'Senha',
|
||||
label: inputPassword.text.isNotEmpty?'':'Senha',
|
||||
title: 'Senha',
|
||||
obscure: true,
|
||||
controller: inputPassword,
|
||||
width: width*0.6,
|
||||
|
||||
@@ -11,6 +11,7 @@ import '../../controllers/main_controllers.dart';
|
||||
import '../../service/api/api_data_load.dart';
|
||||
import '../../service/db/db_sqlite_load.dart';
|
||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||
import '../../widgets/title_input.dart';
|
||||
class SyncLoginScreen extends StatefulWidget {
|
||||
|
||||
@override
|
||||
@@ -197,26 +198,27 @@ class _SyncLoginScreenState extends State<SyncLoginScreen> {
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: Container(
|
||||
width: width*0.6,
|
||||
height: height*0.35,
|
||||
height: height*0.4,
|
||||
child: ListView(
|
||||
children: [
|
||||
TitleInput(title:'Usuário'),
|
||||
InputText(
|
||||
hint: 'Usuário',
|
||||
label: inputUser.text.isNotEmpty?'':'Usuário',
|
||||
title: 'Usuário',
|
||||
controller: inputUser,
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
TitleInput(title:'Senha'),
|
||||
InputText(
|
||||
hint: 'Senha',
|
||||
label: inputPassword.text.isNotEmpty?'':'Senha',
|
||||
title: 'Senha',
|
||||
obscure: true,
|
||||
controller: inputPassword,
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
TitleInput(title:'Unidade'),
|
||||
DropDownButtonDefault(
|
||||
width: width*0.7,
|
||||
title: 'Unidade',
|
||||
@@ -231,6 +233,7 @@ class _SyncLoginScreenState extends State<SyncLoginScreen> {
|
||||
getTeam();
|
||||
},
|
||||
),
|
||||
TitleInput(title:'Equipe'),
|
||||
DropDownButtonDefault(
|
||||
width: width*0.7,
|
||||
title: 'Equipe',
|
||||
|
||||
@@ -458,7 +458,7 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
|
||||
'ATENDIMENTOS' : '',
|
||||
'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){
|
||||
AlertDialogDefault().alert(
|
||||
context,
|
||||
|
||||
@@ -361,7 +361,7 @@ class _RegisterHomeScreenState extends State<RegisterHomeScreen> {
|
||||
'CARGO_RESP_TECNICO_INST' : CARGO_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(
|
||||
context,
|
||||
'Aviso',
|
||||
|
||||
@@ -545,7 +545,7 @@ class _RegisterIndividualScreenState extends State<RegisterIndividualScreen> {
|
||||
'CRIANCAS_OUTRO' : CRIANCAS_OUTRO?1:2,
|
||||
'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(
|
||||
context,
|
||||
'Aviso',
|
||||
|
||||
@@ -34,6 +34,7 @@ class _SyncInitScreenState extends State<SyncInitScreen> {
|
||||
int codCity = 0;
|
||||
int codCityIbge = 0;
|
||||
String codState = '';
|
||||
double countProg = 0.0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -85,74 +86,128 @@ class _SyncInitScreenState extends State<SyncInitScreen> {
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 2 de 10 - Gravando os Bairros no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertBairros(value).then((value)async{
|
||||
await ApiDataSync().syncTiposLogradouros(urlAPI,mode,nameCityApi,user).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{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Tipos de Logradouros - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 3 de 10 - Gravando os Tipos de Logradouros no Aplicativo");
|
||||
}
|
||||
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{
|
||||
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 Logradouros - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 3 de 10 - Gravando os Tipos de Logradouros no Aplicativo");
|
||||
setState(()=> messageSteps = "Etapa 4 de 10 - Gravando os Logradouros no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertTiposLogradouros(value).then((value)async{
|
||||
await ApiDataSync().syncLogradouros(urlAPI,mode,nameCityApi,user).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{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Loteamentos - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 5 de 10 - Gravando os Loteamentos no Aplicativo");
|
||||
}
|
||||
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{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Logradouros - Por favor, tente novamente!");
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Profissionais - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 4 de 10 - Gravando os Logradouros no Aplicativo");
|
||||
setState(()=> messageSteps = "Etapa 6 de 10 - Gravando os Profissionais no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertLogradouros(value).then((value)async{
|
||||
await ApiDataSync().syncLoteamentos(urlAPI,mode,nameCityApi,user).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{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os CBOs dos Profissionais - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 7 de 10 - Gravando os CBO´s dos Profissionais no Aplicativo");
|
||||
}
|
||||
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{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Loteamentos - Por favor, tente novamente!");
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros dos Cidadãos - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 5 de 10 - Gravando os Loteamentos no Aplicativo");
|
||||
setState(()=> messageSteps = "Etapa 8 de 10 - Gravando os Cidadãos no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertLoteamentos(value).then((value)async{
|
||||
await ApiDataSync().syncProfissionais(urlAPI,mode,nameCityApi,user,idUnidade).then((value)async{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Profissionais - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 6 de 10 - Gravando os Profissionais no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertProfissionais(value).then((value)async{
|
||||
await ApiDataSync().syncProfissionaisCBOs(urlAPI,mode,nameCityApi,user,idUnidade).then((value)async{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os CBOs dos Profissionais - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 7 de 10 - Gravando os CBO´s dos Profissionais no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertProfissionaisCBOs(value).then((value)async{
|
||||
await ApiDataSync().syncCidadaos(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros dos Cidadãos - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 8 de 10 - Gravando os Cidadãos no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertCidadaos(value,'sync','').then((value)async{
|
||||
await ApiDataSync().syncCadastrosDomiciliares(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Domiciliares - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 9 de 10 - Gravando os Cadastros Domiciliares no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertCadastrosDomiciliares(value,'sync',0,0,'').then((value)async{
|
||||
await ApiDataSync().syncCadastrosIndividuais(urlAPI,mode,nameCityApi,user,idUnidade,area,microarea,foraArea).then((value)async{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Individuais - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 10 de 10 - Gravando os Cadastros Individuais no Aplicativo");
|
||||
}
|
||||
await DbSqliteSync().insertCadastrosIndividuais(value,'sync',0).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');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
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{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Domiciliares - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 9 de 10 - Gravando os Cadastros Domiciliares no Aplicativo");
|
||||
}
|
||||
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{
|
||||
if(value.length == 0){
|
||||
setState(()=> messageSteps = "ERRO: Erro para carregar os Cadastros Individuais - Por favor, tente novamente!");
|
||||
}else{
|
||||
setState(()=> messageSteps = "Etapa 10 de 10 - Gravando os Cadastros Individuais no Aplicativo");
|
||||
}
|
||||
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{
|
||||
Navigator.pushNamed(context, '/home');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -245,7 +300,11 @@ class _SyncInitScreenState extends State<SyncInitScreen> {
|
||||
fontWeigth: FontWeight.bold,
|
||||
textAlign: TextAlign.center,
|
||||
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"}
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'COD_PROC_SIGTAP' : value['codProcedimento'],
|
||||
'DESC_PROC_SIGTAP' : value['nome'],
|
||||
'GRUPO_PROC_SIGTAP' : value['codGrupo'],
|
||||
'QTDE_MAXIMA' : value['qtdeMax'],
|
||||
'IDADE_MIN' : value['idadeMin'],
|
||||
'IDADE_MAX' : value['idadeMax'],
|
||||
'SEXO' : value['sexo'],
|
||||
'COD_PROC_SIGTAP' : value[i]['codProcedimento'],
|
||||
'DESC_PROC_SIGTAP' : value[i]['nome'],
|
||||
'GRUPO_PROC_SIGTAP' : value[i]['codGrupo'],
|
||||
'QTDE_MAXIMA' : value[i]['qtdeMax'],
|
||||
'IDADE_MIN' : value[i]['idadeMin'],
|
||||
'IDADE_MAX' : value[i]['idadeMax'],
|
||||
'SEXO' : value[i]['sexo'],
|
||||
};
|
||||
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:path/path.dart';
|
||||
|
||||
@@ -141,39 +143,35 @@ class DbSqliteLoad{
|
||||
return db;
|
||||
}
|
||||
|
||||
Future saveUnidadesDB(var value)async{
|
||||
Future saveUnidadesDB(var value,int i)async{
|
||||
Database db = await intialDB();
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_UNIDADE' : value[i]['idUnidade'],
|
||||
'NOME_UNIDADE' : value[i]['nomeFantasia'],
|
||||
'CNES_UNIDADE' : value[i]['nrCNES']
|
||||
};
|
||||
int id = await db.insert('UNIDADES', row);
|
||||
Map<String, dynamic> row = {
|
||||
'ID_UNIDADE' : value[i]['idUnidade'],
|
||||
'NOME_UNIDADE' : value[i]['nomeFantasia'],
|
||||
'CNES_UNIDADE' : value[i]['nrCNES']
|
||||
};
|
||||
int id = await db.insert('UNIDADES', row);
|
||||
// print('id increment $id');
|
||||
// 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();
|
||||
|
||||
// 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"}
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'COD_PROC_SIGTAP' : value[i]['codProcedimento'],
|
||||
'DESC_PROC_SIGTAP' : value[i]['nome'],
|
||||
'GRUPO_PROC_SIGTAP' : value[i]['codGrupo'],
|
||||
'QTDE_MAXIMA' : value[i]['qtdeMax'],
|
||||
'IDADE_MIN' : value[i]['idadeMin'],
|
||||
'IDADE_MAX' : value[i]['idadeMax'],
|
||||
'SEXO' : value[i]['sexo'],
|
||||
};
|
||||
int id = await db.insert('PROCEDIMENTOS_SIGTAP', row);
|
||||
// print('id increment $id');
|
||||
// print(await db.query('PROCEDIMENTOS_SIGTAP'));
|
||||
}
|
||||
Map<String, dynamic> row = {
|
||||
'COD_PROC_SIGTAP' : value[i]['codProcedimento'],
|
||||
'DESC_PROC_SIGTAP' : value[i]['nome'],
|
||||
'GRUPO_PROC_SIGTAP' : value[i]['codGrupo'],
|
||||
'QTDE_MAXIMA' : value[i]['qtdeMax'],
|
||||
'IDADE_MIN' : value[i]['idadeMin'],
|
||||
'IDADE_MAX' : value[i]['idadeMax'],
|
||||
'SEXO' : value[i]['sexo'],
|
||||
};
|
||||
int id = await db.insert('PROCEDIMENTOS_SIGTAP', row);
|
||||
// print('id increment $id');
|
||||
// print(await db.query('PROCEDIMENTOS_SIGTAP'));
|
||||
return db;
|
||||
}
|
||||
Future saveProceduresRegisterDB(var value)async{
|
||||
@@ -191,19 +189,17 @@ class DbSqliteLoad{
|
||||
}
|
||||
return db;
|
||||
}
|
||||
Future saveCID(var value)async{
|
||||
Future saveCID(var value,int i)async{
|
||||
Database db = await intialDB();
|
||||
// "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"},
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'CODIGO_CID' : value[i]['codCID'],
|
||||
'DESCRICAO_CID' : value[i]['descCID'],
|
||||
'RESTRICAO_SEXO' : value[i]['restSexo'],
|
||||
};
|
||||
int id = await db.insert('CIDS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
}
|
||||
Map<String, dynamic> row = {
|
||||
'CODIGO_CID' : value[i]['codCID'],
|
||||
'DESCRICAO_CID' : value[i]['descCID'],
|
||||
'RESTRICAO_SEXO' : value[i]['restSexo'],
|
||||
};
|
||||
int id = await db.insert('CIDS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('CIDS'));
|
||||
return db;
|
||||
}
|
||||
@@ -222,18 +218,16 @@ class DbSqliteLoad{
|
||||
// print(await db.query('PROCEDIMENTOS_SIGTAP_CID'));
|
||||
return db;
|
||||
}
|
||||
Future saveCBO(var value)async{
|
||||
Future saveCBO(var value,int i)async{
|
||||
Database db = await intialDB();
|
||||
// "INSERT OR REPLACE INTO CBOS (CODIGO_CBO, DESCRICAO_CBO) VALUES (?,?)"
|
||||
// "codCBO":"223208","descCBO":"Cirurgi\u00e3o dentista - cl\u00ednico geral"
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'CODIGO_CBO' : value[i]['codCBO'],
|
||||
'DESCRICAO_CBO' : value[i]['descCBO'],
|
||||
};
|
||||
int id = await db.insert('CBOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
}
|
||||
// print(await db.query('CBOS'));
|
||||
return db;
|
||||
}
|
||||
@@ -252,57 +246,51 @@ class DbSqliteLoad{
|
||||
// print(await db.query('PROCEDIMENTOS_SIGTAP_CBO'));
|
||||
return db;
|
||||
}
|
||||
Future saveCIAP(var value)async{
|
||||
Future saveCIAP(var value,int i)async{
|
||||
Database db = await intialDB();
|
||||
// "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"
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'CODIGO_CIAP' : value[i]['codCIAP'],
|
||||
'DESC_CIAP' : value[i]['descCIAP'],
|
||||
'TIPO_CIAP' : value[i]['tipoCIAP'],
|
||||
};
|
||||
int id = await db.insert('CIAPS', row);
|
||||
// print('id increment $id CIAPS');
|
||||
}
|
||||
Map<String, dynamic> row = {
|
||||
'CODIGO_CIAP' : value[i]['codCIAP'],
|
||||
'DESC_CIAP' : value[i]['descCIAP'],
|
||||
'TIPO_CIAP' : value[i]['tipoCIAP'],
|
||||
};
|
||||
int id = await db.insert('CIAPS', row);
|
||||
// print('id increment $id CIAPS');
|
||||
// print(await db.query('CIAPS'));
|
||||
return db;
|
||||
}
|
||||
Future saveCity(var value)async{
|
||||
Future saveCity(var value,int i)async{
|
||||
Database db = await intialDB();
|
||||
// "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
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_MUNICIPIO' : value[i]['idMunicipio'],
|
||||
'CODIGO_IBGE' : value[i]['codIBGE'],
|
||||
'NO_MUNICIPIO' : value[i]['nomeMunicipio'],
|
||||
'UF_ESTADO' : value[i]['UF'],
|
||||
'ID_PAIS' : value[i]['idPais'],
|
||||
};
|
||||
int id = await db.insert('MUNICIPIOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
}
|
||||
Map<String, dynamic> row = {
|
||||
'ID_MUNICIPIO' : value[i]['idMunicipio'],
|
||||
'CODIGO_IBGE' : value[i]['codIBGE'],
|
||||
'NO_MUNICIPIO' : value[i]['nomeMunicipio'],
|
||||
'UF_ESTADO' : value[i]['UF'],
|
||||
'ID_PAIS' : value[i]['idPais'],
|
||||
};
|
||||
int id = await db.insert('MUNICIPIOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('MUNICIPIOS'));
|
||||
return db;
|
||||
}
|
||||
Future saveTeam(var value)async{
|
||||
Future saveTeam(var value,int i)async{
|
||||
Database db = await intialDB();
|
||||
// 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}
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_EQUIPE' : value[i]['idEquipe'],
|
||||
'ID_UNIDADE' : value[i]['idUnidade'],
|
||||
'INE' : value[i]['INE'],
|
||||
'ID_ATB_AREA' : value[i]['idAtbArea'],
|
||||
'AREA' : value[i]['area'],
|
||||
'ID_ATB_MICROAREA': value[i]['idAtbMicroarea'],
|
||||
'MICROAREA' : value[i]['microarea'],
|
||||
};
|
||||
int id = await db.insert('EQUIPES', row);
|
||||
// print('id increment $id EQUIPES');
|
||||
}
|
||||
Map<String, dynamic> row = {
|
||||
'ID_EQUIPE' : value[i]['idEquipe'],
|
||||
'ID_UNIDADE' : value[i]['idUnidade'],
|
||||
'INE' : value[i]['INE'],
|
||||
'ID_ATB_AREA' : value[i]['idAtbArea'],
|
||||
'AREA' : value[i]['area'],
|
||||
'ID_ATB_MICROAREA': value[i]['idAtbMicroarea'],
|
||||
'MICROAREA' : value[i]['microarea'],
|
||||
};
|
||||
int id = await db.insert('EQUIPES', row);
|
||||
// print('id increment $id EQUIPES');
|
||||
// print(await db.query('EQUIPES'));
|
||||
return db;
|
||||
}
|
||||
|
||||
@@ -22,104 +22,94 @@ class DbSqliteSync{
|
||||
db.execute(querys[i]);
|
||||
}
|
||||
}
|
||||
Future insertBairros(var value)async{
|
||||
Future insertBairros(var value,int i)async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
//"idBairro":2,"nomeBairro":"RURAL"
|
||||
// BAIRROS (ID_BAIRRO INTEGER PRIMARY KEY AUTOINCREMENT, NO_BAIRRO TEXT);');
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_BAIRRO' : value[i]['idBairro'],
|
||||
'NO_BAIRRO' : value[i]['nomeBairro'],
|
||||
};
|
||||
int id = await db.insert('BAIRROS', row);
|
||||
// print('id increment $id');
|
||||
}
|
||||
Map<String, dynamic> row = {
|
||||
'ID_BAIRRO' : value[i]['idBairro'],
|
||||
'NO_BAIRRO' : value[i]['nomeBairro'],
|
||||
};
|
||||
int id = await db.insert('BAIRROS', row);
|
||||
// print('id increment $id');
|
||||
// print(await db.query('BAIRROS'));
|
||||
return db;
|
||||
}
|
||||
Future insertTiposLogradouros(var value)async{
|
||||
Future insertTiposLogradouros(var value,int i)async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
|
||||
// LOGRADOUROS_TIPOS (ID_LOGR_TIPO INTEGER PRIMARY KEY AUTOINCREMENT, NO_LOGR_TIPO TEXT);
|
||||
// {"idTipoLogradouro":0,"nomeTipoLogradouro":"NAO DEFINIDO"}
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
||||
'NO_LOGR_TIPO' : value[i]['nomeTipoLogradouro'],
|
||||
};
|
||||
int id = await db.insert('LOGRADOUROS_TIPOS', row);
|
||||
// print('id increment $id');
|
||||
// print(await db.query('LOGRADOUROS_TIPOS'));
|
||||
}
|
||||
return db;
|
||||
Map<String, dynamic> row = {
|
||||
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
||||
'NO_LOGR_TIPO' : value[i]['nomeTipoLogradouro'],
|
||||
};
|
||||
int id = await db.insert('LOGRADOUROS_TIPOS', row);
|
||||
// print('id increment $id');
|
||||
// print(await db.query('LOGRADOUROS_TIPOS'));
|
||||
return db;
|
||||
}
|
||||
Future insertLogradouros(var value)async{
|
||||
Future insertLogradouros(var value,int i)async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
// 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
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_LOGR_ENDERECO' : value[i]['idLogradouro'],
|
||||
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
||||
'DESC_LOGR_ENDERECO' : value[i]['descLogradouro'],
|
||||
'ID_BAIRRO' : value[i]['idBairro'],
|
||||
};
|
||||
int id = await db.insert('LOGRADOUROS_ENDERECOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('LOGRADOUROS_ENDERECOS'));
|
||||
}
|
||||
return db;
|
||||
|
||||
Map<String, dynamic> row = {
|
||||
'ID_LOGR_ENDERECO' : value[i]['idLogradouro'],
|
||||
'ID_LOGR_TIPO' : value[i]['idTipoLogradouro'],
|
||||
'DESC_LOGR_ENDERECO' : value[i]['descLogradouro'],
|
||||
'ID_BAIRRO' : value[i]['idBairro'],
|
||||
};
|
||||
int id = await db.insert('LOGRADOUROS_ENDERECOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('LOGRADOUROS_ENDERECOS'));
|
||||
|
||||
return db;
|
||||
}
|
||||
Future insertLoteamentos(var value)async{
|
||||
Future insertLoteamentos(var value,int i)async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
// LOGRADOUROS_LOTEAMENTOS (ID_LOGR_LOTEAMENTO INTEGER PRIMARY KEY AUTOINCREMENT, DESC_LOGR_LOTEAMENTO TEXT);
|
||||
// "idLoteamento":1,"descLoteamento":"ASSENTAMENTO MARINEL"
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_LOGR_LOTEAMENTO' : value[i]['idLoteamento'],
|
||||
'DESC_LOGR_LOTEAMENTO' : value[i]['descLoteamento'],
|
||||
};
|
||||
int id = await db.insert('LOGRADOUROS_LOTEAMENTOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('LOGRADOUROS_LOTEAMENTOS'));
|
||||
}
|
||||
return db;
|
||||
Map<String, dynamic> row = {
|
||||
'ID_LOGR_LOTEAMENTO' : value[i]['idLoteamento'],
|
||||
'DESC_LOGR_LOTEAMENTO' : value[i]['descLoteamento'],
|
||||
};
|
||||
int id = await db.insert('LOGRADOUROS_LOTEAMENTOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('LOGRADOUROS_LOTEAMENTOS'));
|
||||
return db;
|
||||
}
|
||||
Future insertProfissionais(var value)async{
|
||||
Future insertProfissionais(var value,int i)async{
|
||||
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);');
|
||||
// "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 = {
|
||||
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
||||
'NOME_PROFISSIONAL': value[i]['nomeProfissional'],
|
||||
'CNS_PROFISSIONAL' : value[i]['CNSProfissional'],
|
||||
'USERNAME' : value[i]['username'],
|
||||
'SENHA' : value[i]['senha'],
|
||||
'BLOQUEIO_ACESSO' : value[i]['bloqueioAcesso'],
|
||||
};
|
||||
int id = await db.insert('PROFISSIONAIS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('PROFISSIONAIS'));
|
||||
}
|
||||
Map<String, dynamic> row = {
|
||||
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
||||
'NOME_PROFISSIONAL': value[i]['nomeProfissional'],
|
||||
'CNS_PROFISSIONAL' : value[i]['CNSProfissional'],
|
||||
'USERNAME' : value[i]['username'],
|
||||
'SENHA' : value[i]['senha'],
|
||||
'BLOQUEIO_ACESSO' : value[i]['bloqueioAcesso'],
|
||||
};
|
||||
int id = await db.insert('PROFISSIONAIS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('PROFISSIONAIS'));
|
||||
return db;
|
||||
}
|
||||
Future insertProfissionaisCBOs(var value)async{
|
||||
Future insertProfissionaisCBOs(var value,int i)async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
// PROFISSIONAIS_CBOS (ID_PROFISSIONAL INTEGER, CODIGO_CBO TEXT);');
|
||||
// "idProfissional":1,"codCBO":"225125"
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
||||
'CODIGO_CBO' : value[i]['codCBO'],
|
||||
};
|
||||
int id = await db.insert('PROFISSIONAIS_CBOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('PROFISSIONAIS_CBOS'));
|
||||
}
|
||||
return db;
|
||||
Map<String, dynamic> row = {
|
||||
'ID_PROFISSIONAL' : value[i]['idProfissional'],
|
||||
'CODIGO_CBO' : value[i]['codCBO'],
|
||||
};
|
||||
int id = await db.insert('PROFISSIONAIS_CBOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('PROFISSIONAIS_CBOS'));
|
||||
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();
|
||||
// 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,
|
||||
@@ -141,7 +131,6 @@ class DbSqliteSync{
|
||||
'"idUsuarioCadastro":null';
|
||||
|
||||
if(type=='sync'){
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_CIDADAO' : value[i]['idCidadao'],
|
||||
'CD_USUARIO_SUS' : value[i]['cdUsuarioSus'],
|
||||
@@ -228,7 +217,6 @@ class DbSqliteSync{
|
||||
int id = await db.insert('CIDADAOS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('CIDADAOS'));
|
||||
}
|
||||
}else if(type=='new'){
|
||||
int id = await db.insert('CIDADAOS', value);
|
||||
// print('novo id $id');
|
||||
@@ -237,7 +225,7 @@ class DbSqliteSync{
|
||||
}
|
||||
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();
|
||||
// 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,
|
||||
@@ -251,7 +239,6 @@ class DbSqliteSync{
|
||||
// "cnesUnidade":"9372253","cboRespCadastro":"515105","ine":"0001485628","dtCadastro":"2021-11-10","cdEquipe":5,"noInstPermanencia":null,"outrosProfissionaisInst":null,
|
||||
// "noResponsavelInst":null,"cnsResponsavelInst":null,"gargoResponsavelInst":null,"telefoneResponsavelInst":null
|
||||
if(type=='sync'){
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_DOMICILIO' : value[i]['cdDomicilio'],
|
||||
'TIPO_IMOVEL' : value[i]['cdTipoImovel'],
|
||||
@@ -294,7 +281,6 @@ class DbSqliteSync{
|
||||
int id = await db.insert('CIDADAO_DOMICILIO', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('CIDADAO_DOMICILIO'));
|
||||
}
|
||||
}else if(type=='new'){
|
||||
int id = await db.insert('CIDADAO_DOMICILIO', value);
|
||||
print('novo id $id');
|
||||
@@ -325,7 +311,7 @@ class DbSqliteSync{
|
||||
|
||||
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();
|
||||
// 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,
|
||||
@@ -351,7 +337,6 @@ class DbSqliteSync{
|
||||
// "criancasAdulto":2,"criancasOutrasCriancas":2,"criancasAdolescente":2,"criancasSozinha":2,"criancasCresce":2,"criancasOutro":2,"identidadeGenero":null,"statusCadastro":null}
|
||||
|
||||
if(type=='sync'){
|
||||
for(int i=0;value.length > i;i++){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_CAD_INDIVIDUAL' : value[i]['idCadIndividual'],
|
||||
'STATUS_CADASTRO' : value[i]['statusCadastro'],
|
||||
@@ -447,7 +432,6 @@ class DbSqliteSync{
|
||||
int id = await db.insert('CADASTROS_INDIVIDUAIS', row);
|
||||
// print('id increment $id PROCEDIMENTOS_SIGTAP_REGISTRO');
|
||||
// print(await db.query('CADASTROS_INDIVIDUAIS'));
|
||||
}
|
||||
}else if(type=='new'){
|
||||
int id = await db.insert('CADASTROS_INDIVIDUAIS', value);
|
||||
// print('novo id $id');
|
||||
|
||||
@@ -40,7 +40,7 @@ class InputSearchText extends StatelessWidget {
|
||||
fillColor: ColorPalette.appBar,
|
||||
prefixIcon: Icon(Icons.search),
|
||||
border: border?OutlineInputBorder():null,
|
||||
hintText: this.hint,
|
||||
// hintText: this.hint,
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: this.fontSizeHint,
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rkm/config/color_palette.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import '../controllers/format_txt.dart';
|
||||
|
||||
class InputText extends StatelessWidget {
|
||||
bool obscure;
|
||||
var controller;
|
||||
double fontSize;
|
||||
String hint;
|
||||
String title;
|
||||
double width;
|
||||
String label;
|
||||
bool enabled;
|
||||
TextInputType textInputType;
|
||||
int maxLines;
|
||||
@@ -21,8 +21,7 @@ class InputText extends StatelessWidget {
|
||||
required this.width,
|
||||
this.obscure = false,
|
||||
this.fontSize = 15.0,
|
||||
this.hint = '',
|
||||
this.label = '',
|
||||
this.title = '',
|
||||
this.enabled = true,
|
||||
this.textInputType = TextInputType.text,
|
||||
this.maxLines = 1,
|
||||
@@ -34,8 +33,8 @@ class InputText extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: enabled?ColorPalette.white:ColorPalette.disable,
|
||||
margin: EdgeInsets.only(top: 5),
|
||||
width: width,
|
||||
margin: EdgeInsets.only(bottom: 5),
|
||||
child: TextFormField(
|
||||
keyboardType: textInputType,
|
||||
maxLines: maxLines,
|
||||
@@ -51,7 +50,7 @@ class InputText extends StatelessWidget {
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
fillColor: ColorPalette.appBar,
|
||||
labelText: label,
|
||||
// labelText: label,
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(width: 1,color: colorBorder)
|
||||
),
|
||||
@@ -67,7 +66,7 @@ class InputText extends StatelessWidget {
|
||||
borderSide: BorderSide(width: 1, color: colorBorder),
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
hintText: this.hint,
|
||||
// hintText: this.hint,
|
||||
enabled: enabled,
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.black,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/widgets/title_input.dart';
|
||||
import '../config/color_palette.dart';
|
||||
import 'error_default.dart';
|
||||
import 'input_text.dart';
|
||||
@@ -53,11 +54,11 @@ class InputWithSubtitle extends StatelessWidget {
|
||||
// fontWeigth: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
TitleInput(title:labelInput),
|
||||
InputText(
|
||||
controller: controller,
|
||||
width: widthInput,
|
||||
hint: hintInput,
|
||||
label: labelInput,
|
||||
title: hintInput,
|
||||
enabled: enabled,
|
||||
textInputType: textInputType,
|
||||
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
|
||||
version: "1.0.0"
|
||||
sdks:
|
||||
dart: ">=2.18.6 <3.0.0"
|
||||
dart: ">=2.18.0 <3.0.0"
|
||||
flutter: ">=3.3.0"
|
||||
|
||||
@@ -5,7 +5,7 @@ publish_to: 'none'
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: '>=2.18.6 <3.0.0'
|
||||
sdk: '>=2.17.6 <3.0.0'
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
||||