Skip to content

Commit

Permalink
Design Improves Update
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusrmatias committed Oct 31, 2023
1 parent 2ce65ed commit ba6831e
Show file tree
Hide file tree
Showing 17 changed files with 147 additions and 64 deletions.
39 changes: 25 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ 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))
}
// Active in release
//def keystoreProperties = new Properties()
//def keystorePropertiesFile = rootProject.file('key.properties')
//if (keystorePropertiesFile.exists()) {
// keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
//}

android {
namespace "br.dev.matheusrmatias.sigalogin"
Expand Down Expand Up @@ -59,18 +60,28 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
//Active in Release
// signingConfigs {
// release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
// storePassword keystoreProperties['storePassword']
// }
// }
// buildTypes {
// release {
// signingConfig signingConfigs.release
// }
// }

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
//Deactive in Release
buildTypes {
release {
signingConfig signingConfigs.release
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now,
// so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void main() async{
ChangeNotifierProvider<StudentRepository>(create: (context)=>StudentRepository(student,historic,assessment,schedule)),
ChangeNotifierProvider<StudentCardRepository>(create: (context)=>StudentCardRepository(card))
],
child: MyApp(page: HomePage()),
child: MyApp(page: HomePage(afterLogin: true)),
)
);
}
Expand Down
11 changes: 11 additions & 0 deletions lib/src/controllers/assessment_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ mixin AssessmentController on SqliteController{
assessmentList.add(disciplineAssessment);
});
});

assessmentList.sort((a, b){
if(a.name.contains('Estágio') || a.name.contains('Trabalho de Graduação')){
return 1;
}else if(b.name.contains('Estágio') || b.name.contains('Trabalho de Graduação')){
return -1;
}else{
return a.name.compareTo(b.name);
}
});

return assessmentList;
}

Expand Down
9 changes: 9 additions & 0 deletions lib/src/controllers/historic_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ mixin HistoricController on SqliteController{
}
});

historic.sort((a, b) {
int periodComparison = a.period.compareTo(b.period);
if (periodComparison != 0) {
return periodComparison;
} else {
return a.name.compareTo(b.name);
}
});

return historic;
}

Expand Down
19 changes: 14 additions & 5 deletions lib/src/pages/about_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:animated_emoji/animated_emoji.dart';
import 'package:animated_emoji/emojis.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
Expand All @@ -16,6 +18,7 @@ class AboutPage extends StatefulWidget {
}

class _AboutPageState extends State<AboutPage> {
int _counter = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -31,12 +34,16 @@ class _AboutPageState extends State<AboutPage> {
children: [
const SizedBox(height: 8),
Container(
alignment: Alignment.center,
width: double.maxFinite,
decoration: BoxDecoration(
color: MainTheme.orange,
borderRadius: const BorderRadius.all(Radius.circular(16))
),
child: Image.asset('assets/images/icon.png', width: 100, height: 100,),
child: Stack(
alignment: Alignment.topRight,
children: [ClipRRect(borderRadius: const BorderRadius.all(Radius.circular(16)), child: Image.asset('assets/images/icon.png', width: 100, height: 100)),const AnimatedEmoji(AnimatedEmojis.graduationCap, size: 36,errorWidget: SizedBox())],
),
),
const SizedBox(height: 8),
LinkButton(func: ()async{
Expand All @@ -45,18 +52,20 @@ class _AboutPageState extends State<AboutPage> {
}catch (e){
Fluttertoast.showToast(msg: 'Não é possível abrir o link');
}
}, text: 'Projeto no GitHub'),
}, text: 'Projeto no GitHub',icon: EvaIcons.github,),
LinkButton(func: ()async{
try{
await launchUrlString("mailto:contato@matheusrmatias.dev.br", mode: LaunchMode.externalApplication);
}catch (e){
Fluttertoast.showToast(msg: 'Não é possível abrir o link');
}
}, text: 'Enviar E-mail'),
}, text: 'Enviar E-mail', icon: Icons.email),
const SizedBox(height: 8),
Row(
children: [
Expanded(child: TextInfo(title: 'Desenvolvido por:', text: 'matheusrmatias.dev.br', titleColor: MainTheme.orange,onTap: ()async=>await launchUrlString('https://matheusrmatias.dev.br', mode: LaunchMode.externalApplication)))
Expanded(child: TextInfo(title: 'Desenvolvido por:', text: 'Matheus 🐀 Matias', titleColor: MainTheme.orange,onTap: ()async{

}))
],
),
const SizedBox(height: 8),
Expand All @@ -67,7 +76,7 @@ class _AboutPageState extends State<AboutPage> {
IconButton(onPressed: ()async=>await launchUrlString('https://www.instagram.com/matheusrmatias/', mode: LaunchMode.externalApplication), icon: const Icon(UniconsLine.instagram)),
IconButton(onPressed: ()async=>await launchUrlString('https://www.linkedin.com/in/matheusrmatias/', mode: LaunchMode.externalApplication), icon: const Icon(UniconsLine.linkedin))
],
)
),
],
),
),
Expand Down
40 changes: 26 additions & 14 deletions lib/src/pages/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:contained_tab_bar_view/contained_tab_bar_view.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:intl/intl.dart';
Expand All @@ -19,64 +18,77 @@ import 'package:sigalogin/src/repositories/student_repository.dart';
import 'package:sigalogin/src/services/student_account.dart';
import 'login_page.dart';

class HomePage extends StatefulWidget {
class HomePage extends StatefulWidget{
bool afterLogin;
HomePage({Key? key, this.afterLogin=false}) : super(key: key);

@override
State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
int page = 1;
late PageController pc;
class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
StudentController control = StudentController();
late Student student;
late SettingRepository prefs;
bool inUpdateStudentData = false;
late TabController _tabController;
int page=0;

@override
void initState() {
// TODO: implement initState
super.initState();
if(!widget.afterLogin)_updateStudentDate(init: true);
pc = PageController(initialPage: page);
_tabController = TabController(length: 3, initialIndex: 0,vsync: this,animationDuration: const Duration(milliseconds: 300))..addListener(() {
setState(() {
page=_tabController.index;
});
});
if (!widget.afterLogin) _updateStudentDate(init: true);
}

@override
void dispose() {
// TODO: implement dispose
super.dispose();
_tabController.dispose();
}

@override
Widget build(BuildContext context) {
student = Provider.of<StudentRepository>(context).student;
prefs = Provider.of<SettingRepository>(context);
return DefaultTabController(length: 3,child:Scaffold(
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
toolbarHeight: 100,
title: _header(),
bottom: TabBar(
controller: _tabController,
labelStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.normal),
unselectedLabelColor: Theme.of(context).colorScheme.onPrimary,
labelColor: MainTheme.orange,
unselectedLabelStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.normal),
labelPadding: const EdgeInsets.symmetric(vertical: 16),
indicatorColor: MainTheme.orange,
indicatorPadding: const EdgeInsets.only(bottom: 4),
tabs: const [
Text('Notas', overflow: TextOverflow.ellipsis),
Text('Histórico',overflow: TextOverflow.ellipsis),
Text('Horários',overflow: TextOverflow.ellipsis)
]),
tabs: [
page==0?const Row(mainAxisAlignment: MainAxisAlignment.center,children: [Icon(Icons.school),SizedBox(width: 4),Flexible(child: Text('Cursando', overflow: TextOverflow.ellipsis))]):const Icon(Icons.school),
page==1?const Row(mainAxisAlignment: MainAxisAlignment.center,children: [Icon(Icons.history),SizedBox(width: 4),Flexible(child: Text('Histórico', overflow: TextOverflow.ellipsis))]):const Icon(Icons.history),
page==2?const Row(mainAxisAlignment: MainAxisAlignment.center,children: [Icon(Icons.schedule),SizedBox(width: 4),Flexible(child: Text('Horários', overflow: TextOverflow.ellipsis))]):const Icon(Icons.schedule),
]),
actions: [Container(margin: const EdgeInsets.only(right: 32),child: IconButton(onPressed: ()=>Navigator.push(context, PageTransition(child: const SettingPage(), type: PageTransitionType.rightToLeft, curve: Curves.linear, duration: const Duration(milliseconds: 300))), icon: Icon(Icons.settings, color: Theme.of(context).colorScheme.onPrimary)))],
shadowColor: Colors.transparent,
),
body: TabBarView(
physics: const BouncingScrollPhysics(),
controller: _tabController,
children: [
NotesTab(onPressed: _updateStudentDate),
HistoricTab(onPressed: _updateStudentDate),
ScheduleTab(onPressed: _updateStudentDate)
],
),
));
);
}
_header(){
return Container(
Expand Down
12 changes: 6 additions & 6 deletions lib/src/pages/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ class _SettingPageState extends State<SettingPage> {
],
),
),
CopyCard(text: student.ra, ico: Icon(UniconsLine.graduation_cap,color: MainTheme.white), color: MainTheme.white, backgroundColor: MainTheme.lightBlue,animationColor: MainTheme.white,),
NavigationButton(text: 'Carteirinha de Estudante',color: MainTheme.white,backgroundColor: MainTheme.lightBlue, child: const StudentCardPage()),
CopyCard(text: student.ra, ico: Icon(Icons.school,color: MainTheme.white), color: MainTheme.white, backgroundColor: MainTheme.lightBlue,animationColor: MainTheme.white,),
NavigationButton(text: 'Carteirinha de Estudante',color: MainTheme.white,backgroundColor: MainTheme.lightBlue, icon: Icons.credit_card, child: const StudentCardPage()),
],
),
),
Divider(color: Theme.of(context).colorScheme.onPrimary),
NavigationButton(text: 'Configuração de Exibição', child: const ViewSettings()),
NavigationButton(text: 'Configuração de Segurança', child: const SecuritySettingPage()),
NavigationButton(text: 'Configuração de Exibição',icon: Icons.contrast, child: const ViewSettings()),
NavigationButton(text: 'Configuração de Segurança',icon: Icons.security, child: const SecuritySettingPage()),
Divider(color: Theme.of(context).colorScheme.onPrimary),
NavigationButton(text: 'Acessar o SIGA', child: const SigaPage()),
NavigationButton(text: 'Acessar o SIGA',icon: Icons.web, child: const SigaPage(),),
Divider(color: Theme.of(context).colorScheme.onPrimary),
NavigationButton(text: 'Sobre', child: const AboutPage()),
NavigationButton(text: 'Sobre',icon: Icons.info, child: const AboutPage(),),
const SizedBox(height: 8),
FutureBuilder<PackageInfo>(future: PackageInfo.fromPlatform(),builder: (context, snapshot) {
switch (snapshot.connectionState) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pages/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SplashPage extends StatelessWidget {
width: 175,
height: 175,
),
Padding(padding: const EdgeInsets.only(top: 196),child: CircularProgressIndicator(color: MainTheme.white))
Padding(padding: const EdgeInsets.only(top: 196),child: CircularProgressIndicator(color: MainTheme.white))
],
),
)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pages/tabs/historic_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _HistoricTabState extends State<HistoricTab> {
physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
slivers: [
SliverList.list(children: [Row(mainAxisAlignment: MainAxisAlignment.center,children: [Flexible(child: Text(setting.lastInfoUpdate))])]),
SliverAppBarSearch(onChanged: _searchHistoric),
SliverAppBarSearch(onChanged: _searchHistoric,text:'Pesquisar Disciplina'),
SliverList.builder(
itemCount: student.historic.length,
itemBuilder: (context, index)=>DisciplineHistoricCard(discipline: student.historic[index])
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pages/tabs/notes_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _NotesTabState extends State<NotesTab> {
physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
slivers: [
SliverList.list(children: [Row(mainAxisAlignment: MainAxisAlignment.center,children: [Flexible(child: Text(setting.lastInfoUpdate))])]),
SliverAppBarSearch(onChanged: _searchAssessment),
SliverAppBarSearch(onChanged: _searchAssessment,text:'Pesquisar Disciplina'),
SliverList.builder(
itemCount: student.assessment.length,
itemBuilder: (context, index)=> DisciplineNoteCard(discipline: student.assessment[index])
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/discipline_historic_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class DisciplineHistoricCard extends StatelessWidget {
Container(margin: const EdgeInsets.symmetric(vertical: 4),child: Row(children: [Expanded(child: Text(discipline.name!, style:TextStyle(fontSize: 14, fontWeight: FontWeight.bold,color: MainTheme.black)))])),
Row(mainAxisAlignment: MainAxisAlignment.end,crossAxisAlignment: CrossAxisAlignment.end,children: [
Expanded(child: Text(discipline.observation, style: TextStyle(color: MainTheme.black, fontSize: 12))),
CircleInfo(MainTheme.lightOrange, title: 'Frequência', text: discipline.frequency.toString(), textColor: MainTheme.black),
CircleInfo(MainTheme.orange, textColor: MainTheme.black,title: 'Média', text: discipline.avarage.toString())
CircleInfo(MainTheme.lightOrange, title: 'Frequência', text: '${discipline.frequency.toInt()}%', textColor: MainTheme.black),
CircleInfo(MainTheme.orange, textColor: MainTheme.black,title: 'Média', text: discipline.avarage.toString()[discipline.avarage.toString().length-1]=='0'?discipline.avarage.toInt().toString():discipline.avarage.toString())
]),

],
Expand Down
6 changes: 5 additions & 1 deletion lib/src/widgets/link_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import 'package:sigalogin/src/themes/main_theme.dart';
class LinkButton extends StatefulWidget {
Function()? func;
String text;
LinkButton({super.key, required this.func, required this.text});
Color? color;
IconData? icon;
LinkButton({super.key, required this.func, required this.text, this.color, this.icon});

@override
State<LinkButton> createState() => _LinkButtonState();
Expand All @@ -25,6 +27,8 @@ class _LinkButtonState extends State<LinkButton> {
),
child: Row(
children: [
widget.icon==null?const SizedBox():Icon(widget.icon,color: widget.color??MainTheme.black),
SizedBox(width: widget.icon==null?0:4),
Expanded(child: Text(
widget.text, style: TextStyle(fontSize: 14, color: MainTheme.black))),
IconButton(onPressed: null,
Expand Down
5 changes: 4 additions & 1 deletion lib/src/widgets/navigation_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class NavigationButton extends StatelessWidget {
Widget child;
Color? backgroundColor;
Color? color;
NavigationButton({super.key, required this.text, required this.child,this.backgroundColor, this.color});
IconData? icon;
NavigationButton({super.key, required this.text, required this.child,this.backgroundColor, this.color, this.icon});

@override
Widget build(BuildContext context) {
Expand All @@ -24,6 +25,8 @@ class NavigationButton extends StatelessWidget {
),
child: Row(
children: [
icon==null?const SizedBox():Icon(icon,color: color??MainTheme.black),
SizedBox(width: icon==null?0:4),
Expanded(child: Text(text ,style: TextStyle(fontSize: 14, color: color??MainTheme.black))),
IconButton(onPressed: null,icon: Icon(Icons.arrow_forward_ios, color: color?? MainTheme.black,))
],
Expand Down
Loading

0 comments on commit ba6831e

Please sign in to comment.