Coder Social home page Coder Social logo

flutter_basic's Introduction

* 중요 공지 *

2024-02-24

  • Flutter 3.19.1, Dart 3.3.0 기준으로 빌드 에러 수정하였습니다

  • 더 이상 master 브랜치에 과거 버전의 (책과 동일한) 코드를 남기지 않아도 된다고 판단하여, 책과 동일한 버전은 legacy 브랜치에 남겨두었고, master 브랜치는 현 시점에서 빌드가 정상적으로 되는 버전의 코드를 유지하기로 하였습니다.

  • image
  • 책과 동일한 테마를 유지하기 위해 머티리얼2 테마를 유지하는 코드를 추가해 두었습니다.

  • image
  • 더 많은 예제로 공부하기 위해서는 동영상 강의를 참고해 보시기 바랍니다. https://inf.run/wE7R

  • 더 많은 Flutter 공부 로드맵 : https://www.inflearn.com/roadmaps/29

  • image

  • 개정판에서는 8장이 추가되어 예제 소스가 하나씩 밀렸습니다. 개정판의 9, 10, 11장 예제는 소스의 8, 9, 10장에 해당합니다.

  • Null Safety에 관련된 내용은 유튜브에 추가적으로 설명 영상도 올렸으니 참고하세요

Video Label

변경사항

개정판

  • 8페이지 다트 2.12.0 버전 -> 다트 2.7.0 버전

초판 ~ 2판

  • 204페이지 6.3.2 StatefulWidget 클래스 동작

집필 당시(1.12.13버전)에는 책에서 설명한 것 처럼 다음 화면을 표시할 때 이전 페이지도 다시 그려진다고 되어 있으나, 현재는 이 동작은 변경되었습니다. Stateless와 동일하게 동작하여 나중에 그리는 페이지만 그려집니다.

예제 코드 실행 방법

안드로이드 스튜디오에서 각 챕터를 Open 합니다. Chapter04는 4, 5챕터 예제를 확인할 수 있는 앱 형태로 되어 있음.

참고 페이지

오탈자

오탈자는 Github이슈 등록 또는 한빛미디어 오탈자 등록 (http://www.hanbit.co.kr/store/books/look.php?p_code=B9770627589) 으로 제보 바랍니다.

  • xx쪽 xxx -> yyy

안드로이드 네이티브 서적이 보고 싶다면?

flutter_basic's People

Contributors

junsuk5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_basic's Issues

p204 Statefull 클래스의 동작이 책에 설명되어 있는것과 다르게 동작합니다

현재 6.3.2절의 StatefullWidget 클래스의 동작을 확인하고 있습니다.

코드는 잘 동작합미다만,

책에서는 SecondStatefullPage가 생성이 될 때 뒤에 있는 FirstStatefullPage도 같이 그려진다고 되어 있는데

로그에선 SecondStatefullPage만 그려졌습니다.

어떤 부분이 잘못되었는지 잘 모르겠네요.

확인 좀 부탁드립니다.

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: FirstStatefulPage(),
);
}
}

class Person{
String name;
int age;

Person(this.name, this.age);
}

class FirstStatefulPage extends StatefulWidget {
@OverRide
_FirstStatefulPageState createState() => _FirstStatefulPageState();
}

class _FirstStatefulPageState extends State {
@OverRide
Widget build(BuildContext context) {
print('FirstPage build() - ');
return Scaffold(
appBar: AppBar(
title: Text('First'),
),
body: RaisedButton(
child: Text('Move to Next Page'),
onPressed: () {
final person = Person('Peter', 20);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SecondStatefulPage(person: person),
)
);
},
)
);
}
}

class SecondStatefulPage extends StatefulWidget {

final Person person;

SecondStatefulPage({Key key, @required this.person}) : super(key: key);

@OverRide
_SecondStatefulPageState createState() => _SecondStatefulPageState();
}

class _SecondStatefulPageState extends State {
@OverRide
Widget build(BuildContext context) {
print('Second Page build() - ');
return Scaffold(
appBar: AppBar(
title: Text('Second Page'),
),
body: RaisedButton(
child: Text('이전 페이지로'),
onPressed: () {
Navigator.pop(context);
},
)
);
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.