aboutsummaryrefslogtreecommitdiffstats
path: root/lib/presentation/screens/apps/widgets/app_button.dart
blob: a8907867aa6f1c12dce3256c1bb6da5c43bd5893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import 'package:flutter_ics_homescreen/core/utils/helpers.dart';
import 'package:flutter_ics_homescreen/export.dart';

class AppButton extends StatefulWidget {
  const AppButton(
      {super.key,
      required this.image,
      required this.title,
      required this.onPressed});
  final String image;
  final String title;
  final VoidCallback onPressed;

  @override
  State<AppButton> createState() => _AppButtonState();
}

class _AppButtonState extends State<AppButton> {
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.sizeOf(context);
    return Container(
      width: 250,
      height: 250,
      margin: const EdgeInsets.all(8),
      decoration: BoxDecoration(
          boxShadow: [Helpers.boxDropShadowRegular],
          border: Border.all(color: AGLDemoColors.neonBlueColor),
          color: AGLDemoColors.buttonFillEnabledColor,
          borderRadius: BorderRadius.circular(4)),
      child: Material(
        color: Colors.transparent,
        child: InkWell(
          borderRadius: BorderRadius.circular(4),
          onTap: widget.onPressed,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Padding(
                padding: const EdgeInsets.only(
                    left: 10, right: 10, top: 6, bottom: 6),
                child: SvgPicture.asset(
                  "assets/${widget.image}",
                ),
              ),
              Text(
                widget.title,
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontSize: 40,
                  shadows: [Helpers.dropShadowRegular],
                  color: AGLDemoColors.periwinkleColor,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}