Skip to content

Commit

Permalink
Merge pull request #5 from ErnestoMoraes/dev
Browse files Browse the repository at this point in the history
Resolvendo Ci, teste de Cd.
  • Loading branch information
ErnestoMoraes committed Mar 14, 2023
2 parents 6a3f802 + 0caa2fe commit 04f6392
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 19 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- run: flutter --version
- run: flutter pub get
- run: flutter analyze
- run: flutter format --dry-run --set-exit-if-changed lib/
- run: flutter format --dry-run --set-exit-if-changed test/
- run: dart format .
- run: flutter test --coverage
- run: flutter test --machine > test-results.json
- uses: actions/upload-artifact@v3 # upload test results
Expand Down Expand Up @@ -50,9 +49,9 @@ jobs:
channel: "stable"
- run: flutter pub get
- run: flutter clean
- run: flutter build appbundle
- name: Upload appbundle
- run: flutter build apk
- name: Upload apk
uses: actions/upload-artifact@v3
with:
name: appbundle
path: build/app/outputs/bundle/release/app-release.aab
path: build/app/outputs/bundle/release/app-release.apk
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:
- run: flutter --version
- run: flutter pub get
- run: flutter analyze
- run: flutter format --dry-run --set-exit-if-changed lib/
- run: flutter format --dry-run --set-exit-if-changed test/
- run: dart format .
- run: flutter test --coverage
- run: flutter test --machine > test-results.json
- uses: actions/upload-artifact@v3 # upload test results
Expand Down
2 changes: 0 additions & 2 deletions lib/app/pages/home/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ffi';

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';
Expand Down
4 changes: 3 additions & 1 deletion lib/app/pages/login/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ class _LoginPageState extends State<LoginPage> {
child: MyInputButton(
height: context.percentHeight(.15),
label: 'Acessar',
onPressed: () {},
onPressed: () {
Navigator.of(context).pushNamed('/home');
},
),
),
],
Expand Down
4 changes: 1 addition & 3 deletions lib/app/pages/schedule/schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import 'package:academico_mobile/app/core/ui/helpers/size_extensions.dart';
import 'package:academico_mobile/app/core/ui/widgets/my_card.dart';
import 'package:academico_mobile/app/pages/schedule/widgets/line_days.dart';
import 'package:flutter/material.dart';

import '../../core/ui/styles/colors_app.dart';
import '../../core/ui/styles/text_styles.dart';

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

@override
Widget build(BuildContext context) {
bool isNow = true;
// bool isNow = true;
List<String> days = [
'Dom',
'Seg',
Expand Down
2 changes: 1 addition & 1 deletion lib/app/pages/schedule/widgets/line_days.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LineDays extends StatelessWidget {
),
),
onPressed: nameDay == 'Dom' || nameDay == 'Sab' ? null : () {
print('Clicou no dia $nameDay');
// print('Clicou no dia $nameDay');
},
child: SizedBox(
height: context.percentHeight(.2),
Expand Down
4 changes: 1 addition & 3 deletions lib/app/repositories/schedule/schedule_repository.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first

import 'package:academico_mobile/app/models/schedule_model.dart';
// import 'package:academico_mobile/app/models/schedule_model.dart';

abstract class ScheduleRepository {
Future<void> findSchedule();
}


3 changes: 1 addition & 2 deletions lib/app/repositories/schedule/schedule_repository_impl.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:academico_mobile/app/core/config/env/env.dart';
import 'package:academico_mobile/app/core/exceptions/repository_exceptions.dart';

import 'package:academico_mobile/app/core/rest_client/custom_webview.dart';

import './schedule_repository.dart';
Expand Down
113 changes: 113 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,116 @@ Future<void> main() async {
await Env.instance.load();
runApp(const AcademicoMobile());
}


//! Código para testes!!!! Apenas para testes!!!!

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

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});

// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.

// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".

final String title;

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}

@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
30 changes: 30 additions & 0 deletions test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:academico_mobile/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);

// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}

0 comments on commit 04f6392

Please sign in to comment.