728x90
플러터 버튼을 2개 이상 표시하는 방법이다.
floatingActionButton: Stack(
children: [
Align(
alignment: Alignment(
Alignment.bottomRight.x, Alignment.bottomRight.y - 0.4),
child: FloatingActionButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const FileUploadScreen(),
));
},
tooltip: 'back',
heroTag: UniqueKey(),
child: const Icon(Icons.arrow_back),
),
),
Align(
alignment: Alignment(
Alignment.bottomRight.x, Alignment.bottomRight.y - 0.2),
child: FloatingActionButton(
onPressed: () async {
getImage(ImageSource.camera);
},
tooltip: 'image',
heroTag: UniqueKey(),
child: const Icon(Icons.camera_alt),
),
),
Align(
alignment: Alignment.bottomRight,
child: FloatingActionButton(
onPressed: () async {
getImage(ImageSource.gallery);
},
tooltip: 'image',
heroTag: UniqueKey(),
child: const Icon(Icons.image),
),
),
],
),
|
728x90
'Flutter 앱 > Flutter Basic' 카테고리의 다른 글
Flutter addPostFrameCallback method (0) | 2024.01.18 |
---|---|
Flutter 기본 추가 라이브러리 (0) | 2024.01.12 |
Flutter TIP 모음 (0) | 2024.01.04 |
Flutter JSON Serializable의 중요성 (2) | 2023.12.21 |
Flutter Person freezed 자동완성 예제 (0) | 2023.12.09 |