Created
December 24, 2022 13:16
-
-
Save OberdanBrito/2b86b3b6382381cc1830d58496343830 to your computer and use it in GitHub Desktop.
página inicial do aplicativo qui:casa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'sidebar.dart'; | |
import 'theme.dart'; | |
import 'package:unit/docs/docs_list.dart'; | |
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | |
import 'package:carousel_slider/carousel_slider.dart'; | |
class HomePage extends StatefulWidget { | |
const HomePage({Key? key}) : super(key: key); | |
@override | |
HomePageState createState() => HomePageState(); | |
} | |
class HomePageState extends State<HomePage> { | |
final List<String> imgList = [ | |
'1.png', | |
'2.png', | |
'3.png', | |
'4.png', | |
'5.png', | |
'6.png', | |
'7.png', | |
'8.png', | |
'9.png', | |
'10.png', | |
'11.png', | |
'12.png', | |
'13.png', | |
'14.png', | |
'15.png', | |
'16.png', | |
'17.png', | |
'18.png', | |
'19.png', | |
'20.png', | |
'21.png', | |
'22.png', | |
'23.png', | |
'24.png', | |
'25.png', | |
'26.png', | |
'27.png', | |
]; | |
@override | |
void initState() { | |
super.initState(); | |
} | |
Widget _news( | |
{required Color primaryColor, | |
required Color secondaryColor, | |
required Column text, | |
required Widget image}) { | |
return Container( | |
alignment: Alignment.bottomRight, | |
margin: const EdgeInsets.all(20), | |
padding: const EdgeInsets.all(10), | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(20), | |
gradient: LinearGradient( | |
begin: Alignment.topLeft, | |
end: const Alignment(0.8, 1), | |
colors: [primaryColor, secondaryColor]), | |
boxShadow: [ | |
BoxShadow( | |
color: primaryColor.withOpacity(0.5), | |
spreadRadius: 5, | |
blurRadius: 7, | |
offset: const Offset(0, 3)) | |
]), | |
width: 300.0, | |
child: Row( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: <Widget>[Expanded(flex: 4, child: text), Expanded(flex: 6, child: image)], | |
)); | |
} | |
Widget _contactPhoto(String photo) { | |
Widget contactphoto = const Icon(FontAwesomeIcons.user, size: 24, color: Colors.grey); | |
if (photo != "") { | |
contactphoto = Container( | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(20), | |
image: DecorationImage( | |
image: ExactAssetImage(photo), | |
fit: BoxFit.cover, | |
), | |
)); | |
} | |
return Padding(padding: const EdgeInsets.all(10), child: CircleAvatar( | |
radius: 40, | |
backgroundColor: Colors.grey[300], | |
child: Center( | |
child: contactphoto, | |
), | |
)); | |
} | |
Widget _contactName(String name, String occupation) { | |
return Expanded( | |
child: Column( | |
children: [ | |
Text(name.split(' ')[0], | |
style: const TextStyle(color: Colors.black, fontWeight: FontWeight.bold), | |
softWrap: true, | |
maxLines: 2, | |
overflow: TextOverflow.ellipsis), | |
Text(occupation, | |
style: const TextStyle(color: Colors.black54), | |
softWrap: true, | |
maxLines: 2, | |
overflow: TextOverflow.ellipsis, | |
textAlign: TextAlign.center, | |
), | |
], | |
)); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
backgroundColor: Colors.white, | |
title: SizedBox(width: 128, child: QuicasaTheme.logoHome), | |
centerTitle: false, | |
actions: [ | |
Builder( | |
builder: (BuildContext context) { | |
return IconButton( | |
onPressed: () { | |
Scaffold.of(context).openEndDrawer(); | |
}, | |
icon: const Icon(Icons.home_outlined, color: Colors.grey), | |
tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip, | |
); | |
}, | |
), | |
], | |
), | |
endDrawer: const NavBar(), | |
body: CustomScrollView( | |
slivers: <Widget>[ | |
SliverToBoxAdapter( | |
child: Container( | |
margin: const EdgeInsets.symmetric(vertical: 20.0), | |
height: 300.0, | |
child: ListView( | |
scrollDirection: Axis.horizontal, | |
children: <Widget>[ | |
_news( | |
primaryColor: Colors.orange, | |
secondaryColor: Colors.red, | |
text: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const [ | |
Text('08', | |
style: TextStyle(color: Colors.white, fontSize: 20), | |
textAlign: TextAlign.left), | |
Padding( | |
padding: EdgeInsets.only(bottom: 20), | |
child: Text('JUN', | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 25, | |
fontWeight: FontWeight.bold), | |
textAlign: TextAlign.left)), | |
Text('Onde você', style: TextStyle(color: Colors.white, fontSize: 20)), | |
Text('pode nos', style: TextStyle(color: Colors.white, fontSize: 20)), | |
Text('ajudar!', | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 22, | |
fontWeight: FontWeight.bold)), | |
], | |
), | |
image: Image.asset( | |
const AssetImage('asset/images/news/news002.png').assetName)), | |
_news( | |
primaryColor: Colors.blue, | |
secondaryColor: Colors.indigo, | |
text: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const [ | |
Text('12', | |
style: TextStyle(color: Colors.white, fontSize: 20), | |
textAlign: TextAlign.left), | |
Padding( | |
padding: EdgeInsets.only(bottom: 20), | |
child: Text('SET', | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 25, | |
fontWeight: FontWeight.bold), | |
textAlign: TextAlign.left)), | |
Text('Dia da ', style: TextStyle(color: Colors.white, fontSize: 22)), | |
Text('vacinação', style: TextStyle(color: Colors.white, fontSize: 22)), | |
], | |
), | |
image: Align( | |
alignment: Alignment.bottomRight, | |
child: Image.asset( | |
const AssetImage('asset/images/news/news003.png').assetName))), | |
_news( | |
primaryColor: Colors.red, | |
secondaryColor: Colors.orange, | |
text: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const [ | |
Text('03', | |
style: TextStyle(color: Colors.white, fontSize: 20), | |
textAlign: TextAlign.left), | |
Padding( | |
padding: EdgeInsets.only(bottom: 20), | |
child: Text('DEZ', | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 25, | |
fontWeight: FontWeight.bold), | |
textAlign: TextAlign.left)), | |
Text('Mês da', style: TextStyle(color: Colors.white, fontSize: 20)), | |
Text('Renegociação', | |
style: TextStyle(color: Colors.white, fontSize: 17)), | |
], | |
), | |
image: Align( | |
alignment: Alignment.bottomRight, | |
child: Image.asset( | |
const AssetImage('asset/images/news/news004.png').assetName))), | |
// _news(Colors.yellow, Colors.lightGreen), | |
// _news(Colors.orange, Colors.deepPurple), | |
], | |
), | |
), | |
), | |
SliverToBoxAdapter( | |
child: Padding( | |
padding: const EdgeInsets.all(20.0), | |
child: Column( | |
children: [ | |
Container( | |
alignment: Alignment.topLeft, | |
child: QuicasaTheme.widgets | |
.titlePage(leftText: 'Vamos ', centerText: 'começar?')), | |
Container( | |
alignment: Alignment.topLeft, | |
padding: const EdgeInsets.only(top: 5.0, bottom: 14.0), | |
child: Text( | |
'Tês passos muito importante no seu condomínio', | |
style: TextStyle(color: QuicasaTheme.client.black), | |
), | |
), | |
Padding( | |
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0), | |
child: GestureDetector( | |
onTap: () { | |
Navigator.of(context).push(MaterialPageRoute( | |
builder: (_) => DocsListPage( | |
theme: QuicasaTheme.client, | |
) | |
)); | |
}, | |
child: ClipRRect( | |
borderRadius: BorderRadius.circular(10), | |
child: Container( | |
height: 70, | |
color: Colors.white, | |
child: Row( | |
children: <Widget>[ | |
Container( | |
color: Colors.pinkAccent, | |
width: 70, | |
height: 70, | |
child: const Align( | |
alignment: Alignment.center, | |
child: Text('1', style: TextStyle(color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), textAlign: TextAlign.center), | |
), | |
), | |
const SizedBox(width: 10), | |
Expanded( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const <Widget>[ | |
Text('Documentos da sua unidade'), | |
Text('Prepare e envie os documentos necessários para o condomínio', style: TextStyle(color: Colors.grey)) | |
], | |
), | |
), | |
Icon(Icons.arrow_forward_ios, color: QuicasaTheme.client.primary), | |
], | |
), | |
), | |
), | |
) | |
), | |
Padding( | |
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0), | |
child: ClipRRect( | |
borderRadius: BorderRadius.circular(10), | |
child: GestureDetector( | |
onTap: () { | |
}, | |
child: Container( | |
height: 70, | |
color: Colors.white, | |
child: Row( | |
children: <Widget>[ | |
Container( | |
color: Colors.pinkAccent, | |
width: 70, | |
height: 70, | |
child: const Align( | |
alignment: Alignment.center, | |
child: Text('2', style: TextStyle(color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), textAlign: TextAlign.center), | |
), | |
), | |
const SizedBox(width: 10), | |
Expanded( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const <Widget>[ | |
Text('Cadastro da sua unidade'), | |
Text('Informe as pessoas, veículos e seus pets', style: TextStyle(color: Colors.grey)) | |
], | |
), | |
), | |
Icon(Icons.arrow_forward_ios, color: QuicasaTheme.client.primary), | |
], | |
), | |
), | |
) | |
), | |
), | |
Padding( | |
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0), | |
child: ClipRRect( | |
borderRadius: BorderRadius.circular(10), | |
child: GestureDetector( | |
onTap: () { | |
}, | |
child: Container( | |
height: 70, | |
color: Colors.white, | |
child: Row( | |
children: <Widget>[ | |
Container( | |
color: Colors.pinkAccent, | |
width: 70, | |
height: 70, | |
child: const Align( | |
alignment: Alignment.center, | |
child: Text('3', style: TextStyle(color: Colors.white, fontSize: 35, fontWeight: FontWeight.bold), textAlign: TextAlign.center), | |
), | |
), | |
const SizedBox(width: 10), | |
Expanded( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const <Widget>[ | |
Text('Política de privacidade'), | |
Text('Leia e confirme a política do nosso condomínio', style: TextStyle(color: Colors.grey)) | |
], | |
), | |
), | |
Icon(Icons.arrow_forward_ios, color: QuicasaTheme.client.primary), | |
], | |
), | |
), | |
) | |
), | |
), | |
Container( | |
padding: const EdgeInsets.only(top: 30.0), | |
alignment: Alignment.topLeft, | |
child: QuicasaTheme.widgets | |
.titlePage(leftText: 'Lar doce ', centerText: 'Lar!') | |
), | |
Container( | |
alignment: Alignment.topLeft, | |
padding: const EdgeInsets.only(top: 5.0, bottom: 14.0), | |
child: Text( | |
'Conheça as pessoas que te ajudam diariamente para que as coisas sempre estejam bem!', | |
style: TextStyle(color: QuicasaTheme.client.black), | |
), | |
), | |
Container( | |
margin: const EdgeInsets.symmetric(vertical: 10.0), | |
height: 180.0, | |
child: ListView( | |
scrollDirection: Axis.horizontal, | |
children: <Widget>[ | |
Column( | |
children: [ | |
_contactPhoto('asset/images/components/nilvea.png'), | |
_contactName('Nílvea', 'Síndica'), | |
] | |
), | |
Column( | |
children: [ | |
_contactPhoto('asset/images/components/leonardo.png'), | |
_contactName('Leonardo', 'Gerência\noperacional'), | |
] | |
), | |
Column( | |
children: [ | |
_contactPhoto('asset/images/components/will.png'), | |
_contactName('Will', 'Gerência\nmanutenção'), | |
] | |
), | |
Column( | |
children: [ | |
_contactPhoto('asset/images/components/igor.png'), | |
_contactName('Igor', 'Auxiliar\nadministrativo'), | |
] | |
), | |
Column( | |
children: [ | |
_contactPhoto(''), | |
_contactName('Francisco', 'Supervisor\nmanutenção'), | |
] | |
), | |
Column( | |
children: [ | |
_contactPhoto(''), | |
_contactName('Maria', 'Auxiliar\natendimento'), | |
] | |
), | |
], | |
), | |
), | |
Container( | |
alignment: Alignment.topLeft, | |
child: QuicasaTheme.widgets | |
.titlePage(leftText: 'Nosso ', centerText: 'esforço')), | |
Container( | |
alignment: Alignment.topLeft, | |
padding: const EdgeInsets.only(top: 5.0, bottom: 14.0), | |
child: Text( | |
'Nossa equipe não para! olha o que fizemos nesse último mês', | |
style: TextStyle(color: QuicasaTheme.client.black), | |
), | |
), | |
CarouselSlider( | |
options: CarouselOptions( | |
aspectRatio: 2.0, | |
enlargeCenterPage: true, | |
scrollDirection: Axis.horizontal, | |
autoPlay: true, | |
), | |
items: imgList | |
.map((item) => Center( | |
child: Image.asset('asset/images/manager/$item', fit: BoxFit.cover, width: 1000,))) | |
.toList(), | |
), | |
], | |
), | |
), | |
) | |
], | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment