https://github.com/birjuvachhani/macros_screwdriver
A collection of helpful macros to reduce boilerplate code and make development easier.
https://github.com/birjuvachhani/macros_screwdriver
Last synced: 6 months ago
JSON representation
A collection of helpful macros to reduce boilerplate code and make development easier.
- Host: GitHub
- URL: https://github.com/birjuvachhani/macros_screwdriver
- Owner: BirjuVachhani
- License: bsd-3-clause
- Created: 2024-09-18T10:37:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-01T13:36:21.000Z (11 months ago)
- Last Synced: 2025-03-28T05:49:38.706Z (7 months ago)
- Language: Dart
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Macros Screwdriver
A collection of helpful macros to reduce boilerplate code and make development easier.
> Note: This package is in early development and may not be stable yet. Use it at your own risk. More macros will
> be added.
>
> Requirements: Dart 3.6.0-261.0.dev## Getting started
In your `pubspec.yaml`:
```yaml
dependencies:
macros_screwdriver:
```Then, run `pub get`.
## List of all Macros
- [@PublicGetter()](#publicgetter): Generates a public getter for a private field.
## Macros
### @PublicGetter()
Generates a public getter for a private field.
```dart
import 'package:macros_screwdriver/macros_screwdriver.dart';class User {
@PublicGetter()
String _name;User(this._name);
}void main() {
final user = User('John');
print(user.name); // John
user.name = 'Doe'; // Compile-time error: user.name is a getter(read-only).
}```
## Found this package useful?
Show some love and support by starring the repository. ⭐
Want to support my work?
Or You can
## License
```
BSD 3-Clause LicenseCopyright (c) 2024, Birju Vachhani
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```