adding packages
@@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"reflectable"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# 1.0.0
|
||||
|
||||
- Adding Base Classes
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Rody Davis
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,46 @@
|
||||
# Flutter Widget Gen
|
||||
|
||||
```console
|
||||
flutter pub get
|
||||
flutter pub run build_runner build
|
||||
```
|
||||
|
||||
```dart
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dynamic_widget/flutter_dynamic_widget.dart';
|
||||
|
||||
import '../library.dart';
|
||||
|
||||
part 'center.g.dart';
|
||||
|
||||
@WidgetClass('Center')
|
||||
class CenterBase extends _$CenterBase {
|
||||
CenterBase(this.widgetData, this.widgetContext);
|
||||
|
||||
@WidgetKey.widget(
|
||||
acceptWidth: 100,
|
||||
acceptHeight: 100,
|
||||
defaultValue: 'Placeholder',
|
||||
)
|
||||
Widget child;
|
||||
double heightFactor;
|
||||
Key key;
|
||||
double widthFactor;
|
||||
|
||||
@override
|
||||
final Map<String, dynamic> widgetData;
|
||||
|
||||
@override
|
||||
final WidgetContext widgetContext;
|
||||
|
||||
@override
|
||||
get onAction => (context, val) => MaterialBase.onAction(context, val);
|
||||
|
||||
@override
|
||||
GenerateWidget get widgetRender =>
|
||||
(val) => MaterialBase(val, widgetContext).base;
|
||||
}
|
||||
|
||||
```
|
||||
@@ -0,0 +1,21 @@
|
||||
targets:
|
||||
$default:
|
||||
builders:
|
||||
reflectable:
|
||||
generate_for:
|
||||
- lib/main.dart
|
||||
options:
|
||||
formatted: true
|
||||
widget_gen:
|
||||
enabled: true
|
||||
|
||||
builders:
|
||||
widget_gen:
|
||||
target: ':widget_gen'
|
||||
import: 'package:widget_gen/builder.dart'
|
||||
builder_factories: ['widgetGenerator']
|
||||
build_extensions: { '.dart': ['.store.g.part'] }
|
||||
auto_apply: dependents
|
||||
build_to: cache
|
||||
applies_builders: ['source_gen|combining_builder']
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import 'package:build/build.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
import 'src/class_annotation_gen.dart';
|
||||
|
||||
Builder widgetGenerator(BuilderOptions options) {
|
||||
return SharedPartBuilder([WidgetGenerator()], 'widget_generator');
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type_system.dart';
|
||||
import 'package:build/build.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
import 'store_class_visitor.dart';
|
||||
import 'template/widget_class_gen.dart';
|
||||
import 'template/store_file.dart';
|
||||
import 'type_names.dart';
|
||||
|
||||
class WidgetGenerator extends Generator {
|
||||
//GeneratorForAnnotation<WidgetClass> {
|
||||
@override
|
||||
FutureOr<String> generate(LibraryReader library, BuildStep buildStep) async {
|
||||
if (library.allElements.isEmpty) {
|
||||
return '';
|
||||
}
|
||||
|
||||
final typeSystem = await library.allElements.first.session.typeSystem;
|
||||
final file = StoreFileTemplate()
|
||||
..storeSources = _generateCodeForLibrary(library, typeSystem).toSet();
|
||||
return file.toString();
|
||||
}
|
||||
|
||||
Iterable<String> _generateCodeForLibrary(
|
||||
LibraryReader library,
|
||||
TypeSystem typeSystem,
|
||||
) sync* {
|
||||
for (final classElement in library.classes) {
|
||||
yield* _generateCodeForMixinStore(
|
||||
library,
|
||||
classElement,
|
||||
typeSystem,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Iterable<String> _generateCodeForMixinStore(
|
||||
LibraryReader library,
|
||||
ClassElement baseClass,
|
||||
TypeSystem typeSystem,
|
||||
) sync* {
|
||||
final typeNameFinder = LibraryScopedNameFinder(library.element);
|
||||
String _base;
|
||||
double width, height;
|
||||
|
||||
if (isWidgetClass(baseClass)) {
|
||||
width = getPreferredWidth(baseClass);
|
||||
height = getPreferredHeight(baseClass);
|
||||
if (width != null || height != null) {
|
||||
_base = 'WidgetPreferredSizedBase';
|
||||
} else {
|
||||
_base = 'WidgetBase';
|
||||
}
|
||||
}
|
||||
if (isPropertyClass(baseClass)) {
|
||||
_base = 'PropertyBase';
|
||||
}
|
||||
if (_base != null) {
|
||||
final _template = MixinStoreTemplate(_base)
|
||||
..width = width
|
||||
..height = height;
|
||||
yield _generateCodeFromTemplate(
|
||||
baseClass.name,
|
||||
baseClass,
|
||||
_template,
|
||||
typeNameFinder,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _generateCodeFromTemplate(
|
||||
String publicTypeName,
|
||||
ClassElement userStoreClass,
|
||||
StoreTemplate template,
|
||||
LibraryScopedNameFinder typeNameFinder,
|
||||
) {
|
||||
final visitor = StoreClassVisitor(publicTypeName, userStoreClass, template);
|
||||
userStoreClass
|
||||
..accept(visitor)
|
||||
..visitChildren(visitor);
|
||||
return visitor.source;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
abstract class CodegenError {
|
||||
bool get hasErrors;
|
||||
String get message;
|
||||
}
|
||||
|
||||
class StoreClassCodegenErrors implements CodegenError {
|
||||
StoreClassCodegenErrors(this.name) {
|
||||
_errorCategories = [
|
||||
// nonAbstractStoreMixinDeclarations,
|
||||
// invalidComputedAnnotations,
|
||||
// invalidObservableAnnotations,
|
||||
invalidActionAnnotations,
|
||||
// staticObservables,
|
||||
// finalObservables,
|
||||
];
|
||||
}
|
||||
|
||||
final String name;
|
||||
|
||||
final NonAbstractStoreMixinDeclarations nonAbstractStoreMixinDeclarations =
|
||||
NonAbstractStoreMixinDeclarations();
|
||||
|
||||
// final PropertyErrors finalObservables = FinalObservableFields();
|
||||
final PropertyErrors staticObservables = StaticObservableFields();
|
||||
final PropertyErrors invalidObservableAnnotations =
|
||||
InvalidObservableAnnotations();
|
||||
|
||||
final PropertyErrors invalidComputedAnnotations =
|
||||
InvalidComputedAnnotations();
|
||||
|
||||
final PropertyErrors invalidActionAnnotations = InvalidActionAnnotations();
|
||||
|
||||
List<CodegenError> _errorCategories;
|
||||
|
||||
@override
|
||||
String get message {
|
||||
final errors = _errorCategories
|
||||
.where((category) => category.hasErrors)
|
||||
.toList(growable: false)
|
||||
.asMap()
|
||||
.map((i, category) => MapEntry(i, ' ${i + 1}. ${category.message}'))
|
||||
.values
|
||||
.join('\n');
|
||||
|
||||
return 'Could not make class "$name" observable. Changes needed:\n$errors';
|
||||
}
|
||||
|
||||
@override
|
||||
bool get hasErrors => _errorCategories.any((category) => category.hasErrors);
|
||||
}
|
||||
|
||||
final _fieldPluralizer = Pluralize('the field', 'fields');
|
||||
final _methodPluralizer = Pluralize('the method', 'methods');
|
||||
final _memberPluralizer = Pluralize('the member', 'members');
|
||||
|
||||
abstract class _InvalidStoreDeclarations implements CodegenError {
|
||||
final NameList _classNames = NameList();
|
||||
|
||||
// ignore: avoid_positional_boolean_parameters
|
||||
bool addIf(bool condition, String className) {
|
||||
if (condition) {
|
||||
_classNames.add(className);
|
||||
}
|
||||
|
||||
return condition;
|
||||
}
|
||||
|
||||
@override
|
||||
bool get hasErrors => _classNames.isNotEmpty;
|
||||
}
|
||||
|
||||
class NonAbstractStoreMixinDeclarations extends _InvalidStoreDeclarations {
|
||||
@override
|
||||
String get message =>
|
||||
'Classes that use the SettingsStore mixin must be marked abstract. Affected classes: $_classNames.';
|
||||
}
|
||||
|
||||
abstract class PropertyErrors implements CodegenError {
|
||||
final NameList _properties = NameList();
|
||||
|
||||
// ignore: avoid_positional_boolean_parameters
|
||||
bool addIf(bool condition, String propertyName) {
|
||||
if (condition) {
|
||||
_properties.add(propertyName);
|
||||
}
|
||||
return condition;
|
||||
}
|
||||
|
||||
String get propertyList => _properties.toString();
|
||||
|
||||
Pluralize propertyPlural = _fieldPluralizer;
|
||||
|
||||
String get property => propertyPlural(_properties.length);
|
||||
|
||||
@override
|
||||
bool get hasErrors => _properties.isNotEmpty;
|
||||
}
|
||||
|
||||
// class FinalObservableFields extends PropertyErrors {
|
||||
// @override
|
||||
// String get message => 'Remove final modifier from $property $propertyList.';
|
||||
// }
|
||||
|
||||
class StaticObservableFields extends PropertyErrors {
|
||||
@override
|
||||
String get message => 'Remove static modifier from $property $propertyList.';
|
||||
}
|
||||
|
||||
class AsyncGeneratorActionMethods extends PropertyErrors {
|
||||
@override
|
||||
// ignore: overridden_fields
|
||||
Pluralize propertyPlural = _methodPluralizer;
|
||||
|
||||
@override
|
||||
String get message =>
|
||||
'Replace async* modifier with async from $property $propertyList.';
|
||||
}
|
||||
|
||||
class NonAsyncMethods extends PropertyErrors {
|
||||
@override
|
||||
// ignore: overridden_fields
|
||||
Pluralize propertyPlural = _methodPluralizer;
|
||||
|
||||
@override
|
||||
String get message =>
|
||||
'Return a Future or a Stream from $property $propertyList.';
|
||||
}
|
||||
|
||||
class InvalidComputedAnnotations extends PropertyErrors {
|
||||
@override
|
||||
// ignore: overridden_fields
|
||||
Pluralize propertyPlural = _memberPluralizer;
|
||||
|
||||
@override
|
||||
String get message =>
|
||||
'Remove @computed annotation for $property $propertyList. They only apply to property-getters.';
|
||||
}
|
||||
|
||||
class InvalidObservableAnnotations extends PropertyErrors {
|
||||
@override
|
||||
// ignore: overridden_fields
|
||||
Pluralize propertyPlural = _memberPluralizer;
|
||||
|
||||
@override
|
||||
String get message =>
|
||||
'Remove @observable annotation for $property $propertyList. They only apply to fields.';
|
||||
}
|
||||
|
||||
class InvalidActionAnnotations extends PropertyErrors {
|
||||
@override
|
||||
// ignore: overridden_fields
|
||||
Pluralize propertyPlural = _memberPluralizer;
|
||||
|
||||
@override
|
||||
String get message =>
|
||||
'Remove @action annotation for $property $propertyList. They only apply to methods.';
|
||||
}
|
||||
|
||||
class InvalidStaticMethods extends PropertyErrors {
|
||||
@override
|
||||
// ignore: overridden_fields
|
||||
Pluralize propertyPlural = _methodPluralizer;
|
||||
|
||||
@override
|
||||
String get message => 'Remove static modifier from $property $propertyList.';
|
||||
}
|
||||
|
||||
class NameList {
|
||||
final List<String> _names = [];
|
||||
|
||||
void add(String name) => _names.add(name);
|
||||
|
||||
int get length => _names.length;
|
||||
|
||||
bool get isNotEmpty => _names.isNotEmpty;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
if (_names.length == 1) {
|
||||
return '"${_names[0]}"';
|
||||
}
|
||||
|
||||
final buf = StringBuffer();
|
||||
for (var i = 0; i < _names.length; i++) {
|
||||
final name = _names[i];
|
||||
buf.write('"$name"');
|
||||
if (i < _names.length - 2) {
|
||||
buf.write(', ');
|
||||
} else if (i == _names.length - 2) {
|
||||
buf.write(' and ');
|
||||
}
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class Pluralize {
|
||||
Pluralize(this._single, this._multiple);
|
||||
|
||||
final String _single;
|
||||
final String _multiple;
|
||||
|
||||
String call(int count) => count == 1 ? _single : _multiple;
|
||||
}
|
||||
@@ -0,0 +1,365 @@
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:analyzer/dart/element/visitor.dart';
|
||||
import 'package:build/build.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
import '../widget_gen_annotations.dart';
|
||||
import 'errors.dart';
|
||||
import 'template/properties/base.dart';
|
||||
import 'template/properties/color.dart';
|
||||
import 'template/properties/edge_insets_geometry.dart';
|
||||
import 'template/properties/enum.dart';
|
||||
import 'template/properties/function.dart';
|
||||
import 'template/properties/key.dart';
|
||||
import 'template/properties/list_widget.dart';
|
||||
import 'template/properties/matrix_4.dart';
|
||||
import 'template/properties/offset.dart';
|
||||
import 'template/properties/size.dart';
|
||||
import 'template/properties/supported.dart';
|
||||
import 'template/properties/widget.dart';
|
||||
import 'template/util.dart';
|
||||
import 'template/widget_class_gen.dart';
|
||||
import 'type_names.dart';
|
||||
|
||||
class StoreClassVisitor extends SimpleElementVisitor {
|
||||
StoreClassVisitor(
|
||||
String publicTypeName,
|
||||
ClassElement userClass,
|
||||
StoreTemplate template,
|
||||
) : _errors = StoreClassCodegenErrors(publicTypeName) {
|
||||
_storeTemplate = template
|
||||
..typeParams.templates.addAll(userClass.typeParameters
|
||||
.map((type) => typeParamTemplate(type, typeNameFinder)))
|
||||
..typeArgs.templates.addAll(userClass.typeParameters.map((t) => t.name))
|
||||
..parentTypeName = userClass.name
|
||||
..publicTypeName = publicTypeName
|
||||
..widgetName = getClassName(userClass)
|
||||
..isAnimated = getWidgetIsAnimated(userClass)
|
||||
..allowTap = getAllowTap(userClass)
|
||||
..animatedDurationMilliseconds = getAnimationDuration(userClass);
|
||||
}
|
||||
|
||||
StoreTemplate _storeTemplate;
|
||||
DartType className;
|
||||
Map<String, DartType> fields = {};
|
||||
Map<String, dynamic> metaData = {};
|
||||
LibraryScopedNameFinder typeNameFinder;
|
||||
|
||||
final StoreClassCodegenErrors _errors;
|
||||
|
||||
String get source {
|
||||
if (_errors.hasErrors) {
|
||||
log.severe(_errors.message);
|
||||
return '';
|
||||
}
|
||||
return _storeTemplate.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
visitConstructorElement(ConstructorElement element) {
|
||||
className = element.type.returnType;
|
||||
return super.visitConstructorElement(element);
|
||||
}
|
||||
|
||||
@override
|
||||
void visitClassElement(ClassElement element) {
|
||||
if (isWidgetClass(element) || isPropertyClass(element)) {
|
||||
_errors.nonAbstractStoreMixinDeclarations
|
||||
.addIf(!element.isAbstract, element.name);
|
||||
}
|
||||
// if the class is annotated to generate toString() method we add the information to the _storeTemplate
|
||||
// _storeTemplate.generateToString = hasGeneratedToString(element);
|
||||
}
|
||||
|
||||
@override
|
||||
void visitFieldElement(FieldElement element) {
|
||||
fields[element.name] = element.type;
|
||||
metaData[element.name] = element.metadata;
|
||||
if (_fieldIsNotValid(element)) {
|
||||
return;
|
||||
}
|
||||
final _enumKey = const TypeChecker.fromRuntime(EnumKey);
|
||||
if (_enumKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _enumKey.firstAnnotationOfExact(element);
|
||||
final template = EnumOptionTemplate()
|
||||
..defaultValue = annotation.getField('defaultValue').toStringValue()
|
||||
..key = annotation.getField('key').toStringValue()
|
||||
..values = annotation
|
||||
.getField('values')
|
||||
.toListValue()
|
||||
.map((e) => e.toStringValue())
|
||||
.toList()
|
||||
..isPrivate = element.isPrivate
|
||||
..propertyType =
|
||||
annotation?.getField('propertyType')?.toStringValue() ??
|
||||
element.type.toString()
|
||||
..name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'Color') {
|
||||
final template = ColorOptionTemplate();
|
||||
final _colorKey = const TypeChecker.fromRuntime(ColorKey);
|
||||
if (_colorKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _colorKey.firstAnnotationOfExact(element);
|
||||
template.defaultValue =
|
||||
annotation.getField('defaultValue').toIntValue();
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
final _supportedKey = const TypeChecker.fromRuntime(SupportedKey);
|
||||
if (_supportedKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final template = SupportedOptionTemplate();
|
||||
final annotation = _supportedKey.firstAnnotationOfExact(element);
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'Widget') {
|
||||
final template = WidgetOptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(WidgetKey);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.fallback = annotation.getField('defaultValue').toStringValue();
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
template.acceptType = annotation.getField('acceptType').toStringValue();
|
||||
template.acceptWidth =
|
||||
annotation.getField('acceptWidth').toDoubleValue();
|
||||
template.acceptHeight =
|
||||
annotation.getField('acceptHeight').toDoubleValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'Matrix4') {
|
||||
final template = Matrix4OptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(Matrix4Key);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'EdgeInsets') {
|
||||
final template = EdgeInsetsOptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(EdgeInsetsKey);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
template.defaultValue =
|
||||
annotation.getField('defaultValue').toDoubleValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'Offset') {
|
||||
final template = OffsetOptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(OffsetKey);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'Size') {
|
||||
final template = SizeOptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(SizeKey);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString().contains('List')) {
|
||||
final template = ListWidgetOptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(ListWidgetKey);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.fallback = annotation.getField('fallback').toStringValue();
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
template.empty = annotation.getField('empty').toBoolValue();
|
||||
template.acceptType = annotation.getField('acceptType').toStringValue();
|
||||
}
|
||||
template.acceptType ??= 'WidgetBaseData';
|
||||
template.empty ??= true;
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'Function') {
|
||||
final template = FunctionOptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(FunctionKey);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.defaultValue = annotation.getField('fallback').toStringValue();
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.type.toString() == 'Key') {
|
||||
final template = KeyOptionTemplate();
|
||||
final _widgetKey = const TypeChecker.fromRuntime(TreeKey);
|
||||
if (_widgetKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _widgetKey.firstAnnotationOfExact(element);
|
||||
template.defaultValue =
|
||||
annotation.getField('defaultValue').toStringValue();
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
const _ignoreFields = [
|
||||
'widgetData',
|
||||
'widgetContext',
|
||||
'widgetRender',
|
||||
];
|
||||
if (_ignoreFields.contains(element.name)) {
|
||||
return;
|
||||
}
|
||||
const _allowedTypes = [
|
||||
'double',
|
||||
'int',
|
||||
'num',
|
||||
'String',
|
||||
'bool',
|
||||
'Object',
|
||||
];
|
||||
if (!_allowedTypes.contains(element.type.toString())) {
|
||||
print('Not Implemented -> ${element.type}');
|
||||
return;
|
||||
}
|
||||
final template = BaseOptionTemplate();
|
||||
final _baseKey = const TypeChecker.fromRuntime(PropertyKey);
|
||||
if (_baseKey.hasAnnotationOfExact(element, throwOnUnresolved: false)) {
|
||||
final annotation = _baseKey.firstAnnotationOfExact(element);
|
||||
template.defaultValue =
|
||||
annotation.getField('defaultValue').toStringValue();
|
||||
template.key = annotation.getField('key').toStringValue();
|
||||
template.tryParse = annotation.getField('tryParse').toBoolValue();
|
||||
} else {
|
||||
template.tryParse = false;
|
||||
}
|
||||
template.isPrivate = element.isPrivate;
|
||||
template.propertyType = element.type.toString();
|
||||
template.name = element.name;
|
||||
_storeTemplate.settings.add(template);
|
||||
return;
|
||||
}
|
||||
|
||||
bool _fieldIsNotValid(FieldElement element) => _any([
|
||||
_errors.staticObservables.addIf(element.isStatic, element.name),
|
||||
// _errors.finalObservables.addIf(element.isFinal, element.name)
|
||||
]);
|
||||
}
|
||||
|
||||
const _widgetChecker = TypeChecker.fromRuntime(WidgetClass);
|
||||
const _propertyChecker = TypeChecker.fromRuntime(PropertyClass);
|
||||
|
||||
// Checks if the class as a toString annotation
|
||||
bool isWidgetClass(ClassElement classElement) =>
|
||||
_widgetChecker.hasAnnotationOfExact(classElement);
|
||||
bool isPropertyClass(ClassElement classElement) =>
|
||||
_propertyChecker.hasAnnotationOfExact(classElement);
|
||||
|
||||
String getClassName(ClassElement classElement) {
|
||||
if (isWidgetClass(classElement)) {
|
||||
final annotation = _widgetChecker.firstAnnotationOfExact(classElement);
|
||||
return annotation.getField('name').toStringValue();
|
||||
}
|
||||
if (isPropertyClass(classElement)) {
|
||||
final annotation = _propertyChecker.firstAnnotationOfExact(classElement);
|
||||
return annotation.getField('name').toStringValue();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
bool getWidgetIsAnimated(ClassElement classElement) {
|
||||
if (isWidgetClass(classElement)) {
|
||||
final annotation = _widgetChecker.firstAnnotationOfExact(classElement);
|
||||
return annotation.getField('animated').toBoolValue();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int getAnimationDuration(ClassElement classElement) {
|
||||
if (isWidgetClass(classElement)) {
|
||||
final annotation = _widgetChecker.firstAnnotationOfExact(classElement);
|
||||
return annotation.getField('durationMilliseconds').toIntValue();
|
||||
}
|
||||
return 250;
|
||||
}
|
||||
|
||||
double getPreferredHeight(ClassElement classElement) {
|
||||
if (isWidgetClass(classElement)) {
|
||||
final annotation = _widgetChecker.firstAnnotationOfExact(classElement);
|
||||
return annotation.getField('preferredHeight').toDoubleValue();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
double getPreferredWidth(ClassElement classElement) {
|
||||
if (isWidgetClass(classElement)) {
|
||||
final annotation = _widgetChecker.firstAnnotationOfExact(classElement);
|
||||
return annotation.getField('preferredWidth').toDoubleValue();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
bool getAllowTap(ClassElement classElement) {
|
||||
if (isWidgetClass(classElement)) {
|
||||
final annotation = _widgetChecker.firstAnnotationOfExact(classElement);
|
||||
return annotation.getField('allowTap').toBoolValue();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool _any(List<bool> list) => list.any(_identity);
|
||||
|
||||
T _identity<T>(T value) => value;
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'util.dart';
|
||||
|
||||
class CommaList<T> {
|
||||
CommaList(this.templates) : assert(templates != null);
|
||||
|
||||
final List<T> templates;
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
templates.map((t) => t.toString()).where((s) => s.isNotEmpty).join(', ');
|
||||
}
|
||||
|
||||
class SurroundedCommaList<T> {
|
||||
SurroundedCommaList(this.prefix, this.suffix, this.templates)
|
||||
: assert(prefix != null),
|
||||
assert(suffix != null),
|
||||
assert(templates != null);
|
||||
|
||||
final String prefix;
|
||||
final String suffix;
|
||||
final List<T> templates;
|
||||
|
||||
@override
|
||||
String toString() => surroundNonEmpty(prefix, suffix, CommaList(templates));
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
class ParamTemplate {
|
||||
String name;
|
||||
String type;
|
||||
String defaultValue;
|
||||
bool hasRequiredAnnotation = false;
|
||||
|
||||
String get asArgument => name;
|
||||
|
||||
NamedArgTemplate get asNamedArgument => NamedArgTemplate()..name = name;
|
||||
|
||||
String get metadata => hasRequiredAnnotation ? '@required ' : '';
|
||||
|
||||
@override
|
||||
String toString() => defaultValue == null
|
||||
? '$metadata$type $name'
|
||||
: '$type $name = $defaultValue';
|
||||
}
|
||||
|
||||
class TypeParamTemplate {
|
||||
String name;
|
||||
String bound;
|
||||
|
||||
String get asArgument => name;
|
||||
|
||||
@override
|
||||
String toString() => bound == null ? name : '$name extends $bound';
|
||||
}
|
||||
|
||||
class NamedArgTemplate {
|
||||
String name;
|
||||
|
||||
@override
|
||||
String toString() => '$name: $name';
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class BaseOptionTemplate extends SettingsImpl {
|
||||
String defaultValue;
|
||||
bool isPrivate;
|
||||
bool tryParse;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.write('return ');
|
||||
if (tryParse) {
|
||||
sb.write("$propertyType.tryParse(params[${name}Key].toString())");
|
||||
if (defaultValue != null) {
|
||||
sb.write(' ?? $defaultValue');
|
||||
}
|
||||
} else {
|
||||
sb.write('params[${name}Key] as $propertyType');
|
||||
}
|
||||
sb.writeln(';');
|
||||
sb.writeln('}');
|
||||
if (defaultValue != null) {
|
||||
if (propertyType == 'String') {
|
||||
sb.writeln("return '$defaultValue';");
|
||||
} else {
|
||||
sb.writeln("return $defaultValue;");
|
||||
}
|
||||
} else {
|
||||
sb.writeln("return null;");
|
||||
}
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.writeln('params[${name}Key] = val;');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class ColorOptionTemplate extends SettingsImpl {
|
||||
int defaultValue;
|
||||
bool isPrivate;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
// Getter
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.writeln('int _value = $defaultValue;');
|
||||
sb.write("""
|
||||
String description = params[${name}Key].toString();
|
||||
if (description.startsWith('#')) {
|
||||
description = description.replaceAll('#$propertyType(', '').replaceAll(')', '');
|
||||
_value = int.tryParse(description);
|
||||
} else if (params[${name}Key] is Map) {
|
||||
if (params[${name}Key]['name'] == '$propertyType'
|
||||
&& params[${name}Key]['params'] != null
|
||||
&& params[${name}Key]['params']['0'] != null) {
|
||||
_value = int.tryParse(params[${name}Key]['params']['0']);
|
||||
}
|
||||
}
|
||||
""");
|
||||
sb.writeln('if (_value != null) {');
|
||||
sb.write('return $propertyType(_value);');
|
||||
sb.writeln('}');
|
||||
sb.writeln('}');
|
||||
if (defaultValue != null) {
|
||||
sb.writeln("return $propertyType($defaultValue);");
|
||||
} else {
|
||||
sb.writeln("return null;");
|
||||
}
|
||||
sb.writeln('}');
|
||||
// Setter
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.write('params[${name}Key] = "');
|
||||
sb.write('#$propertyType(\${val.value})');
|
||||
sb.writeln('";');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class EdgeInsetsOptionTemplate extends SettingsImpl {
|
||||
bool isPrivate;
|
||||
double defaultValue;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.writeln("""
|
||||
EdgeInsets _spacing = EdgeInsets.all(0.0);
|
||||
if (params[${name}Key] != null) {
|
||||
double top = 0;
|
||||
double bottom = 0;
|
||||
double left = 0;
|
||||
double right = 0;
|
||||
Map<String, dynamic> _spacingParams = params[${name}Key]['params'];
|
||||
top = _spacingParams['top'] ?? 0;
|
||||
bottom = _spacingParams['bottom'] ?? 0;
|
||||
left = _spacingParams['left'] ?? 0;
|
||||
right = _spacingParams['right'] ?? 0;
|
||||
_spacing = EdgeInsets.fromLTRB(left, top, right, bottom);
|
||||
}
|
||||
return _spacing;
|
||||
""");
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.write('''
|
||||
params[${name}Key] = {
|
||||
"name" : "EdgeInsets.only",
|
||||
"id" : "${name}KeyEdgeInsets",
|
||||
"params" : {
|
||||
"top" : val.top,
|
||||
"bottom" : val.bottom,
|
||||
"left" : val.left,
|
||||
"right" : val.right,
|
||||
}
|
||||
};
|
||||
''');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class EnumOptionTemplate extends SettingsImpl {
|
||||
String defaultValue;
|
||||
bool isPrivate;
|
||||
List values;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln("List<$propertyType> get ${name}Values => [");
|
||||
for (final item in values) {
|
||||
sb.writeln("${_getEnumValueFromString(item)},");
|
||||
}
|
||||
sb.writeln("];");
|
||||
sb.writeln('');
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.write('final _value = ');
|
||||
sb.writeln("params[${name}Key].toString().replaceAll('#', '');");
|
||||
final _fallback =
|
||||
defaultValue == null ? null : _getEnumValueFromString(defaultValue);
|
||||
sb.writeln("""
|
||||
return ${name}Values.firstWhere(
|
||||
(element) => element.toString() == _value,
|
||||
orElse: () => $_fallback,
|
||||
)
|
||||
""");
|
||||
sb.writeln(';');
|
||||
sb.writeln('}');
|
||||
sb.writeln("return $_fallback;");
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.writeln('params[${name}Key] = "\$val";');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
String _getEnumValueFromString(item) {
|
||||
if (item == null) return '';
|
||||
String description = item.toString().replaceAll('#', '');
|
||||
// if (!description.contains('(')) {
|
||||
// return "$propertyType." + describeEnum(item);
|
||||
// }
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
||||
T getEnum<T>(String val, {T fallback, List<T> values}) {
|
||||
if (val == null) return fallback;
|
||||
final _value = val.replaceAll('#', '');
|
||||
return values.firstWhere(
|
||||
(element) => element.toString() == _value,
|
||||
orElse: () => null,
|
||||
);
|
||||
}
|
||||
|
||||
String describeEnum(String enumEntry) {
|
||||
final String description = enumEntry.toString();
|
||||
if (!description.contains('.')) {
|
||||
return description;
|
||||
}
|
||||
final int indexOfDot = description.indexOf('.');
|
||||
assert(indexOfDot != -1 && indexOfDot < description.length - 1);
|
||||
return description.substring(indexOfDot + 1);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class FunctionOptionTemplate extends SettingsImpl {
|
||||
String defaultValue;
|
||||
bool isPrivate;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('String get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.write('return ');
|
||||
sb.write('params[${name}Key] as String');
|
||||
sb.writeln(';');
|
||||
sb.writeln('}');
|
||||
if (defaultValue != null) {
|
||||
sb.writeln("return $defaultValue;");
|
||||
} else {
|
||||
sb.writeln("return null;");
|
||||
}
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val(String val) {');
|
||||
sb.writeln('params[${name}Key] = val;');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
String constructor() {
|
||||
final sb = StringBuffer();
|
||||
sb.write(' ');
|
||||
if (key != null && int.tryParse(key) != null) {
|
||||
sb.write('');
|
||||
} else if (key != null) {
|
||||
sb.write("$key: ");
|
||||
} else {
|
||||
sb.write("$name: ");
|
||||
}
|
||||
sb.writeln("() => onAction(context, ${name}Val)");
|
||||
sb.writeln(',');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
abstract class SettingsImpl {
|
||||
@override
|
||||
String toString() {
|
||||
final sb = StringBuffer();
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
String access();
|
||||
|
||||
String constructor() {
|
||||
final sb = StringBuffer();
|
||||
sb.write(' ');
|
||||
if (key != null && int.tryParse(key) != null) {
|
||||
sb.write('${name}Val');
|
||||
} else if (key != null) {
|
||||
sb.write("$key: ${name}Val");
|
||||
} else {
|
||||
sb.write("$name: ${name}Val");
|
||||
}
|
||||
sb.writeln(',');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
String keyValue() {
|
||||
final sb = StringBuffer();
|
||||
sb.write(' ');
|
||||
sb.writeln("String ${name}Key = '${key ?? name}';");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
String get name;
|
||||
|
||||
String get key;
|
||||
|
||||
String get propertyType;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class KeyOptionTemplate extends SettingsImpl {
|
||||
String defaultValue;
|
||||
bool isPrivate;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.write("""
|
||||
String _val = params[${name}Key].toString();
|
||||
if (_val.startsWith('#')) {
|
||||
_val = _val.substring(1);
|
||||
if (_val.startsWith('ValueKey')) {
|
||||
_val = _val.replaceAll('ValueKey', '');
|
||||
_val = _val.replaceAll('<String>', '');
|
||||
_val = _val.replaceAll('(', '');
|
||||
_val = _val.replaceAll(')', '');
|
||||
}
|
||||
}
|
||||
return ValueKey('\$_val')
|
||||
""");
|
||||
sb.writeln(';');
|
||||
sb.writeln('}');
|
||||
if (defaultValue != null) {
|
||||
sb.writeln("return ValueKey<String>('$defaultValue');");
|
||||
} else {
|
||||
sb.writeln("return null;");
|
||||
}
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.write("""
|
||||
if (val == null) {
|
||||
params[${name}Key] = null;
|
||||
} else {
|
||||
params[${name}Key] = "#ValueKey('\$val')";
|
||||
}
|
||||
""");
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class ListWidgetOptionTemplate extends SettingsImpl {
|
||||
String fallback;
|
||||
bool isPrivate;
|
||||
bool empty;
|
||||
String acceptType;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('final _${name}Listen = ValueNotifier<bool>(false);');
|
||||
sb.writeln('List<WidgetBase> get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.write("""
|
||||
final _children = <WidgetBase>[];
|
||||
final _list = List.from(params[${name}Key]);
|
||||
for (final item in _list) {
|
||||
if (item is Map<String, dynamic>) {
|
||||
_children.add(widgetRender(widgetContext, item));
|
||||
}
|
||||
}
|
||||
return _children;
|
||||
""");
|
||||
sb.writeln('}');
|
||||
if (fallback != null) {
|
||||
final random = DateTime.now().millisecondsSinceEpoch.toString();
|
||||
sb.writeln("""
|
||||
return [
|
||||
widgetRender({
|
||||
'id': '$random',
|
||||
'name': '$fallback',
|
||||
'params': {},
|
||||
})
|
||||
];
|
||||
""");
|
||||
} else {
|
||||
sb.writeln("return null;");
|
||||
}
|
||||
sb.writeln('}');
|
||||
sb.writeln('void ${name}ValUpdate(Map<String, dynamic> val) {');
|
||||
sb.write("""
|
||||
if (params[${name}Key] == null) {
|
||||
params[${name}Key] = [];
|
||||
}
|
||||
params[${name}Key].add(val);
|
||||
""");
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
String constructor() {
|
||||
final sb = StringBuffer();
|
||||
sb.write(' ');
|
||||
if (key != null && int.tryParse(key) != null) {
|
||||
sb.write('');
|
||||
} else if (key != null) {
|
||||
sb.write("$key: ");
|
||||
} else {
|
||||
sb.write("$name: ");
|
||||
}
|
||||
sb.write("""
|
||||
${name}Val == null && !widgetContext.isDragging ? ${empty ? '[]' : 'null'} : [
|
||||
if (${name}Val != null)
|
||||
for (final item in ${name}Val) item.build(context),
|
||||
""");
|
||||
if (acceptType != null && acceptType.isNotEmpty) {
|
||||
sb.write("""
|
||||
if (widgetContext.isDragging)
|
||||
DragTarget<$acceptType>(
|
||||
onAccept: (val) {
|
||||
_${name}Listen.value = false;
|
||||
if (val != null) {
|
||||
${name}ValUpdate(val?.data);
|
||||
}
|
||||
},
|
||||
onLeave: (val) {
|
||||
_${name}Listen.value = false;
|
||||
},
|
||||
onWillAccept: (val) {
|
||||
_${name}Listen.value = true;
|
||||
return _${name}Listen.value;
|
||||
},
|
||||
builder: (context, accepted, rejected) {
|
||||
return ValueListenableBuilder<bool>(
|
||||
valueListenable: _${name}Listen,
|
||||
builder: (context, _accepting, child) => SizedBox.fromSize(
|
||||
size: Size(${30}, ${30}),
|
||||
child: Placeholder(
|
||||
color: !_accepting ?
|
||||
Colors.grey :
|
||||
Theme.of(context).accentColor,
|
||||
),
|
||||
));
|
||||
},
|
||||
),
|
||||
""");
|
||||
}
|
||||
sb.writeln('],');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class Matrix4OptionTemplate extends SettingsImpl {
|
||||
bool isPrivate;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.writeln("""
|
||||
final _matrix = Matrix4.identity();
|
||||
if (params[${name}Key] != null) {
|
||||
if (params[${name}Key] is List) {
|
||||
final values = List.from(params[${name}Key]);
|
||||
_matrix.setValues(
|
||||
values[0],
|
||||
values[1],
|
||||
values[2],
|
||||
values[3],
|
||||
values[4],
|
||||
values[5],
|
||||
values[6],
|
||||
values[7],
|
||||
values[8],
|
||||
values[9],
|
||||
values[10],
|
||||
values[11],
|
||||
values[12],
|
||||
values[13],
|
||||
values[14],
|
||||
values[15],
|
||||
);
|
||||
} else if (params[${name}Key] is String) {
|
||||
final description = params[${name}Key].toString();
|
||||
final _entryMatches = 'setEntry('.allMatches(description).toList();
|
||||
final _rotateXMatches = 'rotateX('.allMatches(description).toList();
|
||||
final _rotateYMatches = 'rotateY('.allMatches(description).toList();
|
||||
final _rotateZMatches = 'rotateZ('.allMatches(description).toList();
|
||||
for (final idx in _entryMatches) {
|
||||
int start = idx.end;
|
||||
int end = description.indexOf(')', start);
|
||||
final _values = description
|
||||
.substring(start, end)
|
||||
.split(',')
|
||||
.map((e) => num.tryParse(e.trim()))
|
||||
.toList();
|
||||
_matrix.setEntry(
|
||||
_values[0].toInt(),
|
||||
_values[1].toInt(),
|
||||
_values[2].toDouble(),
|
||||
);
|
||||
}
|
||||
for (final idx in _rotateXMatches) {
|
||||
int start = idx.end;
|
||||
int end = description.indexOf(')', start);
|
||||
final _value = num.tryParse(description.substring(start, end).trim());
|
||||
_matrix.rotateX(_value.toDouble());
|
||||
}
|
||||
for (final idx in _rotateYMatches) {
|
||||
int start = idx.end;
|
||||
int end = description.indexOf(')', start);
|
||||
final _value = num.tryParse(description.substring(start, end).trim());
|
||||
_matrix.rotateY(_value.toDouble());
|
||||
}
|
||||
for (final idx in _rotateZMatches) {
|
||||
int start = idx.end;
|
||||
int end = description.indexOf(')', start);
|
||||
final _value = num.tryParse(description.substring(start, end).trim());
|
||||
_matrix.rotateZ(_value.toDouble());
|
||||
}
|
||||
}
|
||||
}
|
||||
return _matrix;
|
||||
""");
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.writeln('params[${name}Key] = val.storage.toList();');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class OffsetOptionTemplate extends SettingsImpl {
|
||||
bool isPrivate;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.writeln("""
|
||||
Offset _offset = Offset(0.0, 0.0);
|
||||
if (params[${name}Key] != null) {
|
||||
double dx = 0;
|
||||
double dy = 0;
|
||||
Map<String, dynamic> _offsetParams = params[${name}Key]['params'];
|
||||
dx = _offsetParams['0'] ?? 0;
|
||||
dy = _offsetParams['1'] ?? 0;
|
||||
_offset = Offset(dx, dy);
|
||||
}
|
||||
return _offset;
|
||||
""");
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.write('''
|
||||
params[${name}Key] = {
|
||||
"name" : "Offset",
|
||||
"id" : "${name}KeyOffset",
|
||||
"params" : {
|
||||
"0" : val.dx,
|
||||
"1" : val.dy,
|
||||
}
|
||||
};
|
||||
''');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class SizeOptionTemplate extends SettingsImpl {
|
||||
bool isPrivate;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.writeln("""
|
||||
Size _size = Size(0.0, 0.0);
|
||||
if (params[${name}Key] != null) {
|
||||
double width = 0;
|
||||
double height = 0;
|
||||
Map<String, dynamic> _sizeParams = params[${name}Key]['params'];
|
||||
width = _sizeParams['0'] ?? 0;
|
||||
height = _sizeParams['1'] ?? 0;
|
||||
_size = Size(width, height);
|
||||
}
|
||||
return _size;
|
||||
""");
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.write('''
|
||||
params[${name}Key] = {
|
||||
"name" : "Size",
|
||||
"id" : "${name}KeySize",
|
||||
"params" : {
|
||||
"0" : val.width,
|
||||
"1" : val.height,
|
||||
}
|
||||
};
|
||||
''');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'impl.dart';
|
||||
|
||||
class SupportedOptionTemplate extends SettingsImpl {
|
||||
bool isPrivate;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('$propertyType get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.write('return ');
|
||||
sb.write('$propertyType(params[${name}Key], widgetContext, widgetRender)');
|
||||
sb.writeln(';');
|
||||
sb.writeln('}');
|
||||
sb.writeln("return null;");
|
||||
sb.writeln('}');
|
||||
sb.writeln('set ${name}Val($propertyType val) {');
|
||||
sb.writeln('params[${name}Key] = val;');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
String constructor() {
|
||||
final sb = StringBuffer();
|
||||
sb.write(' ');
|
||||
if (key != null && int.tryParse(key) != null) {
|
||||
sb.write('');
|
||||
} else if (key != null) {
|
||||
sb.write("$key: ");
|
||||
} else {
|
||||
sb.write("$name: ");
|
||||
}
|
||||
sb.writeln("${name}Val?.build(context)");
|
||||
sb.writeln(',');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import 'impl.dart';
|
||||
|
||||
import 'package:shortid/shortid.dart';
|
||||
|
||||
class WidgetOptionTemplate extends SettingsImpl {
|
||||
String fallback;
|
||||
bool isPrivate;
|
||||
String acceptType;
|
||||
double acceptWidth;
|
||||
double acceptHeight;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
String key;
|
||||
|
||||
@override
|
||||
String propertyType;
|
||||
|
||||
@override
|
||||
String access() {
|
||||
final sb = StringBuffer();
|
||||
if (acceptType != null) {
|
||||
sb.writeln('final _${name}Listen = ValueNotifier<bool>(false);');
|
||||
}
|
||||
sb.writeln('WidgetBase get ${name}Val {');
|
||||
sb.write("if (params[${name}Key] != null) ");
|
||||
sb.writeln('{');
|
||||
sb.write('return ');
|
||||
sb.write('widgetRender(widgetContext, params[${name}Key])');
|
||||
sb.writeln(';');
|
||||
sb.writeln('}');
|
||||
sb.writeln("return null;");
|
||||
sb.writeln('}');
|
||||
sb.writeln('void ${name}ValUpdate(Map<String, dynamic> val) {');
|
||||
sb.write("""
|
||||
final _data = val;
|
||||
_data['id'] = '${shortid.generate()}';
|
||||
if (_data['name'] == 'Text') {
|
||||
_data['params']['style']['id'] = '${shortid.generate()}';
|
||||
}
|
||||
if (_data['name'] == 'Icon') {
|
||||
_data['params']['0']['id'] = '${shortid.generate()}';
|
||||
}
|
||||
""");
|
||||
sb.writeln('params[${name}Key] = _data;');
|
||||
sb.writeln('widgetContext.onUpdate(id, widgetData);');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
String constructor() {
|
||||
final sb = StringBuffer();
|
||||
sb.write(' ');
|
||||
if (key != null && int.tryParse(key) != null) {
|
||||
sb.write('');
|
||||
} else if (key != null) {
|
||||
sb.write("$key: ");
|
||||
} else {
|
||||
sb.write("$name: ");
|
||||
}
|
||||
if (acceptType == null) {
|
||||
sb.writeln('${name}Val?.build(context)');
|
||||
} else {
|
||||
sb.write("""
|
||||
!widgetContext.isDragging || (widgetContext.isDragging && ${name}Val?.build(context) != null) ?
|
||||
(
|
||||
${name}Val?.build(context)
|
||||
|
||||
""");
|
||||
if (fallback != null) {
|
||||
sb.write("""
|
||||
?? (widgetRender(widgetContext, json.decode(json.encode({
|
||||
'id': '${shortid.generate()}',
|
||||
'name': '$fallback',
|
||||
'params': {},
|
||||
})))).build(context)
|
||||
""");
|
||||
}
|
||||
sb.write("""
|
||||
)
|
||||
""");
|
||||
sb.write("""
|
||||
:
|
||||
PreferredSize(
|
||||
preferredSize: Size(${acceptWidth ?? 30}, ${acceptHeight ?? 30}),
|
||||
child: DragTarget<$acceptType>(
|
||||
onAccept: (val) {
|
||||
_${name}Listen.value = false;
|
||||
if (val != null) {
|
||||
${name}ValUpdate(val?.data);
|
||||
}
|
||||
},
|
||||
onLeave: (val) {
|
||||
_${name}Listen.value = false;
|
||||
},
|
||||
onWillAccept: (val) {
|
||||
_${name}Listen.value = true;
|
||||
return _${name}Listen.value;
|
||||
},
|
||||
builder: (context, accepted, rejected) {
|
||||
return ValueListenableBuilder<bool>(
|
||||
valueListenable: _${name}Listen,
|
||||
builder: (context, _accepting, child) => SizedBox.fromSize(
|
||||
size: Size(${acceptWidth ?? 30}, ${acceptHeight ?? 30}),
|
||||
child: Placeholder(
|
||||
color: !_accepting ?
|
||||
Colors.grey :
|
||||
Theme.of(context).accentColor,
|
||||
),
|
||||
));
|
||||
},
|
||||
),
|
||||
)
|
||||
""");
|
||||
}
|
||||
sb.writeln(',');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Rows<T> {
|
||||
final List<T> _templates = [];
|
||||
|
||||
void add(T template) => _templates.add(template);
|
||||
|
||||
bool get isEmpty => _templates.isEmpty;
|
||||
List get templates => _templates;
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
_templates.map((t) => t.toString()).where((s) => s.isNotEmpty).join('\n');
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
const _analyzerIgnores =
|
||||
'// ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic, avoid_init_to_null';
|
||||
|
||||
class StoreFileTemplate {
|
||||
Iterable<String> storeSources;
|
||||
|
||||
@override
|
||||
String toString() => storeSources.isEmpty
|
||||
? ''
|
||||
: '''
|
||||
$_analyzerIgnores
|
||||
|
||||
${storeSources.join('\n\n')}
|
||||
''';
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
import '../type_names.dart';
|
||||
import 'params.dart';
|
||||
|
||||
// ignore: avoid_annotating_with_dynamic
|
||||
String surroundNonEmpty(String prefix, String suffix, dynamic content) {
|
||||
final contentStr = content.toString();
|
||||
return contentStr.isEmpty ? '' : '$prefix$contentStr$suffix';
|
||||
}
|
||||
|
||||
const _streamChecker = TypeChecker.fromRuntime(Stream);
|
||||
|
||||
class AsyncMethodChecker {
|
||||
AsyncMethodChecker([TypeChecker checkStream]) {
|
||||
_checkStream = checkStream ?? _streamChecker;
|
||||
}
|
||||
|
||||
TypeChecker _checkStream;
|
||||
|
||||
bool returnsFuture(MethodElement method) =>
|
||||
method.returnType.isDartAsyncFuture ||
|
||||
(method.isAsynchronous &&
|
||||
!method.isGenerator &&
|
||||
method.returnType.isDynamic);
|
||||
|
||||
bool returnsStream(MethodElement method) =>
|
||||
_checkStream.isAssignableFromType(method.returnType) ||
|
||||
(method.isAsynchronous &&
|
||||
method.isGenerator &&
|
||||
method.returnType.isDynamic);
|
||||
}
|
||||
|
||||
TypeParamTemplate typeParamTemplate(
|
||||
TypeParameterElement param,
|
||||
LibraryScopedNameFinder typeNameFinder,
|
||||
) =>
|
||||
TypeParamTemplate()
|
||||
..name = param.name
|
||||
..bound = param.bound != null
|
||||
? typeNameFinder.findTypeParameterBoundsTypeName(param)
|
||||
: null;
|
||||
@@ -0,0 +1,106 @@
|
||||
import 'comma_list.dart';
|
||||
import 'params.dart';
|
||||
import 'properties/impl.dart';
|
||||
|
||||
class MixinStoreTemplate extends StoreTemplate {
|
||||
final String extendsClass;
|
||||
double width, height;
|
||||
|
||||
MixinStoreTemplate(this.extendsClass);
|
||||
String get typeName => '_\$$publicTypeName';
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
final sb = StringBuffer();
|
||||
sb.writeln('abstract class $typeName$typeParams extends $extendsClass {');
|
||||
for (final setting in settings) {
|
||||
sb.write(setting.keyValue());
|
||||
}
|
||||
sb.writeln('');
|
||||
final _hasPreferredSize = width != null || height != null;
|
||||
if (_hasPreferredSize) {
|
||||
sb.writeln('@override');
|
||||
sb.write('Size get preferredSize => ');
|
||||
if (width != null && height != null) {
|
||||
sb.write('Size($width, $height)');
|
||||
} else if (width != null) {
|
||||
sb.write('Size.fromWidth($width)');
|
||||
} else if (height != null) {
|
||||
sb.write('Size.fromHeight($height)');
|
||||
}
|
||||
sb.writeln(';');
|
||||
}
|
||||
sb.writeln('');
|
||||
sb.writeln('@override');
|
||||
sb.writeln('Map<String, String> get properties => {');
|
||||
for (final setting in settings) {
|
||||
sb.write("'${setting?.key ?? setting.name}'");
|
||||
sb.write(':');
|
||||
sb.write("'${setting.propertyType}'");
|
||||
sb.writeln(',');
|
||||
}
|
||||
sb.writeln('};');
|
||||
sb.writeln('');
|
||||
for (final setting in settings) {
|
||||
sb.writeln(setting.access());
|
||||
}
|
||||
sb.writeln('');
|
||||
sb.writeln('@override');
|
||||
sb.writeln('Object build(BuildContext context) {');
|
||||
sb.write(' return ');
|
||||
if (allowTap) {
|
||||
if (_hasPreferredSize) {
|
||||
sb.writeln('PreferredSize(');
|
||||
sb.writeln('preferredSize: preferredSize,');
|
||||
sb.writeln('child: ');
|
||||
}
|
||||
sb.writeln('GestureDetector(');
|
||||
sb.writeln("onTap: () => widgetContext.onTap(id, widgetData),");
|
||||
sb.writeln('child: ');
|
||||
}
|
||||
if (isAnimated) {
|
||||
sb.write('Animated');
|
||||
}
|
||||
sb.writeln('$widgetName(');
|
||||
settings.sort((a, b) => (a?.key ?? a.name).compareTo((b?.key ?? b.name)));
|
||||
if (isAnimated) {
|
||||
sb.writeln(
|
||||
'duration: const Duration(milliseconds: $animatedDurationMilliseconds),');
|
||||
}
|
||||
for (final setting in settings) {
|
||||
sb.writeln(setting.constructor());
|
||||
}
|
||||
sb.writeln(')');
|
||||
if (allowTap) {
|
||||
if (_hasPreferredSize) {
|
||||
sb.write(',');
|
||||
sb.writeln(')');
|
||||
}
|
||||
sb.write(',');
|
||||
sb.writeln(')');
|
||||
}
|
||||
sb.write(';');
|
||||
sb.writeln('}');
|
||||
sb.writeln('');
|
||||
sb.writeln('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class StoreTemplate {
|
||||
final SurroundedCommaList<TypeParamTemplate> typeParams =
|
||||
SurroundedCommaList('<', '>', []);
|
||||
final SurroundedCommaList<String> typeArgs =
|
||||
SurroundedCommaList('<', '>', []);
|
||||
String publicTypeName;
|
||||
String parentTypeName;
|
||||
String widgetName;
|
||||
bool isAnimated;
|
||||
int animatedDurationMilliseconds;
|
||||
bool allowTap;
|
||||
|
||||
final List<SettingsImpl> settings = [];
|
||||
|
||||
@override
|
||||
String toString();
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
|
||||
import 'template/comma_list.dart';
|
||||
|
||||
/// Determines the names of types within the context of a library, determining
|
||||
/// prefixes if applicable.
|
||||
///
|
||||
/// For example, if a library has been imported with a name, references to types
|
||||
/// contained or exported by that library must be prefixed by that name.
|
||||
///
|
||||
/// ```dart
|
||||
/// import 'dart:io' as io;
|
||||
///
|
||||
/// io.File someFile;
|
||||
/// ```
|
||||
///
|
||||
/// If we had a reference to `someFile`'s [Element], [findVariableTypeName]
|
||||
/// would return `"io.File"`.
|
||||
class LibraryScopedNameFinder {
|
||||
LibraryScopedNameFinder(this.library);
|
||||
|
||||
final LibraryElement library;
|
||||
|
||||
Map<Element, String> _namesByElement;
|
||||
Map<Element, String> get namesByElement {
|
||||
if (_namesByElement != null) {
|
||||
return _namesByElement;
|
||||
}
|
||||
|
||||
_namesByElement = {};
|
||||
|
||||
// Add all of this library's type-defining elements to the name map
|
||||
final libraryElements =
|
||||
library.topLevelElements.whereType<TypeDefiningElement>();
|
||||
for (final element in libraryElements) {
|
||||
_namesByElement[element] = element.name;
|
||||
}
|
||||
|
||||
// Reverse each import's export namespace so we can map elements to their
|
||||
// library-local names. Note that the definedNames include a prefix if there
|
||||
// is one.
|
||||
for (final import in library.imports) {
|
||||
for (final entry in import.namespace.definedNames.entries) {
|
||||
_namesByElement[entry.value] = entry.key;
|
||||
}
|
||||
}
|
||||
|
||||
return _namesByElement;
|
||||
}
|
||||
|
||||
String findVariableTypeName(VariableElement variable) =>
|
||||
_getDartTypeName(variable.type);
|
||||
|
||||
String findGetterTypeName(PropertyAccessorElement getter) {
|
||||
assert(getter.isGetter);
|
||||
return findReturnTypeName(getter);
|
||||
}
|
||||
|
||||
String findParameterTypeName(ParameterElement parameter) =>
|
||||
_getDartTypeName(parameter.type);
|
||||
|
||||
String findReturnTypeName(FunctionTypedElement executable) =>
|
||||
_getDartTypeName(executable.returnType);
|
||||
|
||||
List<String> findReturnTypeArgumentTypeNames(ExecutableElement executable) {
|
||||
final returnType = executable.returnType;
|
||||
return returnType is ParameterizedType
|
||||
? returnType.typeArguments.map(_getDartTypeName).toList()
|
||||
: [];
|
||||
}
|
||||
|
||||
String findTypeParameterBoundsTypeName(TypeParameterElement typeParameter) {
|
||||
assert(typeParameter.bound != null);
|
||||
return _getDartTypeName(typeParameter.bound);
|
||||
}
|
||||
|
||||
/// Calculates a type name, including its type arguments
|
||||
///
|
||||
/// The returned string will include import prefixes on all applicable types.
|
||||
String _getDartTypeName(DartType type) {
|
||||
var typeElement = type.element;
|
||||
if (type is FunctionType) {
|
||||
// If we're dealing with a typedef, we let it undergo the standard name
|
||||
// lookup. Otherwise, we special case the function naming.
|
||||
if (typeElement?.enclosingElement is GenericTypeAliasElement) {
|
||||
typeElement = typeElement.enclosingElement;
|
||||
} else {
|
||||
return _getFunctionTypeName(type);
|
||||
}
|
||||
} else if (
|
||||
// Some types don't have associated elements, like void
|
||||
typeElement == null ||
|
||||
// This is a bare type param, like "T"
|
||||
type is TypeParameterType) {
|
||||
// TODO(shyndman): This ignored deprecation can be removed when we
|
||||
// increase the analyzer dependency's lower bound to 0.39.2, and
|
||||
// migrate to using `DartType.getDisplayString`.
|
||||
// ignore: deprecated_member_use
|
||||
return type.displayName;
|
||||
}
|
||||
|
||||
return _getNamedElementTypeName(typeElement, type);
|
||||
}
|
||||
|
||||
String _getFunctionTypeName(FunctionType type) {
|
||||
final returnTypeName = _getDartTypeName(type.returnType);
|
||||
|
||||
final normalParameterTypeNames =
|
||||
CommaList(type.normalParameterTypes.map(_getDartTypeName).toList());
|
||||
final optionalParameterTypeNames = SurroundedCommaList(
|
||||
'[', ']', type.optionalParameterTypes.map(_getDartTypeName).toList());
|
||||
final namedParameterPairs = type.namedParameterTypes.entries
|
||||
.map((entry) => '${_getDartTypeName(entry.value)} ${entry.key}')
|
||||
.toList();
|
||||
final namedParameterTypeNames =
|
||||
SurroundedCommaList('{', '}', namedParameterPairs);
|
||||
|
||||
final parameterTypeNames = CommaList([
|
||||
normalParameterTypeNames,
|
||||
optionalParameterTypeNames,
|
||||
namedParameterTypeNames,
|
||||
]);
|
||||
|
||||
return '$returnTypeName Function($parameterTypeNames)';
|
||||
}
|
||||
|
||||
String _getNamedElementTypeName(Element typeElement, DartType type) {
|
||||
// Determine the name of the type, without type arguments.
|
||||
assert(namesByElement.containsKey(typeElement));
|
||||
|
||||
// If the type is parameterized, we recursively name its type arguments
|
||||
if (type is ParameterizedType && type.typeArguments.isNotEmpty) {
|
||||
final typeArgNames = SurroundedCommaList(
|
||||
'<', '>', type.typeArguments.map(_getDartTypeName).toList());
|
||||
return '${namesByElement[typeElement]}$typeArgNames';
|
||||
}
|
||||
|
||||
return namesByElement[typeElement];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export 'src/class_annotation_gen.dart';
|
||||
export 'widget_gen_annotations.dart';
|
||||
@@ -0,0 +1,184 @@
|
||||
/// Declares configuration of a SettingsStore class.
|
||||
/// Currently the only configuration used is boolean to indicate generation of toString method (true), or not (false)
|
||||
|
||||
class WidgetClass {
|
||||
const WidgetClass(
|
||||
this.name, {
|
||||
this.animated = false,
|
||||
this.durationMilliseconds = 250,
|
||||
this.preferredHeight,
|
||||
this.preferredWidth,
|
||||
this.allowTap = true,
|
||||
});
|
||||
|
||||
final bool allowTap;
|
||||
final bool animated;
|
||||
final int durationMilliseconds;
|
||||
final String name;
|
||||
final double preferredHeight;
|
||||
final double preferredWidth;
|
||||
}
|
||||
|
||||
class PropertyClass {
|
||||
const PropertyClass(this.name);
|
||||
|
||||
final String name;
|
||||
}
|
||||
|
||||
class PropertyKey {
|
||||
const PropertyKey({
|
||||
this.defaultValue,
|
||||
this.key,
|
||||
this.tryParse = false,
|
||||
});
|
||||
|
||||
final String defaultValue;
|
||||
final String key;
|
||||
final bool tryParse;
|
||||
}
|
||||
|
||||
class FunctionKey {
|
||||
const FunctionKey({
|
||||
this.defaultValue,
|
||||
this.key,
|
||||
});
|
||||
|
||||
final String defaultValue;
|
||||
final String key;
|
||||
}
|
||||
|
||||
class EnumKey {
|
||||
const EnumKey({
|
||||
this.propertyType,
|
||||
this.key,
|
||||
this.values,
|
||||
this.defaultValue,
|
||||
});
|
||||
|
||||
final String defaultValue;
|
||||
final String key;
|
||||
final String propertyType;
|
||||
final List<String> values;
|
||||
}
|
||||
|
||||
class ColorKey {
|
||||
const ColorKey({
|
||||
this.defaultValue,
|
||||
this.key,
|
||||
});
|
||||
|
||||
final int defaultValue;
|
||||
final String key;
|
||||
}
|
||||
|
||||
class SupportedKey {
|
||||
const SupportedKey({
|
||||
this.key,
|
||||
});
|
||||
|
||||
final String key;
|
||||
}
|
||||
|
||||
class WidgetKey {
|
||||
const WidgetKey({
|
||||
this.key,
|
||||
this.defaultValue,
|
||||
this.acceptType,
|
||||
this.acceptWidth,
|
||||
this.acceptHeight,
|
||||
});
|
||||
|
||||
const WidgetKey.sizedWidget({
|
||||
this.key,
|
||||
this.defaultValue,
|
||||
this.acceptWidth,
|
||||
this.acceptHeight,
|
||||
}) : acceptType = 'WidgetPreferredSizeBaseData';
|
||||
|
||||
const WidgetKey.widget({
|
||||
this.key,
|
||||
this.defaultValue,
|
||||
this.acceptWidth,
|
||||
this.acceptHeight,
|
||||
}) : acceptType = 'WidgetBaseData';
|
||||
|
||||
final double acceptHeight;
|
||||
final String acceptType;
|
||||
final double acceptWidth;
|
||||
final String defaultValue;
|
||||
final String key;
|
||||
}
|
||||
|
||||
class ListWidgetKey {
|
||||
const ListWidgetKey({
|
||||
this.key,
|
||||
this.fallback,
|
||||
this.empty = true,
|
||||
this.acceptType,
|
||||
});
|
||||
|
||||
const ListWidgetKey.widget({
|
||||
this.key,
|
||||
this.fallback,
|
||||
this.empty = true,
|
||||
}) : acceptType = 'WidgetBaseData';
|
||||
|
||||
final String acceptType;
|
||||
final bool empty;
|
||||
final String fallback;
|
||||
final String key;
|
||||
}
|
||||
|
||||
class TreeKey {
|
||||
const TreeKey({
|
||||
this.key,
|
||||
this.fallback,
|
||||
});
|
||||
|
||||
final String fallback;
|
||||
final String key;
|
||||
}
|
||||
|
||||
class Matrix4Key {
|
||||
const Matrix4Key({
|
||||
this.key,
|
||||
});
|
||||
|
||||
final String key;
|
||||
}
|
||||
|
||||
class EdgeInsetsKey {
|
||||
const EdgeInsetsKey({
|
||||
this.key,
|
||||
this.defaultValue = 0,
|
||||
});
|
||||
|
||||
final double defaultValue;
|
||||
final String key;
|
||||
}
|
||||
|
||||
class SizeKey {
|
||||
const SizeKey({
|
||||
this.key,
|
||||
});
|
||||
|
||||
final String key;
|
||||
}
|
||||
|
||||
class OffsetKey {
|
||||
const OffsetKey({
|
||||
this.key,
|
||||
});
|
||||
|
||||
final String key;
|
||||
}
|
||||
|
||||
class IconDataKey {
|
||||
const IconDataKey({
|
||||
this.defaultValue,
|
||||
this.key,
|
||||
});
|
||||
|
||||
final int defaultValue;
|
||||
final String key;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# Flutter-related
|
||||
**/Flutter/ephemeral/
|
||||
**/Pods/
|
||||
|
||||
# Xcode-related
|
||||
**/xcuserdata/
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||
@@ -0,0 +1,10 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
platform :osx, '10.11'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
project 'Runner', {
|
||||
'Debug' => :debug,
|
||||
'Profile' => :release,
|
||||
'Release' => :release,
|
||||
}
|
||||
|
||||
def parse_KV_file(file, separator='=')
|
||||
file_abs_path = File.expand_path(file)
|
||||
if !File.exists? file_abs_path
|
||||
return [];
|
||||
end
|
||||
pods_ary = []
|
||||
skip_line_start_symbols = ["#", "/"]
|
||||
File.foreach(file_abs_path) { |line|
|
||||
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
|
||||
plugin = line.split(pattern=separator)
|
||||
if plugin.length == 2
|
||||
podname = plugin[0].strip()
|
||||
path = plugin[1].strip()
|
||||
podpath = File.expand_path("#{path}", file_abs_path)
|
||||
pods_ary.push({:name => podname, :path => podpath});
|
||||
else
|
||||
puts "Invalid plugin specification: #{line}"
|
||||
end
|
||||
}
|
||||
return pods_ary
|
||||
end
|
||||
|
||||
def pubspec_supports_macos(file)
|
||||
file_abs_path = File.expand_path(file)
|
||||
if !File.exists? file_abs_path
|
||||
return false;
|
||||
end
|
||||
File.foreach(file_abs_path) { |line|
|
||||
return true if line =~ /^\s*macos:/
|
||||
}
|
||||
return false
|
||||
end
|
||||
|
||||
target 'Runner' do
|
||||
use_frameworks!
|
||||
use_modular_headers!
|
||||
|
||||
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
||||
# referring to absolute paths on developers' machines.
|
||||
ephemeral_dir = File.join('Flutter', 'ephemeral')
|
||||
symlink_dir = File.join(ephemeral_dir, '.symlinks')
|
||||
symlink_plugins_dir = File.join(symlink_dir, 'plugins')
|
||||
system("rm -rf #{symlink_dir}")
|
||||
system("mkdir -p #{symlink_plugins_dir}")
|
||||
|
||||
# Flutter Pods
|
||||
generated_xcconfig = parse_KV_file(File.join(ephemeral_dir, 'Flutter-Generated.xcconfig'))
|
||||
if generated_xcconfig.empty?
|
||||
puts "Flutter-Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
|
||||
end
|
||||
generated_xcconfig.map { |p|
|
||||
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
|
||||
symlink = File.join(symlink_dir, 'flutter')
|
||||
File.symlink(File.dirname(p[:path]), symlink)
|
||||
pod 'FlutterMacOS', :path => File.join(symlink, File.basename(p[:path]))
|
||||
end
|
||||
}
|
||||
|
||||
# Plugin Pods
|
||||
plugin_pods = parse_KV_file('../.flutter-plugins')
|
||||
plugin_pods.map { |p|
|
||||
symlink = File.join(symlink_plugins_dir, p[:name])
|
||||
File.symlink(p[:path], symlink)
|
||||
if pubspec_supports_macos(File.join(symlink, 'pubspec.yaml'))
|
||||
pod p[:name], :path => File.join(symlink, 'macos')
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
|
||||
install! 'cocoapods', :disable_input_output_paths => true
|
||||
@@ -0,0 +1,27 @@
|
||||
PODS:
|
||||
- FlutterMacOS (1.0.0)
|
||||
- url_launcher (0.0.1)
|
||||
- url_launcher_macos (0.0.1):
|
||||
- FlutterMacOS
|
||||
|
||||
DEPENDENCIES:
|
||||
- FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`)
|
||||
- url_launcher (from `Flutter/ephemeral/.symlinks/plugins/url_launcher/macos`)
|
||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
FlutterMacOS:
|
||||
:path: Flutter/ephemeral/.symlinks/flutter/darwin-x64
|
||||
url_launcher:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher/macos
|
||||
url_launcher_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9
|
||||
url_launcher: af78307ef9bafff91273b34f1c6c0c86a0004fd7
|
||||
url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4
|
||||
|
||||
PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7
|
||||
|
||||
COCOAPODS: 1.8.4
|
||||
@@ -0,0 +1,654 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 51;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXAggregateTarget section */
|
||||
33CC111A2044C6BA0003C045 /* Flutter Assemble */ = {
|
||||
isa = PBXAggregateTarget;
|
||||
buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */;
|
||||
buildPhases = (
|
||||
33CC111E2044C6BF0003C045 /* ShellScript */,
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Flutter Assemble";
|
||||
productName = FLX;
|
||||
};
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
|
||||
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
|
||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; };
|
||||
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
878EFE806DB830A76A72C371 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EC8737F55ED08CAC9DA66FC /* Pods_Runner.framework */; };
|
||||
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; };
|
||||
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 33CC111A2044C6BA0003C045;
|
||||
remoteInfo = FLX;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
33CC110E2044A8840003C045 /* Bundle Framework */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */,
|
||||
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */,
|
||||
);
|
||||
name = "Bundle Framework";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1648309BCE545AADC2CA0412 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
3265898D3E832CFC58FE2D96 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||
33CC10ED2044A3C60003C045 /* reflectable_flutter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = reflectable_flutter.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = "<group>"; };
|
||||
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = "<group>"; };
|
||||
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
|
||||
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
|
||||
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
|
||||
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; };
|
||||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||
3EC8737F55ED08CAC9DA66FC /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
515F05C5585FF1B083E9699B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||
D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
33CC10EA2044A3C60003C045 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
|
||||
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
|
||||
878EFE806DB830A76A72C371 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
33BA886A226E78AF003329D5 /* Configs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
333000ED22D3DE5D00554162 /* Warnings.xcconfig */,
|
||||
);
|
||||
path = Configs;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33CC10E42044A3C60003C045 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33FAB671232836740065AC1E /* Runner */,
|
||||
33CEB47122A05771004F2AC0 /* Flutter */,
|
||||
33CC10EE2044A3C60003C045 /* Products */,
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||
6AE307A1BF79F727F2A29F7C /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33CC10EE2044A3C60003C045 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33CC10ED2044A3C60003C045 /* reflectable_flutter.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33CC11242044D66E0003C045 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33CC10F22044A3C60003C045 /* Assets.xcassets */,
|
||||
33CC10F42044A3C60003C045 /* MainMenu.xib */,
|
||||
33CC10F72044A3C60003C045 /* Info.plist */,
|
||||
);
|
||||
name = Resources;
|
||||
path = ..;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33CEB47122A05771004F2AC0 /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
|
||||
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
|
||||
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
|
||||
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
|
||||
D73912EF22F37F9E000D13A0 /* App.framework */,
|
||||
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */,
|
||||
);
|
||||
path = Flutter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33FAB671232836740065AC1E /* Runner */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33CC10F02044A3C60003C045 /* AppDelegate.swift */,
|
||||
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
|
||||
33E51913231747F40026EE4D /* DebugProfile.entitlements */,
|
||||
33E51914231749380026EE4D /* Release.entitlements */,
|
||||
33CC11242044D66E0003C045 /* Resources */,
|
||||
33BA886A226E78AF003329D5 /* Configs */,
|
||||
);
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6AE307A1BF79F727F2A29F7C /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1648309BCE545AADC2CA0412 /* Pods-Runner.debug.xcconfig */,
|
||||
515F05C5585FF1B083E9699B /* Pods-Runner.release.xcconfig */,
|
||||
3265898D3E832CFC58FE2D96 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3EC8737F55ED08CAC9DA66FC /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
33CC10EC2044A3C60003C045 /* Runner */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
85139F2FF1491A415BB2FE56 /* [CP] Check Pods Manifest.lock */,
|
||||
33CC10E92044A3C60003C045 /* Sources */,
|
||||
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||
33CC10EB2044A3C60003C045 /* Resources */,
|
||||
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||
D369B46658939E5D51240373 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
33CC11202044C79F0003C045 /* PBXTargetDependency */,
|
||||
);
|
||||
name = Runner;
|
||||
productName = Runner;
|
||||
productReference = 33CC10ED2044A3C60003C045 /* reflectable_flutter.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
33CC10E52044A3C60003C045 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0920;
|
||||
LastUpgradeCheck = 0930;
|
||||
ORGANIZATIONNAME = "The Flutter Authors";
|
||||
TargetAttributes = {
|
||||
33CC10EC2044A3C60003C045 = {
|
||||
CreatedOnToolsVersion = 9.2;
|
||||
LastSwiftMigration = 1100;
|
||||
ProvisioningStyle = Automatic;
|
||||
SystemCapabilities = {
|
||||
com.apple.Sandbox = {
|
||||
enabled = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
33CC111A2044C6BA0003C045 = {
|
||||
CreatedOnToolsVersion = 9.2;
|
||||
ProvisioningStyle = Manual;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
|
||||
compatibilityVersion = "Xcode 8.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 33CC10E42044A3C60003C045;
|
||||
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
33CC10EC2044A3C60003C045 /* Runner */,
|
||||
33CC111A2044C6BA0003C045 /* Flutter Assemble */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
33CC10EB2044A3C60003C045 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
|
||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3399D490228B24CF009A79C7 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n";
|
||||
};
|
||||
33CC111E2044C6BF0003C045 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
Flutter/ephemeral/FlutterInputs.xcfilelist,
|
||||
);
|
||||
inputPaths = (
|
||||
Flutter/ephemeral/tripwire,
|
||||
);
|
||||
outputFileListPaths = (
|
||||
Flutter/ephemeral/FlutterOutputs.xcfilelist,
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh\ntouch Flutter/ephemeral/tripwire\n";
|
||||
};
|
||||
85139F2FF1491A415BB2FE56 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
D369B46658939E5D51240373 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
33CC10E92044A3C60003C045 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
|
||||
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
|
||||
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
33CC11202044C79F0003C045 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
|
||||
targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
33CC10F42044A3C60003C045 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
33CC10F52044A3C60003C045 /* Base */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
338D0CE9231458BD00FA5F75 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
338D0CEA231458BD00FA5F75 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter/ephemeral",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
338D0CEB231458BD00FA5F75 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
33CC10F92044A3C60003C045 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
33CC10FA2044A3C60003C045 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
33CC10FC2044A3C60003C045 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter/ephemeral",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
33CC10FD2044A3C60003C045 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter/ephemeral",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
33CC111C2044C6BA0003C045 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
33CC111D2044C6BA0003C045 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
33CC10F92044A3C60003C045 /* Debug */,
|
||||
33CC10FA2044A3C60003C045 /* Release */,
|
||||
338D0CE9231458BD00FA5F75 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
33CC10FC2044A3C60003C045 /* Debug */,
|
||||
33CC10FD2044A3C60003C045 /* Release */,
|
||||
338D0CEA231458BD00FA5F75 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
33CC111C2044C6BA0003C045 /* Debug */,
|
||||
33CC111D2044C6BA0003C045 /* Release */,
|
||||
338D0CEB231458BD00FA5F75 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:/Users/stuartmorgan/src/embedder-opensource/flutter-desktop-embedding/example/macos/Runner.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1000"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||
BuildableName = "reflectable_flutter.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "00380F9121DF178D00097171"
|
||||
BuildableName = "RunnerUITests.xctest"
|
||||
BlueprintName = "RunnerUITests"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||
BuildableName = "reflectable_flutter.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||
BuildableName = "reflectable_flutter.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||
BuildableName = "reflectable_flutter.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,9 @@
|
||||
import Cocoa
|
||||
import FlutterMacOS
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: FlutterAppDelegate {
|
||||
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_16.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_32.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_32.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_64.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_128.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_256.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_256.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_512.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_512.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "app_icon_1024.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,339 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Runner" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="applicationMenu" destination="uQy-DD-JDr" id="XBo-yE-nKs"/>
|
||||
<outlet property="mainFlutterWindow" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="APP_NAME" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="APP_NAME" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About APP_NAME" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
|
||||
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
||||
<menuItem title="Services" id="NMo-om-nkz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
||||
<menuItem title="Hide APP_NAME" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit APP_NAME" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="5QF-Oa-p0T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="M6e-cu-g7V"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="YJe-68-I9s"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="G1f-GL-Joy"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="pa3-QI-u2k">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
|
||||
<menuItem title="Find" id="4EN-yA-p0u">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Find" id="1b7-l0-nxx">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
|
||||
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="9ic-FL-obx">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
|
||||
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" id="cwL-P1-jid">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Data Detectors" id="tRr-pd-1PS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="2oI-Rn-ZJC">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="xrE-MZ-jX0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="H8h-7b-M4v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="View" id="HyV-fh-RgO">
|
||||
<items>
|
||||
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleFullScreen:" target="-1" id="dU3-MA-1Rq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="aUF-d1-5bR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="R4o-n2-Eq4">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
|
||||
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
<point key="canvasLocation" x="142" y="-258"/>
|
||||
</menu>
|
||||
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
|
||||
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</view>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,14 @@
|
||||
// Application-level settings for the Runner target.
|
||||
//
|
||||
// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
|
||||
// future. If not, the values below would default to using the project name when this becomes a
|
||||
// 'flutter create' template.
|
||||
|
||||
// The application's name. By default this is also the title of the Flutter window.
|
||||
PRODUCT_NAME = reflectable_flutter
|
||||
|
||||
// The application's bundle identifier
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.reflectableFlutter
|
||||
|
||||
// The copyright displayed in application information
|
||||
PRODUCT_COPYRIGHT = Copyright © 2020 com.example. All rights reserved.
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "../../Flutter/Flutter-Debug.xcconfig"
|
||||
#include "Warnings.xcconfig"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "../../Flutter/Flutter-Release.xcconfig"
|
||||
#include "Warnings.xcconfig"
|
||||
@@ -0,0 +1,13 @@
|
||||
WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES
|
||||
CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
|
||||
CLANG_WARN_PRAGMA_PACK = YES
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES
|
||||
CLANG_WARN_COMMA = YES
|
||||
GCC_WARN_STRICT_SELECTOR_MATCH = YES
|
||||
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
|
||||
GCC_WARN_SHADOW = YES
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>$(PRODUCT_COPYRIGHT)</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,15 @@
|
||||
import Cocoa
|
||||
import FlutterMacOS
|
||||
|
||||
class MainFlutterWindow: NSWindow {
|
||||
override func awakeFromNib() {
|
||||
let flutterViewController = FlutterViewController.init()
|
||||
let windowFrame = self.frame
|
||||
self.contentViewController = flutterViewController
|
||||
self.setFrame(windowFrame, display: true)
|
||||
|
||||
RegisterGeneratedPlugins(registry: flutterViewController)
|
||||
|
||||
super.awakeFromNib()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,23 @@
|
||||
name: widget_gen
|
||||
description: A Flutter Code Gen Package Used to Generate Widgets for WidgetStudio
|
||||
version: 1.0.1+3
|
||||
homepage: https://github.com/rodydavis/widget_gen
|
||||
environment:
|
||||
sdk: ">=2.7.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
meta: ^1.1.8
|
||||
shortid: ^0.1.1
|
||||
source_gen: ^0.9.5
|
||||
build: any
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
build_runner: any
|
||||
build_version: ^2.0.1
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
After Width: | Height: | Size: 917 B |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible" />
|
||||
<meta name="description" content="A new Flutter project." />
|
||||
|
||||
<!-- iOS meta tags & icons -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<meta name="apple-mobile-web-app-title" content="reflectable_flutter" />
|
||||
<link rel="apple-touch-icon" href="/icons/Icon-192.png" />
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
|
||||
|
||||
<title>reflectable_flutter</title>
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- This script installs service_worker.js to provide PWA functionality to
|
||||
application. For more information, see:
|
||||
https://developers.google.com/web/fundamentals/primers/service-workers -->
|
||||
<script>
|
||||
if ("serviceWorker" in navigator) {
|
||||
window.addEventListener("load", function () {
|
||||
navigator.serviceWorker.register("/flutter_service_worker.js");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="main.dart.js" type="application/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "reflectable_flutter",
|
||||
"short_name": "reflectable_flutter",
|
||||
"start_url": ".",
|
||||
"display": "minimal-ui",
|
||||
"background_color": "#0175C2",
|
||||
"theme_color": "#0175C2",
|
||||
"description": "A new Flutter project.",
|
||||
"orientation": "portrait-primary",
|
||||
"prefer_related_applications": false,
|
||||
"icons": [
|
||||
{
|
||||
"src": "icons/Icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "icons/Icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||