Flutter 앱/Flutter Basic
Flutter floatingActionButton 2개 이상
Link2Me
2024. 2. 15. 13:58
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),
),
),
],
),
|