ajustes nas telas configurações
This commit is contained in:
115
lib/screens/configurations/about_screen.dart
Normal file
115
lib/screens/configurations/about_screen.dart
Normal file
@@ -0,0 +1,115 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:rkm/config/color_palette.dart';
|
||||
import 'package:rkm/config/const_variable.dart';
|
||||
import 'package:rkm/widgets/button_default.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||
|
||||
class AboutScreen extends StatefulWidget {
|
||||
|
||||
@override
|
||||
State<AboutScreen> createState() => _AboutScreenState();
|
||||
}
|
||||
|
||||
class _AboutScreenState extends State<AboutScreen> {
|
||||
@override
|
||||
|
||||
|
||||
String version = '';
|
||||
String mode ='';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
dataSQLite();
|
||||
}
|
||||
|
||||
dataSQLite()async{
|
||||
final PrefService _preferences = PrefService();
|
||||
_preferences.readCacheModel('user', 'password', 'city', 'mode').then((list){
|
||||
setState(() {
|
||||
mode = list[3];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getVersion()async{
|
||||
await PackageInfo.fromPlatform().then((value){
|
||||
setState(() {
|
||||
version =value.version;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
|
||||
getVersion();
|
||||
|
||||
return Scaffold(
|
||||
bottomSheet: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
color: ColorPalette.appBar,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text: 'www.rkmsistemas.com.br',color: ColorPalette.white,),
|
||||
Spacer(),
|
||||
ButtonDefault(
|
||||
onPressed:()=> Navigator.pop(context),
|
||||
title: 'Voltar',
|
||||
borderColor: ColorPalette.appBar,
|
||||
textColor: ColorPalette.white,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: ColorPalette.grayBackground,
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fitHeight,
|
||||
image: AssetImage('assets/images/load_image.png'),
|
||||
)
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 70),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset('assets/images/logo.PNG',width: width*0.5,),
|
||||
mode == 'homologacao'?Image.asset('assets/images/homologacao.png',width: width*0.4):Container(),
|
||||
mode == 'desenvolvimento'?Image.asset('assets/images/desenvolvimento.png',width: width*0.4):Container(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: TextDefault(
|
||||
text: 'Versão $version',
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 30,
|
||||
fontWeigth: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 100,),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: TextDefault(
|
||||
text: 'RKM Sistemas Ltda.\n\n'
|
||||
'(19) 2532-2668\n\n'
|
||||
'(19) 2532-2669',
|
||||
maxLines: 5,
|
||||
textAlign: TextAlign.center,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 20,
|
||||
fontWeigth: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
104
lib/screens/configurations/clear_data_screen.dart
Normal file
104
lib/screens/configurations/clear_data_screen.dart
Normal file
@@ -0,0 +1,104 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/service/db/db_sqlite_sync.dart';
|
||||
import 'package:rkm/widgets/button_default.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../service/db/db_sqlite_load.dart';
|
||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||
import '../../config/color_palette.dart';
|
||||
import '../../widgets/text_default.dart';
|
||||
|
||||
class ClearDataScreen extends StatefulWidget {
|
||||
const ClearDataScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ClearDataScreen> createState() => _ClearDataScreenState();
|
||||
}
|
||||
|
||||
class _ClearDataScreenState extends State<ClearDataScreen> {
|
||||
|
||||
String mode ='';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
dataSQLite();
|
||||
}
|
||||
|
||||
dataSQLite()async{
|
||||
final PrefService _preferences = PrefService();
|
||||
_preferences.readCacheModel('user', 'password', 'city', 'mode').then((list){
|
||||
setState(() {
|
||||
mode = list[3];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Scaffold(
|
||||
bottomSheet: Container(
|
||||
color: ColorPalette.appBar,
|
||||
child: Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
ButtonDefault(
|
||||
title: 'Voltar',
|
||||
width: width*0.2,
|
||||
textColor: ColorPalette.white,
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
onPressed: ()=>Navigator.pushNamedAndRemoveUntil(context, '/home', (Route<dynamic> route) => false),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.only(top: 100),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorPalette.grayBackground,
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fitHeight,
|
||||
image: AssetImage('assets/images/load_image.png'),
|
||||
)
|
||||
),
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset('assets/images/logo.PNG',width: width*0.5,),
|
||||
mode == 'homologacao'?Image.asset('assets/images/homologacao.png',width: width*0.4):Container(),
|
||||
mode == 'desenvolvimento'?Image.asset('assets/images/desenvolvimento.png',width: width*0.4):Container(),
|
||||
SizedBox(height: 50),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0,horizontal: 15),
|
||||
child: TextDefault(
|
||||
text: 'Todos os registros (dados Importados, Cadastros e Atendimentos) do aplicativo serão excluídos.\n\n'
|
||||
'Para utilizar novamente o aplicativo deverá ser realizada uma nova Carga inicial.',
|
||||
maxLines: 5,
|
||||
textAlign: TextAlign.center,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 15,
|
||||
fontWeigth: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
ButtonDefault(
|
||||
title: 'Limpar Dados',
|
||||
width: width*0.9,
|
||||
textColor: ColorPalette.white,
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
onPressed: ()async{
|
||||
await DbSqliteLoad().deleteLoad().then((_)async {
|
||||
await DbSqliteSync().deleteSync().then((_){
|
||||
Navigator.pushReplacementNamed(context, '/splash');
|
||||
});
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
87
lib/screens/configurations/import_sigtap_screen.dart
Normal file
87
lib/screens/configurations/import_sigtap_screen.dart
Normal file
@@ -0,0 +1,87 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../config/color_palette.dart';
|
||||
import '../../config/const_variable.dart';
|
||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||
import '../../widgets/text_default.dart';
|
||||
|
||||
class ImportSigtapScreen extends StatefulWidget {
|
||||
const ImportSigtapScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ImportSigtapScreen> createState() => _ImportSigtapScreenState();
|
||||
}
|
||||
|
||||
class _ImportSigtapScreenState extends State<ImportSigtapScreen> {
|
||||
|
||||
String mode ='';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
dataSQLite();
|
||||
}
|
||||
|
||||
dataSQLite()async{
|
||||
final PrefService _preferences = PrefService();
|
||||
_preferences.readCacheModel('user', 'password', 'city', 'mode').then((list){
|
||||
setState(() {
|
||||
mode = list[3];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
|
||||
return Scaffold(
|
||||
bottomSheet: Container(
|
||||
color: ColorPalette.appBar,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(15),
|
||||
child: TextDefault(
|
||||
text: 'Etapa 1 de 4 - Teste',
|
||||
color: ColorPalette.white,
|
||||
fontSize: 20,
|
||||
fontWeigth: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.only(top: 100),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorPalette.grayBackground,
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fitHeight,
|
||||
image: AssetImage('assets/images/load_image.png'),
|
||||
)
|
||||
),
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset('assets/images/logo.PNG',width: width*0.5,),
|
||||
mode == 'homologacao'?Image.asset('assets/images/homologacao.png',width: width*0.4):Container(),
|
||||
mode == 'desenvolvimento'?Image.asset('assets/images/desenvolvimento.png',width: width*0.4):Container(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 50.0),
|
||||
child: Image.asset('assets/images/loading.gif',width: width*0.2,height: height*0.1,),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0,horizontal: 5),
|
||||
child: TextDefault(
|
||||
text: 'Aguarde enquanto a Importação SIGTAP é realizada.\n\n'
|
||||
'Esse processo pode levar vários minutos dependendo da sua conexão!',
|
||||
maxLines: 5,
|
||||
textAlign: TextAlign.center,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 18,
|
||||
fontWeigth: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
207
lib/screens/configurations/main_procedures_screen.dart
Normal file
207
lib/screens/configurations/main_procedures_screen.dart
Normal file
@@ -0,0 +1,207 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/config/color_palette.dart';
|
||||
import 'package:rkm/config/const_variable.dart';
|
||||
import 'package:rkm/widgets/alert_dialog_default.dart';
|
||||
import 'package:rkm/widgets/appbar_default.dart';
|
||||
import 'package:rkm/widgets/button_default.dart';
|
||||
import '../../widgets/dropdown_button_default.dart';
|
||||
import '../../widgets/subtitle_containers.dart';
|
||||
import '../../widgets/text_default.dart';
|
||||
import '../../widgets/title_containers.dart';
|
||||
|
||||
class MainProceduresScreen extends StatefulWidget {
|
||||
const MainProceduresScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MainProceduresScreen> createState() => _MainProceduresScreenState();
|
||||
}
|
||||
|
||||
class _MainProceduresScreenState extends State<MainProceduresScreen> {
|
||||
|
||||
String? selectService;
|
||||
String? selectProcedure;
|
||||
String? selectCBO;
|
||||
bool disableButton = true;
|
||||
var controllerProceduresSearch = TextEditingController();
|
||||
var controllerCBOSearch = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBarDefault().appbar(context, 'RKM AB - Procedimentos Iniciais'),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: ConstVariable().backgroundGradient,
|
||||
child: ListView(
|
||||
children: [
|
||||
Card(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TitleContainers(title: 'Adicionar Procedimento Inicial',),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SubtitleContainers(title: 'Atendimento',width: width*0.5),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: DropDownButtonDefault(
|
||||
widthContainer: width*0.35,
|
||||
title: '',
|
||||
width: width*0.4,
|
||||
list: ConstVariable().itensProceduresStart,
|
||||
select: selectService,
|
||||
onChanged: (value){
|
||||
setState(() {
|
||||
selectService = value!;
|
||||
if(selectProcedure!= null && selectCBO!= null && selectService!=null){
|
||||
disableButton = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(color: ColorPalette.black54,endIndent: 10,indent: 10,height: 1),
|
||||
GestureDetector(
|
||||
onTap: ()=>AlertDialogDefault().alert_with_search(
|
||||
context,
|
||||
controllerProceduresSearch,
|
||||
ListView.separated(
|
||||
separatorBuilder:(context,index)=> Divider(color: ColorPalette.black54,height: 5,),
|
||||
itemCount: ConstVariable().itensProcedures.length,
|
||||
itemBuilder: (context,index){
|
||||
return Container(
|
||||
width: width*0.8,
|
||||
color: ColorPalette.white,
|
||||
child: ListTile(
|
||||
onTap: (){
|
||||
setState(() {
|
||||
selectProcedure = ConstVariable().itensProcedures[index];
|
||||
Navigator.pop(context);
|
||||
if(selectProcedure!= null && selectCBO!= null && selectService!=null){
|
||||
disableButton = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
title: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: ConstVariable().itensProcedures[index],
|
||||
fontSize: 16,
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
child: selectProcedure!=null?
|
||||
Container(
|
||||
width: width,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SubtitleContainers(title: 'Procedimento',width: width*0.3,),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 5),
|
||||
width: width*0.65,
|
||||
child: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: selectProcedure!,
|
||||
fontSize: 15,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
):
|
||||
SubtitleContainers(title: 'Procedimento')
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: ()=>AlertDialogDefault().alert_with_search(
|
||||
context,
|
||||
controllerCBOSearch,
|
||||
ListView.separated(
|
||||
separatorBuilder:(context,index)=> Divider(color: ColorPalette.black54,height: 5,),
|
||||
itemCount: ConstVariable().itensCBO.length,
|
||||
itemBuilder: (context,index){
|
||||
return Container(
|
||||
width: width*0.8,
|
||||
color: ColorPalette.white,
|
||||
child: ListTile(
|
||||
onTap: (){
|
||||
setState(() {
|
||||
selectCBO = ConstVariable().itensCBO[index];
|
||||
Navigator.pop(context);
|
||||
if(selectProcedure!= null && selectCBO!= null && selectService!=null){
|
||||
disableButton = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
title: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: ConstVariable().itensCBO[index],
|
||||
fontSize: 16,
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
child: selectCBO!=null?
|
||||
Container(
|
||||
width: width,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SubtitleContainers(title: 'CBO',width: width*0.3,),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 5),
|
||||
width: width*0.65,
|
||||
child: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: selectCBO!,
|
||||
fontSize: 15,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
):
|
||||
SubtitleContainers(title: 'CBO')
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: ButtonDefault(
|
||||
title: 'Adicionar',
|
||||
borderColor: disableButton?ColorPalette.buttonDisable:ColorPalette.appBar,
|
||||
background: ColorPalette.appBar,
|
||||
disableColor: ColorPalette.buttonDisable,
|
||||
textColor: ColorPalette.white,
|
||||
onPressed: disableButton?null:()=>Navigator.pushReplacementNamed(context, '/home'),
|
||||
width: double.infinity,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0,horizontal: 2),
|
||||
child: Card(
|
||||
child: TitleContainers(
|
||||
title: 'Procedimentos',
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
93
lib/screens/configurations/sinc_data_screen.dart
Normal file
93
lib/screens/configurations/sinc_data_screen.dart
Normal file
@@ -0,0 +1,93 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/config/const_variable.dart';
|
||||
import 'package:rkm/widgets/button_default.dart';
|
||||
|
||||
import '../../config/color_palette.dart';
|
||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||
import '../../widgets/text_default.dart';
|
||||
|
||||
class SincDataScreen extends StatefulWidget {
|
||||
const SincDataScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SincDataScreen> createState() => _SincDataScreenState();
|
||||
}
|
||||
|
||||
class _SincDataScreenState extends State<SincDataScreen> {
|
||||
|
||||
String mode ='';
|
||||
|
||||
dataSQLite()async{
|
||||
final PrefService _preferences = PrefService();
|
||||
_preferences.readCacheModel('user', 'password', 'city', 'mode').then((list){
|
||||
setState(() {
|
||||
mode = list[3];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
dataSQLite();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Scaffold(
|
||||
bottomSheet: Container(
|
||||
color: ColorPalette.appBar,
|
||||
child: Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
ButtonDefault(
|
||||
title: 'Voltar',
|
||||
width: width*0.2,
|
||||
textColor: ColorPalette.white,
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
onPressed: ()=>Navigator.pushNamedAndRemoveUntil(context, '/home', (Route<dynamic> route) => false),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.only(top: 100),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorPalette.grayBackground,
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fitHeight,
|
||||
image: AssetImage('assets/images/load_image.png'),
|
||||
)
|
||||
),
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset('assets/images/logo.PNG',width: width*0.5,),
|
||||
mode == 'homologacao'?Image.asset('assets/images/homologacao.png',width: width*0.4):Container(),
|
||||
mode == 'desenvolvimento'?Image.asset('assets/images/desenvolvimento.png',width: width*0.4):Container(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
child: TextDefault(
|
||||
text: 'A Sincronização poderá demorar. Prosseguir?',
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 22,
|
||||
fontWeigth: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
ButtonDefault(
|
||||
title: 'Enviar informações',
|
||||
width: width*0.9,
|
||||
textColor: ColorPalette.white,
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
onPressed: ()=>Navigator.pushReplacementNamed(context, '/home'),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user