Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Zooming the separated buttons together

when I add a textbutton next to the button in my application, it separates by itself. Like in the photo. How can I zoom plugins?………………………………………………………………………………………………………………………………………….

enter image description here

 LikeAnimation(
isAnimating:
           (snap.data()! as dynamic)['likes']
           .contains(FirebaseAuth.instance.currentUser!.uid),
                                                  smallLike: true,
                                                  child: IconButton(
                                                    onPressed: () async {
                                                      await FirestoreMethods().LikePost(
                                                        (snap.data()!
                                                            as dynamic)['postId'],
                                                        FirebaseAuth
                                                            .instance.currentUser!.uid,
                                                        (snap.data()!
                                                            as dynamic)['likes'],
                                                      );
                                                    },
                                                    icon: (snap.data()!
                                                                as dynamic)['likes']
                                                            .contains(FirebaseAuth
                                                                .instance
                                                                .currentUser!
                                                                .uid)
                                                        ? const Icon(
                                                            Icons.favorite,
                                                            color: Colors.red,
                                                          )
                                                        : const Icon(
                                                            Icons.favorite_border,
                                                          ),
                                                  ),
                                                ),
                                                Container(
                                                  child: DefaultTextStyle(
                                                    style: Theme.of(context)
                                                        .textTheme
                                                        .subtitle2!
                                                        .copyWith(
                                                          fontWeight: FontWeight.w800,
                                                        ),
                                                    child: TextButton(
                                                      onPressed: () =>
                                                          Navigator.of(context)
                                                              .push(MaterialPageRoute(
                                                        builder: (context) =>
                                                            LikeScreen(
                                                          snap: (snapshot.data!
                                                                  as dynamic)
                                                              .docs[index],
                                                        ),
                                                      )),
                                                      child: Text(
                                                        '${(snap.data()! as dynamic)['likes'].length}',
                                                        style: Theme.of(context)
                                                            .textTheme
                                                            .bodyText2,
                                                      ),
                                                    ),

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use InkWell instead of textbutton, like this:

Row(
          children: [
            IconButton(
              icon: Icon(Icons.favorite),
              padding: EdgeInsets.zero,
              onPressed: () {},
            ),
            InkWell(
              onTap: () {},
              child: Padding(
              padding: const EdgeInsets.all(8.0),
                child: Text('1'),
              ),
            ),
          ],
        )

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading