letsar / gap

Flutter widgets for easily adding gaps inside Flex widgets such as Columns and Rows or scrolling views
MIT License
211 stars 20 forks source link

[Feature] A constructor optimized for empty widget ? #24

Open EArminjon opened 7 months ago

EArminjon commented 7 months ago

As a developer i want to use Gap to display an empty widget.

Previously for spacing i used many SizedBox() and Gap() successfully replace them. But for empty spacing / widget, can we use Gap ? Is Gap as performance as SizedBox ? (Is Gap(0) a good practice ?)

  @override
  Widget build(BuildContext context) {
    if (enabled) return child;
    return const Gap(0); 
    // return const SizedBox(); 
  }
EArminjon commented 5 months ago

Suggestion : https://github.com/letsar/nil/blob/main/lib/src/nil.dart