Widget that gives you the size of the widget in runtime.

Overview

Tailor

MIT License

Flutter widget that calculates the size of a widget in runtime.

Usage

Just wrap your widget with Tailor and get the size in the builder. The builder will return the size whenever the size of the widget changes.

Tailor(
  builder: (_, size, child) {
    return Container(
      color: Colors.red,
      height: 100,
      width: 100,
      alignment: Alignment.center,
      child: Text(
        "Size: ${size.toString()}",
        textAlign: TextAlign.center,
        style: const TextStyle(color: Colors.white),
      ),
    );
  },
);


We can get the size of any widget using Tailor widget but what if we want to get the size of the AppBar when it's placed in the Scaffold?
Then the Tailor widget will not work and you can't wrap it around the AppBar as it's a normal Widget and AppBar is a PreferredSizeWidget.

class AppBar extends StatefulWidget implements PreferredSizeWidget {


So to tackle this problem we've TailorAppBar. Just wrap the AppBar with TailorAppBar widget when it's placed in the Scaffold and voila! You'll get the size of your AppBar.

Scaffold(
  appBar: TailorAppBar(
    builder: (_, size) {
      return AppBar(
        title: Text('AppBar width: ${size.width} height: ${size.height}'),
      );
    },
  ),
);
You might also like...

A responsive scaffold widget that adjusts to your device size, for your flutter mobile and web apps.

A responsive scaffold widget that adjusts to your device size, for your flutter mobile and web apps.

scaffold_responsive A responsive scaffold widget that adjusts to your device size, for your flutter mobile and web apps. Check out the Live demo here

Sep 27, 2022

A flutter widget that animates scrolling through a set of fixed size containers.

A flutter widget that animates scrolling through a set of fixed size containers.

Spinner This flutter package implements a simple Spinner animation that cycles through any number of fixed size child widgets. Useful for selecting a

Aug 3, 2021

ITS A SIMPLE CRYPTO APP THAT GIVES OR DISPLAYS PRICES - %CHANGE AND CHANGE VALUE OF TICKER (VARIOUS CRYPTO ASSERTS)

btcpricetracker A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Dec 28, 2021

Its a simple app which gives Weather Update, Bit Coin Value Comparator, and Flash Chat Application

Its a simple app which gives Weather Update, Bit Coin Value Comparator, and Flash Chat Application

Bundle_App_MajorProject Description : Its a simple app which is a bundle of Weather Update App, Bit Coin Value Comparator App, and Flash Chat Applicat

Sep 9, 2022

An app to pick, upload and display images from camera and gallery with size and extension constraints.

image_uploader A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Mar 7, 2022

This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc.

screen_retriever This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc. screen_retriever P

Dec 6, 2022

Package to select layout per orientation or device size like mobile vs tablet layouts or portrait vs landscape

proxy_layout Package to select layout per orientation or device size like mobile vs tablet layouts or portrait vs landscape Usage You have two widgets

Apr 18, 2021

Kc - A Simple App Solution for Calculation Fraction (Kali) size of a Lehenga. this is very useful for Fashion designers and tailors. Simple UI with best User Experience.

kc A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is yo

Jan 8, 2022

Flutter video compress - Generate a new file by compressed video, and provide metadata. Get video thumbnail from a video path, supports JPEG/GIF. To reduce app size not using FFmpeg in IOS.

Flutter video compress - Generate a new file by compressed video, and provide metadata. Get video thumbnail from a video path, supports JPEG/GIF. To reduce app size not using FFmpeg in IOS.

flutter_video_compress Generate a new path by compressed video, Choose to keep the source video or delete it by a parameter. Get video thumbnail from

Dec 8, 2022
Releases(v1.0.1)
Owner
Aman Gupta
Android and Flutter developer. Hooman. @ZestMoney
Aman Gupta
Flutter widget to change `themeMode` during runtime and persist it across restarts.

theme_mode_handler Flutter widget to change themeMode during runtime and persist it across restarts. Motivation Flutter 1.9 introduced a new way to co

Arthur Denner 28 Oct 29, 2022
Widget Runtime for WidgetStudio

flutter_dynamic_widget A Dynamic Widget Runtime from JSON for Flutter Widgets. This package powers https://widget.studio Based on code gen from this p

Rody Davis 61 Dec 6, 2022
A flutter app that gives you affirmation you daily need by saying "I am Freaking rich!"

A very basic flutter app that gives you affirmation you daily need by saying "I am Freaking rich!" ?? What’s In This Document Get Up and Running in 5

Bhavuk kalra 1 Feb 15, 2022
MindInventory 15 Sep 5, 2022
A web-safe implementation of dart.io.Platforms. Helps avoid the "Unsupported operation: Platform._operatingSystem" runtime error.

Universal Platform - A Web-safe Platform class Currently, if you include the dart.io.Platform anywhere in your code, your app will throw the following

gskinner team 86 Nov 20, 2022
A simple button that gives you the possibility to transform into a circular one and shows a progress indicator

Progress Button A simple button that gives you the possibility to transform into

Daniel B Schneider 0 Dec 22, 2021
This package gives you lock screen or pass code page

Flutter Pass Code Page or Pin Code Page Package This package gives you beautiful pass code page for using both android and ios. Demo Finger Print Usag

Yasin ilhan 61 Aug 22, 2022
A package that gives us a modern way to show animated border as a placeholder while loading our widget with easy customization and ready to use.

A package that gives us a modern way to show animated border as a placeholder while loading our widget with easy customization and ready to use.

Mohit Chauhan 8 Oct 3, 2022
Serialize almost everything you ever need! 📦 Supports serializing MaterialColor, Color, Size, Locale, IconData, UuidValue, DateTime, Directory, File, Duration, and many more.

osum_serializable The goal is to serialize almost everything you ever need! json_serializable is an amazing package to serialize classes but cannot se

Aswin Murali 2 Sep 23, 2022
A widget based on Flutter's new Interactive Viewer that makes picture pinch zoom, and return to its initial size and position when released.

pinch_zoom A widget based on Flutter's new Interactive Viewer that makes picture pinch zoom, and return to its initial size and position when released

Teun Kortekaas 36 Dec 30, 2022