Skip to content

Commit

Permalink
Version 0.0.4: Fixed onTap feature
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathakurxd committed Jul 26, 2021
1 parent dce1259 commit a713af7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/fancy_containers.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:fancy_containers/src/utils/fancy_containers_typedef.dart';
import 'package:flutter/material.dart';

class FancyContainer extends StatefulWidget {
Expand All @@ -23,8 +24,7 @@ class FancyContainer extends StatefulWidget {
final Color? textcolor;
final String subtitle;
final Color? subtitlecolor;
// ignore: prefer_typing_uninitialized_variables
final Function? onTap;
final FancyContainersCallback? onTap;
final EdgeInsetsGeometry? padding;

@override
Expand All @@ -35,7 +35,7 @@ class _FancyContainerState extends State<FancyContainer> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: (){widget.onTap;},
onTap: widget.onTap!() ?? (){},
child: Container(
width: widget.width??MediaQuery.of(context).size.width * 0.90,
height: widget.height,
Expand Down
1 change: 1 addition & 0 deletions lib/src/utils/fancy_containers_typedef.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typedef FancyContainersCallback = Function();

0 comments on commit a713af7

Please sign in to comment.