scan button and padding bottom scan button

This commit is contained in:
='fauz 2025-04-17 10:11:39 +07:00
parent 21c03f72d6
commit 1a2cf014b6
6 changed files with 36 additions and 14 deletions

View File

@ -49,7 +49,7 @@ class CardList extends StatelessWidget {
), ),
const Spacer(), const Spacer(),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: EdgeInsets.all(0.08),
child: const Row( child: const Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@ -7,19 +7,28 @@ class ScanButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
// Skala berdasarkan lebar layar
final buttonSize = screenWidth * 0.20; // Adjust as needed
final iconSize = buttonSize * 0.7;
final padding = buttonSize * 0.15;
return Container( return Container(
width: 76, width: buttonSize,
height: 76, height: buttonSize,
// width: 76,
// height: 76,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: const Color.fromARGB(223, 67, 63, 179), color: const Color.fromARGB(223, 67, 63, 179),
), ),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(padding),
child: IconButton( child: IconButton(
icon: SvgPicture.asset( icon: SvgPicture.asset(
'assets/icons/Scan.svg', 'assets/icons/Scan.svg',
width: 60, width: iconSize,
height: 60, height: iconSize,
colorFilter: ColorFilter.mode( colorFilter: ColorFilter.mode(
Color.fromARGB(255, 217, 219, 227), Color.fromARGB(255, 217, 219, 227),
BlendMode.srcIn, BlendMode.srcIn,

View File

@ -21,6 +21,9 @@ class _HomeScreenState extends State<HomeScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.of(context).size;
final screenWidth = MediaQuery.of(context).size.width;
final buttonScanSize = screenWidth * 0.20;
final double bottomPadding = (9000 / screenWidth).clamp(0, 0.2);
return Scaffold( return Scaffold(
// appBar: AppBar( // appBar: AppBar(
// elevation: 0, // elevation: 0,
@ -237,9 +240,10 @@ class _HomeScreenState extends State<HomeScreen> {
], ],
), ),
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()), Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
Positioned( Positioned(
bottom: 8, bottom: bottomPadding * 32,
left: MediaQuery.of(context).size.width / 2 - 38, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -20),
child: ScanButton(), child: ScanButton(),

View File

@ -36,6 +36,9 @@ class _KoleksiScreenState extends State<KoleksiScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
final buttonScanSize = screenWidth * 0.20;
final double bottomPadding = (9000 / screenWidth).clamp(0, 0.2);
return Scaffold( return Scaffold(
extendBody: true, extendBody: true,
body: Stack( body: Stack(
@ -150,8 +153,8 @@ class _KoleksiScreenState extends State<KoleksiScreen> {
), ),
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()), Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
Positioned( Positioned(
bottom: 8, bottom: bottomPadding * 32,
left: MediaQuery.of(context).size.width / 2 - 38, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -20),
child: ScanButton(), child: ScanButton(),

View File

@ -57,6 +57,9 @@ class _PustakaScreenState extends State<PustakaScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
final buttonScanSize = screenWidth * 0.20;
final double bottomPadding = (9000 / screenWidth).clamp(0, 0.2);
List<Map<String, dynamic>> filteredCollections = List<Map<String, dynamic>> filteredCollections =
_collections _collections
.where( .where(
@ -290,8 +293,8 @@ class _PustakaScreenState extends State<PustakaScreen> {
], ],
), ),
Positioned( Positioned(
bottom: 8, bottom: bottomPadding * 32,
left: MediaQuery.of(context).size.width / 2 - 38, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -20),
child: ScanButton(), child: ScanButton(),

View File

@ -54,6 +54,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
final buttonScanSize = screenWidth * 0.20;
final double bottomPadding = (9000 / screenWidth).clamp(0, 0.2);
return Scaffold( return Scaffold(
backgroundColor: const Color.fromARGB(255, 255, 255, 255), backgroundColor: const Color.fromARGB(255, 255, 255, 255),
body: Stack( body: Stack(
@ -341,8 +344,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
), ),
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()), Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
Positioned( Positioned(
bottom: 8, bottom: bottomPadding * 32,
left: MediaQuery.of(context).size.width / 2 - 38, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -20),
child: ScanButton(), child: ScanButton(),