mirror of
https://github.com/flutter/samples.git
synced 2025-11-09 14:28:51 +00:00
code sharing sample: flat package directory (#1486)
This commit is contained in:
19
code_sharing/shared/lib/src/models.dart
Normal file
19
code_sharing/shared/lib/src/models.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'models.freezed.dart';
|
||||
part 'models.g.dart';
|
||||
|
||||
@Freezed()
|
||||
class Increment with _$Increment {
|
||||
const factory Increment({required int by}) = _Increment;
|
||||
|
||||
factory Increment.fromJson(Map<String, dynamic> json) =>
|
||||
_$IncrementFromJson(json);
|
||||
}
|
||||
|
||||
@Freezed()
|
||||
class Count with _$Count {
|
||||
const factory Count(int value) = _Count;
|
||||
|
||||
factory Count.fromJson(Map<String, dynamic> json) => _$CountFromJson(json);
|
||||
}
|
||||
Reference in New Issue
Block a user