criado widgets dropdown_with_subtitle.dart, input_with_subtitle.dart, onbackbutton.dart, switch_with_subtitle.dart
criada as telas main_register_citizen_screen.dart e main_procedures_screen.dart
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:intl/intl.dart';
|
||||
import 'package:rkm/utils/const_variable.dart';
|
||||
import 'package:rkm/widgets/appbar_default.dart';
|
||||
import 'package:rkm/widgets/input_text.dart';
|
||||
import 'package:rkm/widgets/onbackbutton.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import '../utils/color_palette.dart';
|
||||
import '../widgets/button_default.dart';
|
||||
@@ -44,34 +45,7 @@ class _EditProceduresScreenState extends State<EditProceduresScreen> {
|
||||
String formattedDate = DateFormat('dd/MM/yyyy').format(data);
|
||||
return formattedDate;
|
||||
}
|
||||
onBackButton(BuildContext context)async {
|
||||
bool exiApp = await showDialog(
|
||||
context: context,
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: TextDefault(text: 'Aviso',color: ColorPalette.black54,textAlign: TextAlign.center,),
|
||||
content: TextDefault(text: 'Deseja sair e descartar as alterações?',color: ColorPalette.black54,),
|
||||
actions: [
|
||||
ButtonDefault(
|
||||
onPressed: ()=>Navigator.pushNamedAndRemoveUntil(context, '/home', (route) => false),
|
||||
title: 'Sim',
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
textColor: ColorPalette.white,
|
||||
),
|
||||
ButtonDefault(
|
||||
onPressed: ()=>Navigator.of(context).pop(false),
|
||||
title: 'Não',
|
||||
background: ColorPalette.white,
|
||||
borderColor: ColorPalette.white,
|
||||
textColor: ColorPalette.black54,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -79,7 +53,7 @@ class _EditProceduresScreenState extends State<EditProceduresScreen> {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: ()=> onBackButton(context),
|
||||
onWillPop: ()=> OnBackButton().onBackButton(context),
|
||||
child: Scaffold(
|
||||
appBar: AppBarDefault().appbar(context, 'RKM AB - Procedimentos Consolidados'),
|
||||
body: Container(
|
||||
@@ -316,7 +290,7 @@ class _EditProceduresScreenState extends State<EditProceduresScreen> {
|
||||
width: width,
|
||||
),
|
||||
ButtonDefault(
|
||||
onPressed: (){},
|
||||
onPressed: ()=>Navigator.pop(context),
|
||||
title: 'Cancelar',
|
||||
background: ColorPalette.blackButton,
|
||||
borderColor: ColorPalette.blackButton,
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/utils/const_variable.dart';
|
||||
import 'package:rkm/widgets/icon_button_default.dart';
|
||||
import 'package:rkm/widgets/input_search_text.dart';
|
||||
import 'package:rkm/widgets/input_text.dart';
|
||||
|
||||
import '../widgets/appbar_default.dart';
|
||||
import '../widgets/item_citizen.dart';
|
||||
import 'main_register_citizen_screen.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
const HomeScreen({Key? key}) : super(key: key);
|
||||
@@ -42,7 +40,10 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
),
|
||||
IconButtonDefault(
|
||||
icon: Icons.person_add,
|
||||
onPressed: (){}
|
||||
onPressed: ()=> Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => MainRegisterCitizenScreen(screens: 1,)),
|
||||
)
|
||||
),
|
||||
IconButtonDefault(
|
||||
icon: Icons.article,
|
||||
|
||||
@@ -69,7 +69,7 @@ class _MainProceduresScreenState extends State<MainProceduresScreen> {
|
||||
),
|
||||
Divider(color: ColorPalette.black54,endIndent: 10,indent: 10,height: 1),
|
||||
GestureDetector(
|
||||
onTap: ()=>AlertDialogDefault().alert(
|
||||
onTap: ()=>AlertDialogDefault().alert_with_search(
|
||||
context,
|
||||
controllerProceduresSearch,
|
||||
ListView.separated(
|
||||
@@ -123,7 +123,7 @@ class _MainProceduresScreenState extends State<MainProceduresScreen> {
|
||||
SubtitleContainers(title: 'Procedimento')
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: ()=>AlertDialogDefault().alert(
|
||||
onTap: ()=>AlertDialogDefault().alert_with_search(
|
||||
context,
|
||||
controllerCBOSearch,
|
||||
ListView.separated(
|
||||
|
||||
85
lib/screens/main_register_citizen_screen.dart
Normal file
85
lib/screens/main_register_citizen_screen.dart
Normal file
@@ -0,0 +1,85 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/screens/register_citizen_screen.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import '../widgets/alert_dialog_settings.dart';
|
||||
import '../widgets/icon_button_default.dart';
|
||||
|
||||
class MainRegisterCitizenScreen extends StatefulWidget {
|
||||
int screens;
|
||||
MainRegisterCitizenScreen({
|
||||
required this.screens
|
||||
});
|
||||
|
||||
@override
|
||||
State<MainRegisterCitizenScreen> createState() => _MainRegisterCitizenScreenState();
|
||||
}
|
||||
|
||||
class _MainRegisterCitizenScreenState extends State<MainRegisterCitizenScreen> {
|
||||
|
||||
int index = 1;
|
||||
|
||||
TabBar get _tabBar => TabBar(
|
||||
labelColor: index==1?ColorPalette.gray:ColorPalette.blackButton,
|
||||
unselectedLabelColor: ColorPalette.gray,
|
||||
indicatorColor: ColorPalette.white,
|
||||
tabs: [
|
||||
Tab(text: 'Cadastro Cidadão',icon: Icon(Icons.person),iconMargin: EdgeInsets.zero,height: 50,),
|
||||
Tab(text: 'Cadastro Individual',icon: Icon(Icons.article),iconMargin: EdgeInsets.zero,height: 40,),
|
||||
Tab(text: 'Cadastro Domiciliar',icon: Icon(Icons.home),iconMargin: EdgeInsets.zero,height: 40,)
|
||||
],
|
||||
);
|
||||
|
||||
updateIndex(){
|
||||
setState(() {
|
||||
index = widget.screens;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
updateIndex();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) =>DefaultTabController(
|
||||
length: 1,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: TextDefault(text: 'RKM AB - Cadastro Cidadão',color: ColorPalette.white,),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButtonDefault(
|
||||
icon: Icons.settings,
|
||||
color: ColorPalette.white,
|
||||
onPressed: ()=>AlertDialogSettings().alert(context)
|
||||
),
|
||||
IconButtonDefault(
|
||||
icon: Icons.logout,
|
||||
color: ColorPalette.white,
|
||||
onPressed: ()=>Navigator.pushNamedAndRemoveUntil(context, '/login',(Route<dynamic> route) => false)),
|
||||
],
|
||||
bottom: PreferredSize(
|
||||
preferredSize: _tabBar.preferredSize,
|
||||
child: Material(
|
||||
color: ColorPalette.white, //<-- SEE HERE
|
||||
child: _tabBar,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:index==1 ?
|
||||
TabBarView(
|
||||
children: [
|
||||
RegisterCitizenScreen(),
|
||||
],
|
||||
):TabBarView(
|
||||
children: [
|
||||
RegisterCitizenScreen(),
|
||||
Center(child: Text('2'),),
|
||||
Center(child: Text('3'),),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user