adding packages

This commit is contained in:
2026-01-15 14:38:46 -08:00
parent ef86e3ab6a
commit 6869cf47e5
5253 changed files with 726695 additions and 34 deletions
@@ -0,0 +1,47 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'theme.dart';
import 'widget.dart';
export 'theme.dart';
export 'widget.dart';
part 'project.freezed.dart';
part 'project.g.dart';
@freezed
abstract class FlutterProject with _$FlutterProject {
@JsonSerializable(explicitToJson: true)
factory FlutterProject({
@Default('example') String name,
@Default('com.example') String org,
@Default('A new Flutter project.') String description,
@Default(true) bool useSwift,
@Default(true) bool useKotlin,
@Default(['web']) List<String> targets,
String path,
String initialRoute,
ProjectScreen home,
List<ProjectWidget> widgets,
ProjectTheme lightTheme,
ProjectTheme darkTheme,
ThemeMode themeMode,
@Default(0) double canvasZoom,
@Default(0) double canvasOffsetDx,
@Default(0) double canvasOffsetDy,
}) = _FlutterProject;
factory FlutterProject.fromJson(Map<String, dynamic> json) =>
_$FlutterProjectFromJson(json);
}
enum ProjectTarget {
web,
ios,
android,
windows,
linux,
macos,
}
@@ -0,0 +1,521 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named
part of 'project.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
FlutterProject _$FlutterProjectFromJson(Map<String, dynamic> json) {
return _FlutterProject.fromJson(json);
}
class _$FlutterProjectTearOff {
const _$FlutterProjectTearOff();
_FlutterProject call(
{String name = 'example',
String org = 'com.example',
String description = 'A new Flutter project.',
bool useSwift = true,
bool useKotlin = true,
List<String> targets = const ['web'],
String path,
String initialRoute,
ProjectScreen home,
List<ProjectWidget> widgets,
ProjectTheme lightTheme,
ProjectTheme darkTheme,
ThemeMode themeMode,
double canvasZoom = 0,
double canvasOffsetDx = 0,
double canvasOffsetDy = 0}) {
return _FlutterProject(
name: name,
org: org,
description: description,
useSwift: useSwift,
useKotlin: useKotlin,
targets: targets,
path: path,
initialRoute: initialRoute,
home: home,
widgets: widgets,
lightTheme: lightTheme,
darkTheme: darkTheme,
themeMode: themeMode,
canvasZoom: canvasZoom,
canvasOffsetDx: canvasOffsetDx,
canvasOffsetDy: canvasOffsetDy,
);
}
}
// ignore: unused_element
const $FlutterProject = _$FlutterProjectTearOff();
mixin _$FlutterProject {
String get name;
String get org;
String get description;
bool get useSwift;
bool get useKotlin;
List<String> get targets;
String get path;
String get initialRoute;
ProjectScreen get home;
List<ProjectWidget> get widgets;
ProjectTheme get lightTheme;
ProjectTheme get darkTheme;
ThemeMode get themeMode;
double get canvasZoom;
double get canvasOffsetDx;
double get canvasOffsetDy;
Map<String, dynamic> toJson();
$FlutterProjectCopyWith<FlutterProject> get copyWith;
}
abstract class $FlutterProjectCopyWith<$Res> {
factory $FlutterProjectCopyWith(
FlutterProject value, $Res Function(FlutterProject) then) =
_$FlutterProjectCopyWithImpl<$Res>;
$Res call(
{String name,
String org,
String description,
bool useSwift,
bool useKotlin,
List<String> targets,
String path,
String initialRoute,
ProjectScreen home,
List<ProjectWidget> widgets,
ProjectTheme lightTheme,
ProjectTheme darkTheme,
ThemeMode themeMode,
double canvasZoom,
double canvasOffsetDx,
double canvasOffsetDy});
$ProjectThemeCopyWith<$Res> get lightTheme;
$ProjectThemeCopyWith<$Res> get darkTheme;
}
class _$FlutterProjectCopyWithImpl<$Res>
implements $FlutterProjectCopyWith<$Res> {
_$FlutterProjectCopyWithImpl(this._value, this._then);
final FlutterProject _value;
// ignore: unused_field
final $Res Function(FlutterProject) _then;
@override
$Res call({
Object name = freezed,
Object org = freezed,
Object description = freezed,
Object useSwift = freezed,
Object useKotlin = freezed,
Object targets = freezed,
Object path = freezed,
Object initialRoute = freezed,
Object home = freezed,
Object widgets = freezed,
Object lightTheme = freezed,
Object darkTheme = freezed,
Object themeMode = freezed,
Object canvasZoom = freezed,
Object canvasOffsetDx = freezed,
Object canvasOffsetDy = freezed,
}) {
return _then(_value.copyWith(
name: name == freezed ? _value.name : name as String,
org: org == freezed ? _value.org : org as String,
description:
description == freezed ? _value.description : description as String,
useSwift: useSwift == freezed ? _value.useSwift : useSwift as bool,
useKotlin: useKotlin == freezed ? _value.useKotlin : useKotlin as bool,
targets: targets == freezed ? _value.targets : targets as List<String>,
path: path == freezed ? _value.path : path as String,
initialRoute: initialRoute == freezed
? _value.initialRoute
: initialRoute as String,
home: home == freezed ? _value.home : home as ProjectScreen,
widgets:
widgets == freezed ? _value.widgets : widgets as List<ProjectWidget>,
lightTheme: lightTheme == freezed
? _value.lightTheme
: lightTheme as ProjectTheme,
darkTheme:
darkTheme == freezed ? _value.darkTheme : darkTheme as ProjectTheme,
themeMode:
themeMode == freezed ? _value.themeMode : themeMode as ThemeMode,
canvasZoom:
canvasZoom == freezed ? _value.canvasZoom : canvasZoom as double,
canvasOffsetDx: canvasOffsetDx == freezed
? _value.canvasOffsetDx
: canvasOffsetDx as double,
canvasOffsetDy: canvasOffsetDy == freezed
? _value.canvasOffsetDy
: canvasOffsetDy as double,
));
}
@override
$ProjectThemeCopyWith<$Res> get lightTheme {
if (_value.lightTheme == null) {
return null;
}
return $ProjectThemeCopyWith<$Res>(_value.lightTheme, (value) {
return _then(_value.copyWith(lightTheme: value));
});
}
@override
$ProjectThemeCopyWith<$Res> get darkTheme {
if (_value.darkTheme == null) {
return null;
}
return $ProjectThemeCopyWith<$Res>(_value.darkTheme, (value) {
return _then(_value.copyWith(darkTheme: value));
});
}
}
abstract class _$FlutterProjectCopyWith<$Res>
implements $FlutterProjectCopyWith<$Res> {
factory _$FlutterProjectCopyWith(
_FlutterProject value, $Res Function(_FlutterProject) then) =
__$FlutterProjectCopyWithImpl<$Res>;
@override
$Res call(
{String name,
String org,
String description,
bool useSwift,
bool useKotlin,
List<String> targets,
String path,
String initialRoute,
ProjectScreen home,
List<ProjectWidget> widgets,
ProjectTheme lightTheme,
ProjectTheme darkTheme,
ThemeMode themeMode,
double canvasZoom,
double canvasOffsetDx,
double canvasOffsetDy});
@override
$ProjectThemeCopyWith<$Res> get lightTheme;
@override
$ProjectThemeCopyWith<$Res> get darkTheme;
}
class __$FlutterProjectCopyWithImpl<$Res>
extends _$FlutterProjectCopyWithImpl<$Res>
implements _$FlutterProjectCopyWith<$Res> {
__$FlutterProjectCopyWithImpl(
_FlutterProject _value, $Res Function(_FlutterProject) _then)
: super(_value, (v) => _then(v as _FlutterProject));
@override
_FlutterProject get _value => super._value as _FlutterProject;
@override
$Res call({
Object name = freezed,
Object org = freezed,
Object description = freezed,
Object useSwift = freezed,
Object useKotlin = freezed,
Object targets = freezed,
Object path = freezed,
Object initialRoute = freezed,
Object home = freezed,
Object widgets = freezed,
Object lightTheme = freezed,
Object darkTheme = freezed,
Object themeMode = freezed,
Object canvasZoom = freezed,
Object canvasOffsetDx = freezed,
Object canvasOffsetDy = freezed,
}) {
return _then(_FlutterProject(
name: name == freezed ? _value.name : name as String,
org: org == freezed ? _value.org : org as String,
description:
description == freezed ? _value.description : description as String,
useSwift: useSwift == freezed ? _value.useSwift : useSwift as bool,
useKotlin: useKotlin == freezed ? _value.useKotlin : useKotlin as bool,
targets: targets == freezed ? _value.targets : targets as List<String>,
path: path == freezed ? _value.path : path as String,
initialRoute: initialRoute == freezed
? _value.initialRoute
: initialRoute as String,
home: home == freezed ? _value.home : home as ProjectScreen,
widgets:
widgets == freezed ? _value.widgets : widgets as List<ProjectWidget>,
lightTheme: lightTheme == freezed
? _value.lightTheme
: lightTheme as ProjectTheme,
darkTheme:
darkTheme == freezed ? _value.darkTheme : darkTheme as ProjectTheme,
themeMode:
themeMode == freezed ? _value.themeMode : themeMode as ThemeMode,
canvasZoom:
canvasZoom == freezed ? _value.canvasZoom : canvasZoom as double,
canvasOffsetDx: canvasOffsetDx == freezed
? _value.canvasOffsetDx
: canvasOffsetDx as double,
canvasOffsetDy: canvasOffsetDy == freezed
? _value.canvasOffsetDy
: canvasOffsetDy as double,
));
}
}
@JsonSerializable(explicitToJson: true)
class _$_FlutterProject
with DiagnosticableTreeMixin
implements _FlutterProject {
_$_FlutterProject(
{this.name = 'example',
this.org = 'com.example',
this.description = 'A new Flutter project.',
this.useSwift = true,
this.useKotlin = true,
this.targets = const ['web'],
this.path,
this.initialRoute,
this.home,
this.widgets,
this.lightTheme,
this.darkTheme,
this.themeMode,
this.canvasZoom = 0,
this.canvasOffsetDx = 0,
this.canvasOffsetDy = 0})
: assert(name != null),
assert(org != null),
assert(description != null),
assert(useSwift != null),
assert(useKotlin != null),
assert(targets != null),
assert(canvasZoom != null),
assert(canvasOffsetDx != null),
assert(canvasOffsetDy != null);
factory _$_FlutterProject.fromJson(Map<String, dynamic> json) =>
_$_$_FlutterProjectFromJson(json);
@JsonKey(defaultValue: 'example')
@override
final String name;
@JsonKey(defaultValue: 'com.example')
@override
final String org;
@JsonKey(defaultValue: 'A new Flutter project.')
@override
final String description;
@JsonKey(defaultValue: true)
@override
final bool useSwift;
@JsonKey(defaultValue: true)
@override
final bool useKotlin;
@JsonKey(defaultValue: const ['web'])
@override
final List<String> targets;
@override
final String path;
@override
final String initialRoute;
@override
final ProjectScreen home;
@override
final List<ProjectWidget> widgets;
@override
final ProjectTheme lightTheme;
@override
final ProjectTheme darkTheme;
@override
final ThemeMode themeMode;
@JsonKey(defaultValue: 0)
@override
final double canvasZoom;
@JsonKey(defaultValue: 0)
@override
final double canvasOffsetDx;
@JsonKey(defaultValue: 0)
@override
final double canvasOffsetDy;
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'FlutterProject(name: $name, org: $org, description: $description, useSwift: $useSwift, useKotlin: $useKotlin, targets: $targets, path: $path, initialRoute: $initialRoute, home: $home, widgets: $widgets, lightTheme: $lightTheme, darkTheme: $darkTheme, themeMode: $themeMode, canvasZoom: $canvasZoom, canvasOffsetDx: $canvasOffsetDx, canvasOffsetDy: $canvasOffsetDy)';
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty('type', 'FlutterProject'))
..add(DiagnosticsProperty('name', name))
..add(DiagnosticsProperty('org', org))
..add(DiagnosticsProperty('description', description))
..add(DiagnosticsProperty('useSwift', useSwift))
..add(DiagnosticsProperty('useKotlin', useKotlin))
..add(DiagnosticsProperty('targets', targets))
..add(DiagnosticsProperty('path', path))
..add(DiagnosticsProperty('initialRoute', initialRoute))
..add(DiagnosticsProperty('home', home))
..add(DiagnosticsProperty('widgets', widgets))
..add(DiagnosticsProperty('lightTheme', lightTheme))
..add(DiagnosticsProperty('darkTheme', darkTheme))
..add(DiagnosticsProperty('themeMode', themeMode))
..add(DiagnosticsProperty('canvasZoom', canvasZoom))
..add(DiagnosticsProperty('canvasOffsetDx', canvasOffsetDx))
..add(DiagnosticsProperty('canvasOffsetDy', canvasOffsetDy));
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _FlutterProject &&
(identical(other.name, name) ||
const DeepCollectionEquality().equals(other.name, name)) &&
(identical(other.org, org) ||
const DeepCollectionEquality().equals(other.org, org)) &&
(identical(other.description, description) ||
const DeepCollectionEquality()
.equals(other.description, description)) &&
(identical(other.useSwift, useSwift) ||
const DeepCollectionEquality()
.equals(other.useSwift, useSwift)) &&
(identical(other.useKotlin, useKotlin) ||
const DeepCollectionEquality()
.equals(other.useKotlin, useKotlin)) &&
(identical(other.targets, targets) ||
const DeepCollectionEquality()
.equals(other.targets, targets)) &&
(identical(other.path, path) ||
const DeepCollectionEquality().equals(other.path, path)) &&
(identical(other.initialRoute, initialRoute) ||
const DeepCollectionEquality()
.equals(other.initialRoute, initialRoute)) &&
(identical(other.home, home) ||
const DeepCollectionEquality().equals(other.home, home)) &&
(identical(other.widgets, widgets) ||
const DeepCollectionEquality()
.equals(other.widgets, widgets)) &&
(identical(other.lightTheme, lightTheme) ||
const DeepCollectionEquality()
.equals(other.lightTheme, lightTheme)) &&
(identical(other.darkTheme, darkTheme) ||
const DeepCollectionEquality()
.equals(other.darkTheme, darkTheme)) &&
(identical(other.themeMode, themeMode) ||
const DeepCollectionEquality()
.equals(other.themeMode, themeMode)) &&
(identical(other.canvasZoom, canvasZoom) ||
const DeepCollectionEquality()
.equals(other.canvasZoom, canvasZoom)) &&
(identical(other.canvasOffsetDx, canvasOffsetDx) ||
const DeepCollectionEquality()
.equals(other.canvasOffsetDx, canvasOffsetDx)) &&
(identical(other.canvasOffsetDy, canvasOffsetDy) ||
const DeepCollectionEquality()
.equals(other.canvasOffsetDy, canvasOffsetDy)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(name) ^
const DeepCollectionEquality().hash(org) ^
const DeepCollectionEquality().hash(description) ^
const DeepCollectionEquality().hash(useSwift) ^
const DeepCollectionEquality().hash(useKotlin) ^
const DeepCollectionEquality().hash(targets) ^
const DeepCollectionEquality().hash(path) ^
const DeepCollectionEquality().hash(initialRoute) ^
const DeepCollectionEquality().hash(home) ^
const DeepCollectionEquality().hash(widgets) ^
const DeepCollectionEquality().hash(lightTheme) ^
const DeepCollectionEquality().hash(darkTheme) ^
const DeepCollectionEquality().hash(themeMode) ^
const DeepCollectionEquality().hash(canvasZoom) ^
const DeepCollectionEquality().hash(canvasOffsetDx) ^
const DeepCollectionEquality().hash(canvasOffsetDy);
@override
_$FlutterProjectCopyWith<_FlutterProject> get copyWith =>
__$FlutterProjectCopyWithImpl<_FlutterProject>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$_$_FlutterProjectToJson(this);
}
}
abstract class _FlutterProject implements FlutterProject {
factory _FlutterProject(
{String name,
String org,
String description,
bool useSwift,
bool useKotlin,
List<String> targets,
String path,
String initialRoute,
ProjectScreen home,
List<ProjectWidget> widgets,
ProjectTheme lightTheme,
ProjectTheme darkTheme,
ThemeMode themeMode,
double canvasZoom,
double canvasOffsetDx,
double canvasOffsetDy}) = _$_FlutterProject;
factory _FlutterProject.fromJson(Map<String, dynamic> json) =
_$_FlutterProject.fromJson;
@override
String get name;
@override
String get org;
@override
String get description;
@override
bool get useSwift;
@override
bool get useKotlin;
@override
List<String> get targets;
@override
String get path;
@override
String get initialRoute;
@override
ProjectScreen get home;
@override
List<ProjectWidget> get widgets;
@override
ProjectTheme get lightTheme;
@override
ProjectTheme get darkTheme;
@override
ThemeMode get themeMode;
@override
double get canvasZoom;
@override
double get canvasOffsetDx;
@override
double get canvasOffsetDy;
@override
_$FlutterProjectCopyWith<_FlutterProject> get copyWith;
}
@@ -0,0 +1,97 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'project.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$_FlutterProject _$_$_FlutterProjectFromJson(Map<String, dynamic> json) {
return _$_FlutterProject(
name: json['name'] as String ?? 'example',
org: json['org'] as String ?? 'com.example',
description: json['description'] as String ?? 'A new Flutter project.',
useSwift: json['useSwift'] as bool ?? true,
useKotlin: json['useKotlin'] as bool ?? true,
targets:
(json['targets'] as List)?.map((e) => e as String)?.toList() ?? ['web'],
path: json['path'] as String,
initialRoute: json['initialRoute'] as String,
home: json['home'] == null
? null
: ProjectScreen.fromJson(json['home'] as Map<String, dynamic>),
widgets: (json['widgets'] as List)
?.map((e) => e == null
? null
: ProjectWidget.fromJson(e as Map<String, dynamic>))
?.toList(),
lightTheme: json['lightTheme'] == null
? null
: ProjectTheme.fromJson(json['lightTheme'] as Map<String, dynamic>),
darkTheme: json['darkTheme'] == null
? null
: ProjectTheme.fromJson(json['darkTheme'] as Map<String, dynamic>),
themeMode: _$enumDecodeNullable(_$ThemeModeEnumMap, json['themeMode']),
canvasZoom: (json['canvasZoom'] as num)?.toDouble() ?? 0,
canvasOffsetDx: (json['canvasOffsetDx'] as num)?.toDouble() ?? 0,
canvasOffsetDy: (json['canvasOffsetDy'] as num)?.toDouble() ?? 0,
);
}
Map<String, dynamic> _$_$_FlutterProjectToJson(_$_FlutterProject instance) =>
<String, dynamic>{
'name': instance.name,
'org': instance.org,
'description': instance.description,
'useSwift': instance.useSwift,
'useKotlin': instance.useKotlin,
'targets': instance.targets,
'path': instance.path,
'initialRoute': instance.initialRoute,
'home': instance.home?.toJson(),
'widgets': instance.widgets?.map((e) => e?.toJson())?.toList(),
'lightTheme': instance.lightTheme?.toJson(),
'darkTheme': instance.darkTheme?.toJson(),
'themeMode': _$ThemeModeEnumMap[instance.themeMode],
'canvasZoom': instance.canvasZoom,
'canvasOffsetDx': instance.canvasOffsetDx,
'canvasOffsetDy': instance.canvasOffsetDy,
};
T _$enumDecode<T>(
Map<T, dynamic> enumValues,
dynamic source, {
T unknownValue,
}) {
if (source == null) {
throw ArgumentError('A value must be provided. Supported values: '
'${enumValues.values.join(', ')}');
}
final value = enumValues.entries
.singleWhere((e) => e.value == source, orElse: () => null)
?.key;
if (value == null && unknownValue == null) {
throw ArgumentError('`$source` is not one of the supported values: '
'${enumValues.values.join(', ')}');
}
return value ?? unknownValue;
}
T _$enumDecodeNullable<T>(
Map<T, dynamic> enumValues,
dynamic source, {
T unknownValue,
}) {
if (source == null) {
return null;
}
return _$enumDecode<T>(enumValues, source, unknownValue: unknownValue);
}
const _$ThemeModeEnumMap = {
ThemeMode.system: 'system',
ThemeMode.light: 'light',
ThemeMode.dark: 'dark',
};
@@ -0,0 +1,71 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'theme.freezed.dart';
part 'theme.g.dart';
@freezed
abstract class ProjectTheme with _$ProjectTheme {
@JsonSerializable(explicitToJson: true)
factory ProjectTheme({
bool lightBrightness,
int primaryColor,
int accentColor,
int scaffoldBackgroundColor,
int floatingActionButtonBackgroundColor,
int floatingActionButtonForegroundColor,
List<CustomColor> customColors,
List<CustomGradient> customGradients,
}) = _ProjectTheme;
factory ProjectTheme.fromJson(Map<String, dynamic> json) =>
_$ProjectThemeFromJson(json);
}
@freezed
abstract class CustomColor with _$CustomColor {
@JsonSerializable(explicitToJson: true)
factory CustomColor({
String name,
int color,
}) = _CustomColor;
factory CustomColor.fromJson(Map<String, dynamic> json) =>
_$CustomColorFromJson(json);
}
@freezed
abstract class CustomGradient with _$CustomGradient {
@JsonSerializable(explicitToJson: true)
factory CustomGradient({
String name,
List<int> colors,
}) = _CustomGradient;
factory CustomGradient.radial({
String name,
List<double> stops,
List<int> colors,
double radius,
double alignX,
double alignY,
double focalX,
double focalY,
}) = CustomRadialGradient;
factory CustomGradient.linear({
String name,
List<double> stops,
List<int> colors,
double radius,
double startX,
double startY,
double endX,
double endY,
TileMode tileMode,
}) = CustomLinearGradient;
factory CustomGradient.fromJson(Map<String, dynamic> json) =>
_$CustomGradientFromJson(json);
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,166 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'theme.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$_ProjectTheme _$_$_ProjectThemeFromJson(Map<String, dynamic> json) {
return _$_ProjectTheme(
lightBrightness: json['lightBrightness'] as bool,
primaryColor: json['primaryColor'] as int,
accentColor: json['accentColor'] as int,
scaffoldBackgroundColor: json['scaffoldBackgroundColor'] as int,
floatingActionButtonBackgroundColor:
json['floatingActionButtonBackgroundColor'] as int,
floatingActionButtonForegroundColor:
json['floatingActionButtonForegroundColor'] as int,
customColors: (json['customColors'] as List)
?.map((e) =>
e == null ? null : CustomColor.fromJson(e as Map<String, dynamic>))
?.toList(),
customGradients: (json['customGradients'] as List)
?.map((e) => e == null
? null
: CustomGradient.fromJson(e as Map<String, dynamic>))
?.toList(),
);
}
Map<String, dynamic> _$_$_ProjectThemeToJson(_$_ProjectTheme instance) =>
<String, dynamic>{
'lightBrightness': instance.lightBrightness,
'primaryColor': instance.primaryColor,
'accentColor': instance.accentColor,
'scaffoldBackgroundColor': instance.scaffoldBackgroundColor,
'floatingActionButtonBackgroundColor':
instance.floatingActionButtonBackgroundColor,
'floatingActionButtonForegroundColor':
instance.floatingActionButtonForegroundColor,
'customColors': instance.customColors?.map((e) => e?.toJson())?.toList(),
'customGradients':
instance.customGradients?.map((e) => e?.toJson())?.toList(),
};
_$_CustomColor _$_$_CustomColorFromJson(Map<String, dynamic> json) {
return _$_CustomColor(
name: json['name'] as String,
color: json['color'] as int,
);
}
Map<String, dynamic> _$_$_CustomColorToJson(_$_CustomColor instance) =>
<String, dynamic>{
'name': instance.name,
'color': instance.color,
};
_$_CustomGradient _$_$_CustomGradientFromJson(Map<String, dynamic> json) {
return _$_CustomGradient(
name: json['name'] as String,
colors: (json['colors'] as List)?.map((e) => e as int)?.toList(),
);
}
Map<String, dynamic> _$_$_CustomGradientToJson(_$_CustomGradient instance) =>
<String, dynamic>{
'name': instance.name,
'colors': instance.colors,
};
_$CustomRadialGradient _$_$CustomRadialGradientFromJson(
Map<String, dynamic> json) {
return _$CustomRadialGradient(
name: json['name'] as String,
stops:
(json['stops'] as List)?.map((e) => (e as num)?.toDouble())?.toList(),
colors: (json['colors'] as List)?.map((e) => e as int)?.toList(),
radius: (json['radius'] as num)?.toDouble(),
alignX: (json['alignX'] as num)?.toDouble(),
alignY: (json['alignY'] as num)?.toDouble(),
focalX: (json['focalX'] as num)?.toDouble(),
focalY: (json['focalY'] as num)?.toDouble(),
);
}
Map<String, dynamic> _$_$CustomRadialGradientToJson(
_$CustomRadialGradient instance) =>
<String, dynamic>{
'name': instance.name,
'stops': instance.stops,
'colors': instance.colors,
'radius': instance.radius,
'alignX': instance.alignX,
'alignY': instance.alignY,
'focalX': instance.focalX,
'focalY': instance.focalY,
};
_$CustomLinearGradient _$_$CustomLinearGradientFromJson(
Map<String, dynamic> json) {
return _$CustomLinearGradient(
name: json['name'] as String,
stops:
(json['stops'] as List)?.map((e) => (e as num)?.toDouble())?.toList(),
colors: (json['colors'] as List)?.map((e) => e as int)?.toList(),
radius: (json['radius'] as num)?.toDouble(),
startX: (json['startX'] as num)?.toDouble(),
startY: (json['startY'] as num)?.toDouble(),
endX: (json['endX'] as num)?.toDouble(),
endY: (json['endY'] as num)?.toDouble(),
tileMode: _$enumDecodeNullable(_$TileModeEnumMap, json['tileMode']),
);
}
Map<String, dynamic> _$_$CustomLinearGradientToJson(
_$CustomLinearGradient instance) =>
<String, dynamic>{
'name': instance.name,
'stops': instance.stops,
'colors': instance.colors,
'radius': instance.radius,
'startX': instance.startX,
'startY': instance.startY,
'endX': instance.endX,
'endY': instance.endY,
'tileMode': _$TileModeEnumMap[instance.tileMode],
};
T _$enumDecode<T>(
Map<T, dynamic> enumValues,
dynamic source, {
T unknownValue,
}) {
if (source == null) {
throw ArgumentError('A value must be provided. Supported values: '
'${enumValues.values.join(', ')}');
}
final value = enumValues.entries
.singleWhere((e) => e.value == source, orElse: () => null)
?.key;
if (value == null && unknownValue == null) {
throw ArgumentError('`$source` is not one of the supported values: '
'${enumValues.values.join(', ')}');
}
return value ?? unknownValue;
}
T _$enumDecodeNullable<T>(
Map<T, dynamic> enumValues,
dynamic source, {
T unknownValue,
}) {
if (source == null) {
return null;
}
return _$enumDecode<T>(enumValues, source, unknownValue: unknownValue);
}
const _$TileModeEnumMap = {
TileMode.clamp: 'clamp',
TileMode.repeated: 'repeated',
TileMode.mirror: 'mirror',
};
@@ -0,0 +1,27 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'widget.freezed.dart';
part 'widget.g.dart';
@freezed
abstract class ProjectWidget with _$ProjectWidget {
@JsonSerializable(explicitToJson: true)
factory ProjectWidget.screen({
String path,
@Default('MyScreen') String className,
@Default(false) bool isStateful,
@Default('/') String route,
String data,
List<String> tokens,
List<String> callbacks,
double dx,
double dy,
double width,
double height,
}) = ProjectScreen;
factory ProjectWidget.fromJson(Map<String, dynamic> json) =>
_$ProjectWidgetFromJson(json);
}
@@ -0,0 +1,353 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named
part of 'widget.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
ProjectWidget _$ProjectWidgetFromJson(Map<String, dynamic> json) {
return ProjectScreen.fromJson(json);
}
class _$ProjectWidgetTearOff {
const _$ProjectWidgetTearOff();
ProjectScreen screen(
{String path,
String className = 'MyScreen',
bool isStateful = false,
String route = '/',
String data,
List<String> tokens,
List<String> callbacks,
double dx,
double dy,
double width,
double height}) {
return ProjectScreen(
path: path,
className: className,
isStateful: isStateful,
route: route,
data: data,
tokens: tokens,
callbacks: callbacks,
dx: dx,
dy: dy,
width: width,
height: height,
);
}
}
// ignore: unused_element
const $ProjectWidget = _$ProjectWidgetTearOff();
mixin _$ProjectWidget {
String get path;
String get className;
bool get isStateful;
String get route;
String get data;
List<String> get tokens;
List<String> get callbacks;
double get dx;
double get dy;
double get width;
double get height;
Map<String, dynamic> toJson();
$ProjectWidgetCopyWith<ProjectWidget> get copyWith;
}
abstract class $ProjectWidgetCopyWith<$Res> {
factory $ProjectWidgetCopyWith(
ProjectWidget value, $Res Function(ProjectWidget) then) =
_$ProjectWidgetCopyWithImpl<$Res>;
$Res call(
{String path,
String className,
bool isStateful,
String route,
String data,
List<String> tokens,
List<String> callbacks,
double dx,
double dy,
double width,
double height});
}
class _$ProjectWidgetCopyWithImpl<$Res>
implements $ProjectWidgetCopyWith<$Res> {
_$ProjectWidgetCopyWithImpl(this._value, this._then);
final ProjectWidget _value;
// ignore: unused_field
final $Res Function(ProjectWidget) _then;
@override
$Res call({
Object path = freezed,
Object className = freezed,
Object isStateful = freezed,
Object route = freezed,
Object data = freezed,
Object tokens = freezed,
Object callbacks = freezed,
Object dx = freezed,
Object dy = freezed,
Object width = freezed,
Object height = freezed,
}) {
return _then(_value.copyWith(
path: path == freezed ? _value.path : path as String,
className: className == freezed ? _value.className : className as String,
isStateful:
isStateful == freezed ? _value.isStateful : isStateful as bool,
route: route == freezed ? _value.route : route as String,
data: data == freezed ? _value.data : data as String,
tokens: tokens == freezed ? _value.tokens : tokens as List<String>,
callbacks:
callbacks == freezed ? _value.callbacks : callbacks as List<String>,
dx: dx == freezed ? _value.dx : dx as double,
dy: dy == freezed ? _value.dy : dy as double,
width: width == freezed ? _value.width : width as double,
height: height == freezed ? _value.height : height as double,
));
}
}
abstract class $ProjectScreenCopyWith<$Res>
implements $ProjectWidgetCopyWith<$Res> {
factory $ProjectScreenCopyWith(
ProjectScreen value, $Res Function(ProjectScreen) then) =
_$ProjectScreenCopyWithImpl<$Res>;
@override
$Res call(
{String path,
String className,
bool isStateful,
String route,
String data,
List<String> tokens,
List<String> callbacks,
double dx,
double dy,
double width,
double height});
}
class _$ProjectScreenCopyWithImpl<$Res>
extends _$ProjectWidgetCopyWithImpl<$Res>
implements $ProjectScreenCopyWith<$Res> {
_$ProjectScreenCopyWithImpl(
ProjectScreen _value, $Res Function(ProjectScreen) _then)
: super(_value, (v) => _then(v as ProjectScreen));
@override
ProjectScreen get _value => super._value as ProjectScreen;
@override
$Res call({
Object path = freezed,
Object className = freezed,
Object isStateful = freezed,
Object route = freezed,
Object data = freezed,
Object tokens = freezed,
Object callbacks = freezed,
Object dx = freezed,
Object dy = freezed,
Object width = freezed,
Object height = freezed,
}) {
return _then(ProjectScreen(
path: path == freezed ? _value.path : path as String,
className: className == freezed ? _value.className : className as String,
isStateful:
isStateful == freezed ? _value.isStateful : isStateful as bool,
route: route == freezed ? _value.route : route as String,
data: data == freezed ? _value.data : data as String,
tokens: tokens == freezed ? _value.tokens : tokens as List<String>,
callbacks:
callbacks == freezed ? _value.callbacks : callbacks as List<String>,
dx: dx == freezed ? _value.dx : dx as double,
dy: dy == freezed ? _value.dy : dy as double,
width: width == freezed ? _value.width : width as double,
height: height == freezed ? _value.height : height as double,
));
}
}
@JsonSerializable(explicitToJson: true)
class _$ProjectScreen with DiagnosticableTreeMixin implements ProjectScreen {
_$ProjectScreen(
{this.path,
this.className = 'MyScreen',
this.isStateful = false,
this.route = '/',
this.data,
this.tokens,
this.callbacks,
this.dx,
this.dy,
this.width,
this.height})
: assert(className != null),
assert(isStateful != null),
assert(route != null);
factory _$ProjectScreen.fromJson(Map<String, dynamic> json) =>
_$_$ProjectScreenFromJson(json);
@override
final String path;
@JsonKey(defaultValue: 'MyScreen')
@override
final String className;
@JsonKey(defaultValue: false)
@override
final bool isStateful;
@JsonKey(defaultValue: '/')
@override
final String route;
@override
final String data;
@override
final List<String> tokens;
@override
final List<String> callbacks;
@override
final double dx;
@override
final double dy;
@override
final double width;
@override
final double height;
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'ProjectWidget.screen(path: $path, className: $className, isStateful: $isStateful, route: $route, data: $data, tokens: $tokens, callbacks: $callbacks, dx: $dx, dy: $dy, width: $width, height: $height)';
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty('type', 'ProjectWidget.screen'))
..add(DiagnosticsProperty('path', path))
..add(DiagnosticsProperty('className', className))
..add(DiagnosticsProperty('isStateful', isStateful))
..add(DiagnosticsProperty('route', route))
..add(DiagnosticsProperty('data', data))
..add(DiagnosticsProperty('tokens', tokens))
..add(DiagnosticsProperty('callbacks', callbacks))
..add(DiagnosticsProperty('dx', dx))
..add(DiagnosticsProperty('dy', dy))
..add(DiagnosticsProperty('width', width))
..add(DiagnosticsProperty('height', height));
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is ProjectScreen &&
(identical(other.path, path) ||
const DeepCollectionEquality().equals(other.path, path)) &&
(identical(other.className, className) ||
const DeepCollectionEquality()
.equals(other.className, className)) &&
(identical(other.isStateful, isStateful) ||
const DeepCollectionEquality()
.equals(other.isStateful, isStateful)) &&
(identical(other.route, route) ||
const DeepCollectionEquality().equals(other.route, route)) &&
(identical(other.data, data) ||
const DeepCollectionEquality().equals(other.data, data)) &&
(identical(other.tokens, tokens) ||
const DeepCollectionEquality().equals(other.tokens, tokens)) &&
(identical(other.callbacks, callbacks) ||
const DeepCollectionEquality()
.equals(other.callbacks, callbacks)) &&
(identical(other.dx, dx) ||
const DeepCollectionEquality().equals(other.dx, dx)) &&
(identical(other.dy, dy) ||
const DeepCollectionEquality().equals(other.dy, dy)) &&
(identical(other.width, width) ||
const DeepCollectionEquality().equals(other.width, width)) &&
(identical(other.height, height) ||
const DeepCollectionEquality().equals(other.height, height)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(path) ^
const DeepCollectionEquality().hash(className) ^
const DeepCollectionEquality().hash(isStateful) ^
const DeepCollectionEquality().hash(route) ^
const DeepCollectionEquality().hash(data) ^
const DeepCollectionEquality().hash(tokens) ^
const DeepCollectionEquality().hash(callbacks) ^
const DeepCollectionEquality().hash(dx) ^
const DeepCollectionEquality().hash(dy) ^
const DeepCollectionEquality().hash(width) ^
const DeepCollectionEquality().hash(height);
@override
$ProjectScreenCopyWith<ProjectScreen> get copyWith =>
_$ProjectScreenCopyWithImpl<ProjectScreen>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$_$ProjectScreenToJson(this);
}
}
abstract class ProjectScreen implements ProjectWidget {
factory ProjectScreen(
{String path,
String className,
bool isStateful,
String route,
String data,
List<String> tokens,
List<String> callbacks,
double dx,
double dy,
double width,
double height}) = _$ProjectScreen;
factory ProjectScreen.fromJson(Map<String, dynamic> json) =
_$ProjectScreen.fromJson;
@override
String get path;
@override
String get className;
@override
bool get isStateful;
@override
String get route;
@override
String get data;
@override
List<String> get tokens;
@override
List<String> get callbacks;
@override
double get dx;
@override
double get dy;
@override
double get width;
@override
double get height;
@override
$ProjectScreenCopyWith<ProjectScreen> get copyWith;
}
@@ -0,0 +1,38 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'widget.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$ProjectScreen _$_$ProjectScreenFromJson(Map<String, dynamic> json) {
return _$ProjectScreen(
path: json['path'] as String,
className: json['className'] as String ?? 'MyScreen',
isStateful: json['isStateful'] as bool ?? false,
route: json['route'] as String ?? '/',
data: json['data'] as String,
tokens: (json['tokens'] as List)?.map((e) => e as String)?.toList(),
callbacks: (json['callbacks'] as List)?.map((e) => e as String)?.toList(),
dx: (json['dx'] as num)?.toDouble(),
dy: (json['dy'] as num)?.toDouble(),
width: (json['width'] as num)?.toDouble(),
height: (json['height'] as num)?.toDouble(),
);
}
Map<String, dynamic> _$_$ProjectScreenToJson(_$ProjectScreen instance) =>
<String, dynamic>{
'path': instance.path,
'className': instance.className,
'isStateful': instance.isStateful,
'route': instance.route,
'data': instance.data,
'tokens': instance.tokens,
'callbacks': instance.callbacks,
'dx': instance.dx,
'dy': instance.dy,
'width': instance.width,
'height': instance.height,
};