36 lines
932 B
Dart
36 lines
932 B
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:flutter/widgets.dart';
|
||
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
|
|
|
||
|
|
const Color borderGray = Color(0xffABABAB);
|
||
|
|
|
||
|
|
class Button extends StatelessWidget {
|
||
|
|
final String asset;
|
||
|
|
final VoidCallback onTap;
|
||
|
|
|
||
|
|
const Button(this.asset, this.onTap);
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return GestureDetector(
|
||
|
|
onTap: onTap,
|
||
|
|
child: Container(
|
||
|
|
width: 110.w,
|
||
|
|
height: 60.h,
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||
|
|
border: Border.all(color: borderGray),
|
||
|
|
borderRadius: BorderRadius.circular(16.0),
|
||
|
|
),
|
||
|
|
alignment: Alignment.center,
|
||
|
|
child: Image(
|
||
|
|
image: AssetImage(asset),
|
||
|
|
width: 29.w,
|
||
|
|
color: Theme.of(context).colorScheme.primary,
|
||
|
|
fit: BoxFit.scaleDown,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|