Giter Club home page Giter Club logo

autoequal's Introduction

๐Ÿ‘‹ Welcome to My GitHub Hub! ๐Ÿš€

Hey there, fellow developers and tech enthusiasts! Thanks for dropping by my GitHub profile. Here, you'll find a collection of my exciting projects and coding adventures, with a focus on mobile app development using Flutter.

๐Ÿ‘จโ€๐Ÿ’ป About Me

I'm a passionate Flutter Developer, eager to create top-notch mobile applications that delight users and solve real-world problems. Learning and growing as a developer is at the core of my journey, and I can't wait to share my projects with you.

๐Ÿ’ก What to Expect

In this repository, you'll discover a variety of projects that I've poured my heart and soul into. From crafting complex meal planning apps to connecting car shippers and haulers through a smart marketplace, each project brings something unique to the table.

๐Ÿš€ My Approach

Clean and efficient code is my secret sauce! With a focus on best practices and a keen eye for detail, I strive to make every project a joy to use and maintain. Collaboration and teamwork fuel my passion, and I love working with fellow developers to create awesome solutions.

๐Ÿค Let's Connect!

I'm always thrilled to connect with like-minded developers, tech enthusiasts, and curious minds. If you're interested in my projects, want to chat about Flutter, or are up for some coding collaboration, feel free to reach out. Let's create something amazing together!

๐ŸŽ‰ Thanks for Dropping By!

Thanks for visiting my GitHub hub! I hope you find inspiration and value in the projects I've shared. Feel free to explore, star, and fork to your heart's content. Together, we'll code our way to new heights of innovation and fun! Happy coding! ๐Ÿš€

SKILLS

autoequal's People

Contributors

mrgnhnt96 avatar sunnydaydev avatar techouse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

autoequal's Issues

Transfer ownership

Hey @SunnyDayDev ๐Ÿ‘‹

I thought we'd make an issue to transfer ownership, that way we can communicate about what actions are taking place and when.

I accepted the invite to the publishers on pub.dev. You (or I) can transfer the ownership of the package whenever you'd like.

For the repository, I haven't gotten any invites yet to transfer the ownership of the repo.

If there is anything that you need me to do, please let me know.

Ignore Setter methods

Cont. from #9

Looks like _autoequalProps includes setter methods, even when there is no getter method provided.

The reason that setters are included is because they are technically FieldElements, with a distinguishable flag, isSynthetic. A simple check here to exclude the element from the list should solve this issue.

Here is a minimum code example

My dart class

import 'package:autoequal/autoequal.dart';
import 'package:equatable/equatable.dart';

part 'fake_class.g.dart';

@autoequal
class FakeClass extends Equatable {
  const FakeClass({
    required this.a,
  });

  final String a;

  set c(String value) => print(value);

  @override
  List<Object?> get props => _autoequalProps;
}

Generated Code

// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'fake_class.dart';

// **************************************************************************
// AutoequalGenerator
// **************************************************************************

extension _$FakeClassAutoequal on FakeClass {
  List<Object?> get _autoequalProps => [a, c];
}

Update analyzer in autoequal_gen

Hi, I really love this package as it makes working with Equatable a breeze.

Would you mind upgrading analyzer in autoequal_gen to

analyzer: '>=4.7.0 <6.0.0'

Exclude getters by default

Just came across your package, it looks super useful and I'm really interested in using it.

Ran a couple of use cases and found that the _autoequalProps includes getter methods by default. I think that the ability to include getter methods is useful but should not be default. I use getter methods as a way of extending the functionality to my classes with the data/fields already provided, not necessarily as a new prop.

A possible solution for this would be to add an option to the build.yaml file

targets:
  $default:
    builders:

      autoequal_gen|autoequal:
        enabled: true
        options:
          include_getters: true

Or to annotate the element with either @ignoreAutoequal or @includeAutoequal for one off scenarios

The reason that getters (and setters, but I'll create another ticket for that) are included is because they are technically FieldElements, with a distinguishable flag, isSynthetic. A simple check here to exclude the element from the list should solve this issue.

Here is a minimum code example

My dart class

import 'package:autoequal/autoequal.dart';
import 'package:equatable/equatable.dart';

part 'fake_class.g.dart';

@autoequal
class FakeClass extends Equatable {
  const FakeClass({
    required this.a,
  });

  final String a;

  String get b => 'b';

  @override
  List<Object?> get props => _autoequalProps;
}

Generated Code

// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'fake_class.dart';

// **************************************************************************
// AutoequalGenerator
// **************************************************************************

extension _$FakeClassAutoequal on FakeClass {
  List<Object?> get _autoequalProps => [a, b];
}

What's keeping autoequal from working with abstract classes?

When trying to generate the code for my abstract class, a severe error occurred:

[SEVERE] autoequal_gen:autoequal on .../counter_bloc.dart:

abstract class CounterEvent extends Equatable is abstract. Autoequal doesn't support abstract classes.

The target class:

@autoequalMixin
abstract class CounterEvent extends Equatable {
  const CounterEvent();
}

The error message is clear, but what's keeping autoequal from generating the code for abstract classes?

props include mutable fields

Even though equatable is made for immutable objects, it can be used on mutable objects.

In cases like this, should we include the mutable fields? I think its possible to do a check for if the field isFinal. Even then, it could be declared and assigned at the same time (like a list, eg: final list = <String>[];.

At the very least we could probably loop through the constructors and see if it exists within a constructor?

Not sure how to handle this one yet..

Migrate to null safety

Hi, Are you going to migrate this package to null-safety?
Or will you accept PR if I do?

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.