feita a exibição dos dados dos cidadãos e a pesquisa
This commit is contained in:
@@ -18,37 +18,48 @@ class SplashScreen extends StatefulWidget {
|
||||
|
||||
class _SplashScreenState extends State<SplashScreen> {
|
||||
|
||||
CityLoadModel? model;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
DbSqliteLoad().intialDB();
|
||||
timer();
|
||||
final PrefService _prefService = PrefService();
|
||||
_prefService.readCacheModel('user', 'password', 'city', 'mode').then((list){
|
||||
for(int i=0;ConstVariable().itensCity.length > i;i++){
|
||||
if(ConstVariable().itensCity[i].nameCityFront == list[2]!){
|
||||
model = ConstVariable().itensCity[i];
|
||||
}
|
||||
}
|
||||
timer(list);
|
||||
});
|
||||
}
|
||||
|
||||
timer()async{
|
||||
timer(List list)async{
|
||||
await DbSqliteLoad().intialDB().then((db)async{
|
||||
List dataControl = await db.query('MUNICIPIOS');
|
||||
List dataCitizen = await db.query('CIDADAOS');
|
||||
if(dataControl.length != 0){
|
||||
var query = "SELECT * FROM CONTROLE_INTERNO";
|
||||
dataControl = await db.rawQuery(query);
|
||||
print(dataCitizen);
|
||||
// print(dataCitizen);
|
||||
if(dataCitizen.length != 0){
|
||||
Navigator.push(
|
||||
String? url;
|
||||
if(list[3]=='desenvolvimento'){
|
||||
url = UrlApiConst.ApiUrlDesenvolvimento;
|
||||
}else if(list[3]=='online'){
|
||||
url = UrlApiConst.ApiUrlOnline;
|
||||
}else if(list[3]=='homologacao'){
|
||||
url = UrlApiConst.ApiUrlHomologacao;
|
||||
}
|
||||
ArgsLoadInitModel args = ArgsLoadInitModel(mode: list[3], model: model!, user: list[0], password: list[1], urlAPI: url!);
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => LoginSavedScreen(listControl: dataControl)),
|
||||
MaterialPageRoute(builder: (context) => LoginSavedScreen(listControl: dataControl,args: args,)),
|
||||
);
|
||||
}else{
|
||||
CityLoadModel? model;
|
||||
String? url;
|
||||
final PrefService _prefService = PrefService();
|
||||
_prefService.readCacheModel('user', 'password', 'city', 'mode').then((list){
|
||||
print('list $list');
|
||||
for(int i=0;ConstVariable().itensCity.length > i;i++){
|
||||
if(ConstVariable().itensCity[i].nameCityFront == list[2]!){
|
||||
model = ConstVariable().itensCity[i];
|
||||
}
|
||||
}
|
||||
if(list[3]=='desenvolvimento'){
|
||||
url = UrlApiConst.ApiUrlDesenvolvimento;
|
||||
}else if(list[3]=='online'){
|
||||
@@ -63,7 +74,6 @@ class _SplashScreenState extends State<SplashScreen> {
|
||||
MaterialPageRoute(builder: (context) => SyncLoginScreen(args: args)),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}else{
|
||||
Navigator.pushReplacementNamed(context, '/login_load');
|
||||
|
||||
Reference in New Issue
Block a user