import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter/foundation.dart';
part 'address.freezed.dart';
part 'address.g.dart';
@freezed
class Address with _$Address {
const factory Address({
@required String placeFormattedAddress, @required String placeName, @required String
placeId,@required double latitude, @required double longitude,}) = _Address;
factory Address.fromJson(Map<String, dynamic> json) =>_$AddressFromJson(json);}
Here is my pubspec.yaml
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
freezed_annotation: ^0.14.1
json_serializable: ^4.1.0
flutter_hooks: ^0.16.0
hooks_riverpod: ^0.13.1
dev_dependencies:
flutter_test:
sdk: flutter
lint: ^1.0.0
build_runner:
freezed: ^0.14.1+2
I finally found the answer; with null-safe dart the @ is no longer needed to mark a required parameter; so instead of @required, now the syntax is only required
When null safe code is called from legacy code the required keyword is treated exactly like the @required annotation: failure to supply the argument will cause an analyzer hint.
https://dart.dev/null-safety/faq
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With