Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
907f184
test
kwkwon Jan 8, 2021
14b2f08
added reset button in the page.
kwkwon Jan 8, 2021
4c0c796
클릭시 2씩 증가
kwkwon Jan 9, 2021
f3d56f6
버튼 누르면 2개씩 증가할 수 있도록 수정 이슈 해결!!
JAECHON-YU Jan 9, 2021
4544b89
-버튼 추가 / 2씩 감소 기능 추가
jimingoal Jan 10, 2021
67829ce
원본작업 특정브렌치
JAECHON-YU Jan 10, 2021
11392f8
앱바 타이틀을 'PlayGround'로 변경
kwkwon Jan 10, 2021
ecb0f90
[added] 카운터 2 감소하도록 하는 마이너스 버튼 추가
wonpyoJang Jan 10, 2021
d50a8ae
[test] 2씩 감소하는 마이너스 버튼 추가 커밋에 대한 테스트
wonpyoJang Jan 10, 2021
1787542
[fixed] 앱바 타이틀 수정
wonpyoJang Jan 10, 2021
ca34bd3
[test] 앱바의 텍스트가 PlayGround인지 확인하는 테스트 추가
wonpyoJang Jan 10, 2021
6531841
Merge pull request #4 from kwkwon/$kwkwon/feature/increase-two-on-cli…
deviankim Jan 11, 2021
f0037ab
Merge branch 'master' into JAECHON-YU/feature/increase-two-on-click-p…
deviankim Jan 11, 2021
41fa208
Merge pull request #5 from playground-code-review/JAECHON-YU/feature/…
deviankim Jan 11, 2021
05248bf
Merge branch 'master' into feature/decrease-number-by-2
deviankim Jan 11, 2021
2cc276d
Merge pull request #11 from jimingoal/feature/decrease-number-by-2
deviankim Jan 11, 2021
100f23e
Merge pull request #14 from kwkwon/$kwkwon/feature/appbar_title
deviankim Jan 11, 2021
e81ff32
Merge branch 'master' into feature/increase-counter-by-2
deviankim Jan 11, 2021
10b0d96
Merge pull request #19 from wonpyoJang/feature/increase-counter-by-2
deviankim Jan 11, 2021
9618d12
Merge branch 'master' into feature/decrease-by-2-button
deviankim Jan 11, 2021
4f6032f
Merge pull request #20 from wonpyoJang/feature/decrease-by-2-button
deviankim Jan 11, 2021
28410bd
Merge pull request #21 from wonpyoJang/feature/appbar-text
deviankim Jan 11, 2021
c47d207
[fixed] counter의 범위를 0 ~ 10사이의 정수로 제한한다.
wonpyoJang Jan 11, 2021
801a720
[added] github actions (CI/CD) 추가
wonpyoJang Jan 12, 2021
aaf15af
[added] github actions 추가
wonpyoJang Jan 12, 2021
d8c612d
Revert "[fixed] counter의 범위를 0 ~ 10사이의 정수로 제한한다."
wonpyoJang Jan 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/flutter-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Flutter CI

# This workflow is triggered on pushes uu the repository.

on:
push:
pull_request:
branches:
- master

# on: push # Default will running for every branch.

jobs:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:

# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'

# Setup the flutter environment.
- uses: subosito/flutter-action@v1
with:
channel: 'beta' # 'dev', 'alpha', default to: 'stable'
# flutter-version: '1.12.x' # you can also specify exact version of flutter

# Get flutter dependencies.
- run: flutter pub get

# Check for any formatting issues in the code.
- run: flutter format --set-exit-if-changed .

# Statically analyze the Dart code for any errors.
- run: flutter analyze .

# Run widget tests for our flutter project.
- run: flutter test

# Build apk.
- run: flutter build apk

# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@v1
with:
name: release-apk
path: build/app/outputs/apk/release/app-release.apk
15 changes: 1 addition & 14 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,15 @@ void main() {
}

class MyApp extends StatelessWidget {
// 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,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
home: MyHomePage(title: 'PlayGround'),
);
}
}
87 changes: 44 additions & 43 deletions lib/my_home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);

// 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
Expand All @@ -23,47 +14,30 @@ class _MyHomePageState extends State<MyHomePage> {

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 += 2;
});
}

void _decrementCounter() {
setState(() {
_counter -= 2;
});
}

void _resetCounter() {
setState(() {
_counter = 0;
});
}

@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>[
Text(
Expand All @@ -73,14 +47,41 @@ class _MyHomePageState extends State<MyHomePage> {
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
SizedBox(
height: 20,
),
RaisedButton(
onPressed: _resetCounter,
child: Text(
'RESET'
),
)
],
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
floatingActionButton: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
FloatingActionButton(
backgroundColor: Colors.blue,
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
),
SizedBox(
height: 10.0,
),
FloatingActionButton(
backgroundColor: Colors.red,
onPressed: _decrementCounter,
tooltip: 'Decrement',
child: Icon(Icons.remove),
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
11 changes: 11 additions & 0 deletions test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,16 @@ void main() {
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('2'), findsOneWidget);

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

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

// AppBar 제목 확인
expect(find.text('PlayGround'), findsOneWidget);
});
}