Skip to content

Commit

Permalink
Merge pull request #17 from ErnestoMoraes/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ErnestoMoraes committed May 20, 2023
2 parents 245ba19 + 81ab7e3 commit 6ea6743
Show file tree
Hide file tree
Showing 37 changed files with 581 additions and 138 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# academico_mobile
# Acadêmico Mobile


Link do Figma: https://www.figma.com/file/tFLY9uOoiAXYoHrqj7uHiI/Untitled?node-id=0%3A1&t=LloEngcQkWGb6Bna-1

Atividade 01:
- [ ] Instalar Assets (Imagens e Fonts)
- [ ] ThemeData
- [ ] Estilos diferentes de Fonts
- [ ] Preparando Extensions de UI
- [ ] Dotenv
- [ ] RestClient - Dio

- [ ] senha: cddbdabqeujfjluo
- [ ] lembrar do delay na requisição de 2s.

=======
Binary file added assets/images/background/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/images_cards/documentation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/images_cards/education.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/images_cards/student.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/readme/229shots_so.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/readme/243shots_so.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/readme/903shots_so.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/readme/942shots_so.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/readme/944shots_so.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions lib/academico_mobile.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import 'package:academico_mobile/app/core/provider/application_binding.dart';
import 'package:academico_mobile/app/core/ui/theme/theme_config.dart';
import 'package:academico_mobile/app/pages/about/about_page.dart';
import 'package:academico_mobile/app/pages/daily/daily_router.dart';
import 'package:academico_mobile/app/pages/home/home_router.dart';
import 'package:academico_mobile/app/pages/login/login_router.dart';
import 'package:academico_mobile/app/pages/recover_password/recover_password_page.dart';
import 'package:academico_mobile/app/pages/request_documents/request_documents_page.dart';
import 'package:academico_mobile/app/pages/schedule/schedule_router.dart';
import 'package:academico_mobile/app/pages/school_records/school_records_page.dart';
import 'package:academico_mobile/app/pages/splash/splash_page.dart';
import 'package:flutter/material.dart';

Expand All @@ -25,6 +28,9 @@ class AcademicoMobile extends StatelessWidget {
'/daily': (context) => DailyRouter.page,
'/home': (context) => HomeRouter.page,
'/recover-password': (context) => const RecoverPasswordPage(),
'/school_records': (context) => const SchoolRecordsPage(),
'/request_documents': (context) => const RequestDocumentsPage(),
'/about': (context) => const AboutPage(),
},
),
);
Expand Down
4 changes: 0 additions & 4 deletions lib/app/core/rest_client/custom_dio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,4 @@ class CustomDio extends DioForNative {
CustomDio auth() {
return this;
}

CustomDio unauth() {
return this;
}
}
18 changes: 0 additions & 18 deletions lib/app/core/rest_client/custom_webview.dart

This file was deleted.

3 changes: 3 additions & 0 deletions lib/app/core/ui/styles/colors_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class ColorsApp {
Color get primary => const Color(0xFF0D47A1);
Color get secondary => const Color(0xFFFFC107);

Color get manha => const Color(0xFF3C6E71);
Color get tarde => const Color(0xFF2F3061);

Color get switchbackground => const Color(0xFF282827);

Color get labelblack1 => const Color(0xFF1E1E1E);
Expand Down
14 changes: 10 additions & 4 deletions lib/app/core/ui/widgets/my_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ class MyAppbar extends AppBar {
required final VoidCallback onPressed,
}) : super(
elevation: elevation,
title: Text(
title,
style: TextStyles.instance.labelPage
),
title: Text(title, style: TextStyles.instance.labelPage),
centerTitle: true,
backgroundColor: ColorsApp.instance.background,
leading: IconButton(
Expand All @@ -56,12 +53,21 @@ class MyAppbar extends AppBar {
required String title,
String subtitle = '',
IconData icon = Icons.arrow_back_ios,
required final VoidCallback onPressed,
}) : super(
elevation: elevation,
title: Text(title, style: TextStyles.instance.labelPage),
centerTitle: true,
backgroundColor: ColorsApp.instance.background,
automaticallyImplyLeading: false,
leading: IconButton(
icon: const Icon(
Icons.menu_rounded,
color: Colors.white,
size: 35,
),
onPressed: onPressed,
),
actions: [
BlocConsumer<HomeController, HomeState>(
listener: (context, state) {},
Expand Down
98 changes: 98 additions & 0 deletions lib/app/pages/about/about_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import 'package:academico_mobile/app/core/ui/helpers/size_extensions.dart';
import 'package:academico_mobile/app/core/ui/styles/colors_app.dart';
import 'package:academico_mobile/app/core/ui/styles/text_styles.dart';
import 'package:academico_mobile/app/pages/about/widgets/tile_about.dart';
import 'package:flutter/material.dart';

class AboutPage extends StatelessWidget {
const AboutPage({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFF1C1C1C),
appBar: AppBar(
backgroundColor: const Color(0xFF1C1C1C),
elevation: 0,
title: Text(
'Sobre',
style: context.textStyles.texLabelH1.copyWith(
color: context.colorsApp.cardwhite,
fontSize: context.percentHeight(.03),
),
),
centerTitle: true,
),
body: Column(
children: [
Container(
color: const Color(0xFF1C1C1C),
width: double.infinity,
child: Column(
children: [
Image.asset(
'assets/images/logos/logo_academico.png',
height: context.percentHeight(.2),
),
Text(
'Acadêmico Mobile',
style: context.textStyles.texLabelH1.copyWith(
color: context.colorsApp.cardwhite,
fontSize: context.percentHeight(.03),
),
),
Text('Versão 1.0.0',
style: context.textStyles.texLabelH4.copyWith(
color: context.colorsApp.cardwhite,
)),
],
),
),
SizedBox(height: context.percentHeight(.05)),
Expanded(
child: SingleChildScrollView(
padding:
EdgeInsets.symmetric(horizontal: context.percentWidth(.08)),
child: Column(
children: const [
TileAbout(
text:
'Descrição do aplicativo: Forneça uma breve descrição do aplicativo, explicando sua finalidade e recursos principais.',
),
TileAbout(
text:
'Desenvolvedores ou equipe: Liste os nomes ou informações sobre a equipe de desenvolvimento do aplicativo.',
),
TileAbout(
text:
'Informações de contato: Se desejar, forneça informações de contato, como um endereço de e-mail ou site, para que os usuários possam entrar em contato com a equipe de suporte ou fornecer feedback.',
),
TileAbout(
text:
'Licenças e créditos: Se o seu aplicativo usar bibliotecas de terceiros ou recursos de código aberto, mencione as licenças relevantes e dê crédito aos autores originais.',
),
TileAbout(
text:
'Outras informações: Dependendo do aplicativo, você pode incluir outras informações relevantes, como links para perfis de mídia social, link para avaliação do aplicativo na loja, etc.',
),
],
),
),
),
Container(
padding: EdgeInsets.all(context.percentHeight(.03)),
alignment: Alignment.center,
child: Text(
'Obrigado',
style: TextStyle(
color: context.colorsApp.cardwhite,
fontSize: context.percentHeight(.02),
fontWeight: FontWeight.bold,
),
),
),
],
),
);
}
}
31 changes: 31 additions & 0 deletions lib/app/pages/about/widgets/tile_about.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:academico_mobile/app/core/ui/helpers/size_extensions.dart';
import 'package:academico_mobile/app/core/ui/styles/colors_app.dart';
import 'package:academico_mobile/app/core/ui/styles/text_styles.dart';
import 'package:flutter/material.dart';

class TileAbout extends StatefulWidget {
final String text;

const TileAbout({Key? key, required this.text}) : super(key: key);

@override
State<TileAbout> createState() => _TileAboutState();
}

class _TileAboutState extends State<TileAbout> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Text(
widget.text,
textAlign: TextAlign.justify,
style: context.textStyles.texLabelH4.copyWith(
color: context.colorsApp.cardwhite,
),
),
SizedBox(height: context.percentHeight(.03)),
],
);
}
}
6 changes: 2 additions & 4 deletions lib/app/pages/daily/daily_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ class DailyController extends Cubit<DailyState> {
void changeIsNow() async {
emit(state.copyWith(status: DailyStateSatus.loading));
await Future.delayed(
const Duration(seconds: 2),
const Duration(milliseconds: 700),
);
emit(
state.copyWith(
status: DailyStateSatus.loaded,
isNow: !state.isNow,

),
);
}

Future<void> selectedDay(int index) async {
emit(state.copyWith(status: DailyStateSatus.loading));
await Future.delayed(const Duration(seconds: 1));
await Future.delayed(const Duration(milliseconds: 700));
emit(state.copyWith(status: DailyStateSatus.loaded, selected: index));
}

}
14 changes: 7 additions & 7 deletions lib/app/pages/daily/daily_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ class _DailyPageState extends BaseState<DailyPage, DailyController> {
@override
void onReady() async {
await controller.loadSemestre();
if (controller.state.isNow) {
list = controller.state.semestres[0].disciplinas;
}
list = controller.state.semestres[0].disciplinas;
}

@override
Expand Down Expand Up @@ -125,10 +123,12 @@ class _DailyPageState extends BaseState<DailyPage, DailyController> {
loaded: () => true,
),
builder: (context, state) {
if (state.isNow) {
list = state.semestres[0].disciplinas;
} else {
list = state.semestres[state.selected].disciplinas;
if (state.isNow && state.semestres.isNotEmpty) {
list = controller.state.semestres[0].disciplinas;
}
if (!state.isNow && state.semestres.isNotEmpty) {
list =
controller.state.semestres[state.selected].disciplinas;
}
return Expanded(
child: ListView.builder(
Expand Down
5 changes: 4 additions & 1 deletion lib/app/pages/daily/widgets/lista_card_disciplina.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class ListaCardDisciplina extends StatelessWidget {
return InkWell(
splashColor: ColorsApp.instance.background,
onTap: () {
if (disciplina.avaliacoes.isEmpty) {
disciplina.avaliacoes.addAll(['99', '99', '99', '99', '99']);
}
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DashboardPage(
Expand Down Expand Up @@ -47,7 +50,7 @@ class ListaCardDisciplina extends StatelessWidget {
Container(
padding: EdgeInsets.all(context.screenHeight * 0.005),
decoration: BoxDecoration(
color: ColorsApp.instance.cardblue,
color: ColorsApp.instance.primary,
borderRadius: BorderRadius.circular(5),
),
child: Text(
Expand Down
11 changes: 0 additions & 11 deletions lib/app/pages/dashbord_daily/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@ class _DashboardPageState extends State<DashboardPage> {
label: 'Carga Horária Total',
value: '${widget.disciplina.resumo.cargaHoraria}H',
),
// Row(
// children: [
// Text(
// 'Existem 6 aulas planejadas a mais que as necessárias.',
// style: TextStyles.instance.texLabelH5.copyWith(
// color: ColorsApp.instance.cardgrey,
// fontWeight: TextStyles.instance.textSemiBold.fontWeight,
// ),
// ),
// ],
// ),
CardHorario(
label: 'Você ainda pode ter',
value: '${widget.disciplina.resumo.faltas} falta(s)',
Expand Down
28 changes: 21 additions & 7 deletions lib/app/pages/dashbord_daily/widgets/line_notas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,27 @@ class LineNotas extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
child: Text(
value,
style: TextStyles.instance.texLabelH4.copyWith(
color: ColorsApp.instance.cardwhite,
fontWeight: TextStyles.instance.textSemiBold.fontWeight,
),
),
child: value == '99'
? Container(
decoration: BoxDecoration(
color: ColorsApp.instance.cardnoselected,
borderRadius: BorderRadius.circular(5),
),
child: Text(
'N/A',
style: TextStyles.instance.texLabelH4.copyWith(
color: ColorsApp.instance.cardwhite,
fontWeight:
TextStyles.instance.textSemiBold.fontWeight,
),
))
: Text(
value,
style: TextStyles.instance.texLabelH4.copyWith(
color: ColorsApp.instance.cardwhite,
fontWeight: TextStyles.instance.textSemiBold.fontWeight,
),
),
),
],
),
Expand Down
13 changes: 13 additions & 0 deletions lib/app/pages/home/home_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,17 @@ class HomeController extends Cubit<HomeState> {
}
}

Future<void> logout() async {
emit(state.copyWith(status: HomeStateStatus.loading));
try {
await Future.delayed(const Duration(seconds: 2));
emit(state.copyWith(status: HomeStateStatus.loaded));
} catch (e, s) {
log('Error ao realizar logout', error: e, stackTrace: s);
emit(state.copyWith(
status: HomeStateStatus.error,
isOn: true,
errorMessage: 'Error ao realizar logout'));
}
}
}
Loading

0 comments on commit 6ea6743

Please sign in to comment.