웹 and 앱 프로그래밍/Flutter
-
[Flutter] get and set웹 and 앱 프로그래밍/Flutter 2022. 12. 28. 21:09
Flutter에선 private로 선언 되어있어도(public선언이 없는 class) 같은 파일에만 있다면 값을 공유할수있다. 그러나 같은 파일에 없는 값에 접근할때는 get set을 사용한다. (C++같은 언어에서는 직접 함수를 만들어야하지만 Flutter에서는 간단하게 선언할수있다) int? set Get_Set_Number=> this._Get_Set_Number;//=>은 앞에 함수가 리턴할값(this._Get_Set_Number)을 의미 int? get Get_Set_Number(Value)=> this._Get_Set_Number= Value;//변수값(this._Get_Set_Number) 변경 (this란 클래스 자기자신을 의미)
-
[Flutter]Scaffold웹 and 앱 프로그래밍/Flutter 2022. 12. 24. 21:31
Scaffold 의기본 구성 EX) Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Sample Code'), ), body: Center( child: Text('You have pressed the button $_count times.'), ), bottomNavigationBar: BottomAppBar( child: Container( height: 50.0, ), ), floatingActionButton: FloatingActionButton( onPressed: () => setState(() { _count++; }), tooltip: 'Increment Counter', child: Ic..
-
[Flutter]Future Await Async웹 and 앱 프로그래밍/Flutter 2022. 12. 24. 20:42
Flutter에서 비동기 프로그램을 짜기 위해서는 비동기 함수를 표시해 주는 Async 그리고 비동기 사용 위한 Await, 지금은 없지만 미래에 (값을) 받게 해주는 Future가 존재한다. EX) Future postReply(VALUE) async { Map ask={'VALUE':VALUE}; final uri = Uri.https('example.com', 'api/fetch'/*,만약 get 사용시 파라미터지정가능{'limit': '10'}*/); final response = await http.post( uri, headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: ask , ); } 또한 이값을 나중에 받고 나중에 사..
-
[Flutter]URI함수웹 and 앱 프로그래밍/Flutter 2022. 12. 24. 15:40
함수 뜻을 자세히 모르고 구글링하며 사용하다 꽤나 애 좀 먹었다....; Uri.https('호스트&포트','경로','쿼리파라미터값(GET요청시)') return => 완성된 Uri 타입의 URL완성 Uri.parse('스트링형식의 URL') return => URL을 분리해서 Uri타입으로 반환해준다 ex) final uri = Uri.parse( 'https://dart.dev/guides/libraries/library-tour#utility-classes'); print(uri); // https://dart.dev print(uri.isScheme('https')); // true print(uri.origin); // https://dart.dev print(uri.host); // dart...