| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:location/resource/colors.gen.dart';
- Widget buildMainFunctionView(ImageProvider icon, String name,
- {VoidCallback? onTap}) {
- return GestureDetector(
- onTap: onTap,
- child: Container(
- width: 42.w,
- height: 42.w,
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10.w),
- boxShadow: [
- BoxShadow(
- color: ColorName.black5.withOpacity(0.06),
- blurRadius: 10,
- spreadRadius: 6,
- offset: const Offset(0, 0),
- ),
- ],
- ),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Image(image: icon, width: 24.w, height: 24.w),
- if (name.isNotEmpty)
- Text(name,
- style: TextStyle(
- fontSize: 9.sp,
- color: ColorName.black90,
- fontWeight: FontWeight.bold))
- ],
- ),
- ),
- );
- }
|