Giter Site home page Giter Site logo

jayeshpansheriya / awesome_extensions Goto Github PK

View Code? Open in Web Editor NEW
64.0 3.0 18.0 2.43 MB

An extension to the widget that helps to reduce the boilerplate and adds some helpful methods. and you can make responsive design.

Home Page: https://pub.dev/packages/awesome_extensions

License: MIT License

Dart 73.50% Kotlin 0.10% Swift 0.34% Objective-C 0.03% HTML 3.28% CMake 6.88% C++ 14.07% C 0.61% Ruby 1.18%
extension extensions extension-methods dart-extension flutter-extensions flutter dart flutter-package awasome awesome-extensions

awesome_extensions's People

Contributors

altynbek132 avatar andyngdz avatar dickermoshe avatar erayerdin avatar felipeddev avatar geekpius avatar izriouil avatar jayeshpansheriya avatar wiwo99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

awesome_extensions's Issues

Sized Box from number instead of double

Change target of Size[d]BoxExtension from double to num to include also integers.
Also need to cast this while creating the Widget to this as double.

This is currently not possible: 15.heightBox

Use const on Widgets

In Flutter it is recommended to use const constructors whenever possible.
In the padding extensions, for example, it is not used.

  Padding paddingSymmetric(
          {double vertical = 0.0, double horizontal = 0.0, Key? key}) =>
      Padding(
        key: key,
        padding: EdgeInsets.symmetric(
          vertical: vertical,
          horizontal: horizontal,
        ),
        child: this,
      );

This could be:

  Padding paddingSymmetric(
          {double vertical = 0.0, double horizontal = 0.0, Key? key}) =>
      Padding(
        key: key,
        padding: const EdgeInsets.symmetric(
          vertical: vertical,
          horizontal: horizontal,
        ),
        child: this,
      );

Potential wrong arguments in AsyncSnapshotExt

In AsyncSnapshotExt on the method R when<R>. The error callback is using itself as value for Object error param.

Screenshot 2024-03-07 at 18 18 49

In this screenshot, shows that the AsyncSnapshot indeed has an error value (ServerFailure), but the error returned from R Function(Object error, StackTrace? stackTrace) error callback is a closure (the function itself).

String capitalize() error 'Stack overflow'

Using string_extension method capitalize() will trigger a Stack Overflow because of the recursive call to .capitalize() inside.

I believe that's just a small mistake:

/// Capitalize each word inside string
/// Example: your name => Your Name, your name => Your name
String capitalize() {
  if (isEmpty) return this;
  return split(' ').map((e) => e.capitalize()).join(' ');
}

We should use capitalizeFirst() instead of capitalize().

Good work guys, i like the package !

Use generics properly in extensions

For instance
void pop<T>({result}) => Navigator.pop(this, result);
should be
void pop<T extends Object?>([T? result]) => Navigator.pop<T>(this, result);

Also, why result is named here makes no sense to me at all.
There's so many more like this

whenever i use context.pop() my linter always complains about failing to infer type arguments because of this.

[BUG] Extension DateTime: Yesterday not working if different months or years

e.g.:
DateTime instance is 31.01.2023
DateTime.now() is 01.02.2023

Current implemention will return false, that the given instance is yesterday:

bool get isYesterday {
    final nowDate = DateTime.now();
    return year == nowDate.year &&
        month == nowDate.month &&
        day == nowDate.day - 1;
  }

Should replace it with this:

bool get isYesterday {
    final nowDate = DateTime.now();
    final oneDay = const DateTime(days: 1);
    
    return nowDate.subtract(oneDay).isSameDate(this);
  }

PS: Tested it on today's date....

error about nil Widget

The children of MultiChildRenderObjectElement must each has an associated render object.

This typically means that the `Consumer` or its children
are not a subtype of `RenderObjectWidget`.
 Consumer(
                builder: (context, ref, child) {
                  final (progress, fileSize) = ref.watch(isolateDownloadNotifierProvider);
                  if (progress == 1.0 || showAudioControl.value == true) {
                    return Column(
                      children: [
                        Text(
                          "fileSize $fileSize",
                          style: TextStyle(fontSize: 20),
                        ),
                        AnimatedContainer(
                          duration: const Duration(milliseconds: 300),
                          child: ControlPanel(
                            audioPlayer: audioPlayer,
                            showSeekButtons: showSeekButtons.value,
                          ),
                        ),
                      ],
                    );
                  } 
                  } else {
                    return nil;
                  }
                },
              ),

other issues :

https://stackoverflow.com/questions/75870979/flutter-getx-the-children-of-multichildrenderobjectelement-must-each-has-an

ExpandedExtension already define

flexible_extansion.dat and expanded_extension.dart have same name "ExpandedExtension" which ,create conflicts so you have to change the name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.