Flutter / Dart basic > Flutter/Dart/Node

본문 바로가기
사이트 내 전체검색

Flutter/Dart/Node

Flutter / Dart basic

페이지 정보

작성자 sbLAB 댓글 0건 조회 2,948회 작성일 23-01-15 16:34

본문

EdgeInsets class  - https://api.flutter.dev/flutter/painting/EdgeInsets-class.html

const EdgeInsets.all(8.0) //margin on all sides

const EdgeInsets.symmetric(vertical: 8.0) //pixel margin above and below, no horizontal margins

const EdgeInsets.only(left: 40.0) //Left margin indent of 40 pixels


Effective Dart: Documentation 

https://dart.dev/guides/language/effective-dart/documentation 



{} : Map  -------  [] : List

Map<K, V> constructor 

https://api.flutter.dev/flutter/dart-core/Map/Map.html

List<E> constructor

https://api.flutter.dev/flutter/dart-core/List/List.html


[lambda]


/// Check if dark mode theme is enable
bool get isDarkMode => (theme.brightness == Brightness.dark);

[get/set/lambda]


  class Car {
    String _carNname;
    bool _isNewBrand;

    Car(this._carNname, this._isNewBrand);

    String getName()=>_carNname;
   
    String get name=>_carNname;

      set name(String carName) {
      _carNname = carName;
    }

    bool get isnewbrand=>_isNewBrand;
    bool get chknewbrand => (_isNewBrand==true);

    set isnewbrand(bool isnewbrand){
      _isNewBrand=isnewbrand;
    }

  }

  main(){
    Car car = Car('SuperCar', true);
    print('getName --> ${car.getName()}');  //getName --> SuperCar
    print(car.name); //SuperCar
    car.name = 'SmallCar';
    print(car.name); //SmallCar
    print('-----------------');
    print(car.isnewbrand);  //true
    car.isnewbrand=false;  
    print(car.isnewbrand);  //false
    print('-----------------');
    car.isnewbrand=true;
    print(car.chknewbrand); //true
    car.isnewbrand=false;
    print(car.chknewbrand); //false
  }

  //getName --> SuperCar
  //SuperCar
  //SmallCar
  //-----------------
  //true
  //false
  //-----------------
  //true
  //false
 


Dart 2.17 주요 변화 

https://jja08111.github.io/dart/dart-2-17/ 


What is initState and super.initState In Flutter? 

https://flutteragency.com/what-is-initstate-and-super-initstate-in-flutter/ 


The Stateful Widget Lifecycle 

https://betterprogramming.pub/stateful-widget-lifecycle-a01c44dc89b0 

b129ad276638cdc17d7849fedd8c612f_1675769286_5467.jpg
 

Dart Enum 

https://www.darttutorial.org/dart-tutorial/dart-enum/



댓글목록

등록된 댓글이 없습니다.

회원로그인

접속자집계

오늘
442
어제
407
최대
1,279
전체
212,212

그누보드5
Copyright © sebom.com All rights reserved.