예시코드
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
floatingActionButton: FloatingActionButton(
child: Text('버튼'),
onPressed: (){
},
),
appBar: AppBar(),
body: ListView.builder(
itemCount: 3,
itemBuilder: (c, i){
print(i);
return ListTile(
leading: Icon(Icons.star),
title: Text(i.toString()),
);
}
),
bottomNavigationBar: Bottom(),
),
);
}
}
class Bottom extends StatelessWidget {
const Bottom({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BottomAppBar(
child: SizedBox(
height: 50,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.home_outlined),
Icon(Icons.home_outlined),
Icon(Icons.home_outlined),
],
),
),
);
}
}
결과
1. ListView.builder : 스크롤바 생성 확인
