diff --git a/experimental/desktop_photo_search/lib/main.dart b/experimental/desktop_photo_search/lib/main.dart index fc16c9da1..0837dd728 100644 --- a/experimental/desktop_photo_search/lib/main.dart +++ b/experimental/desktop_photo_search/lib/main.dart @@ -128,7 +128,7 @@ class UnsplashHomePage extends StatelessWidget { await photoSearchModel.download(photo: photo); final photoFile = XFile.fromData(fileData, mimeType: 'image/jpeg'); - photoFile.saveTo(path); + await photoFile.saveTo(path); } }, ) diff --git a/experimental/desktop_photo_search/lib/src/model/search.g.dart b/experimental/desktop_photo_search/lib/src/model/search.g.dart index 43b2cd694..0bb59e677 100644 --- a/experimental/desktop_photo_search/lib/src/model/search.g.dart +++ b/experimental/desktop_photo_search/lib/src/model/search.g.dart @@ -43,7 +43,7 @@ class _$SearchSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'query': result.query = serializers.deserialize(value, @@ -72,12 +72,8 @@ class _$Search extends Search { (new SearchBuilder()..update(updates)).build(); _$Search._({this.query, this.results}) : super._() { - if (query == null) { - throw new BuiltValueNullFieldError('Search', 'query'); - } - if (results == null) { - throw new BuiltValueNullFieldError('Search', 'results'); - } + BuiltValueNullFieldError.checkNotNull(query, 'Search', 'query'); + BuiltValueNullFieldError.checkNotNull(results, 'Search', 'results'); } @override @@ -122,9 +118,10 @@ class SearchBuilder implements Builder { SearchBuilder(); SearchBuilder get _$this { - if (_$v != null) { - _query = _$v.query; - _results = _$v.results?.toBuilder(); + final $v = _$v; + if ($v != null) { + _query = $v.query; + _results = $v.results.toBuilder(); _$v = null; } return this; @@ -132,9 +129,7 @@ class SearchBuilder implements Builder { @override void replace(Search other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Search; } @@ -147,7 +142,11 @@ class SearchBuilder implements Builder { _$Search build() { _$Search _$result; try { - _$result = _$v ?? new _$Search._(query: query, results: results.build()); + _$result = _$v ?? + new _$Search._( + query: BuiltValueNullFieldError.checkNotNull( + query, 'Search', 'query'), + results: results.build()); } catch (_) { String _$failedField; try { diff --git a/experimental/desktop_photo_search/lib/src/unsplash/api_error.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/api_error.g.dart index fa4d0bb80..ac781f16a 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/api_error.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/api_error.g.dart @@ -40,7 +40,7 @@ class _$ApiErrorSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'errors': result.errors.replace(serializers.deserialize(value, @@ -63,9 +63,7 @@ class _$ApiError extends ApiError { (new ApiErrorBuilder()..update(updates)).build(); _$ApiError._({this.errors}) : super._() { - if (errors == null) { - throw new BuiltValueNullFieldError('ApiError', 'errors'); - } + BuiltValueNullFieldError.checkNotNull(errors, 'ApiError', 'errors'); } @override @@ -104,8 +102,9 @@ class ApiErrorBuilder implements Builder { ApiErrorBuilder(); ApiErrorBuilder get _$this { - if (_$v != null) { - _errors = _$v.errors?.toBuilder(); + final $v = _$v; + if ($v != null) { + _errors = $v.errors.toBuilder(); _$v = null; } return this; @@ -113,9 +112,7 @@ class ApiErrorBuilder implements Builder { @override void replace(ApiError other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$ApiError; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/current_user_collections.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/current_user_collections.g.dart index 1a4b51551..ce8a8b60c 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/current_user_collections.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/current_user_collections.g.dart @@ -31,22 +31,26 @@ class _$CurrentUserCollectionsSerializer 'id', serializers.serialize(object.id, specifiedType: const FullType(int)), ]; - if (object.title != null) { + Object value; + value = object.title; + if (value != null) { result ..add('title') - ..add(serializers.serialize(object.title, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.publishedAt != null) { + value = object.publishedAt; + if (value != null) { result ..add('published_at') - ..add(serializers.serialize(object.publishedAt, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.updatedAt != null) { + value = object.updatedAt; + if (value != null) { result ..add('updated_at') - ..add(serializers.serialize(object.updatedAt, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -62,7 +66,7 @@ class _$CurrentUserCollectionsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'id': result.id = serializers.deserialize(value, @@ -104,9 +108,7 @@ class _$CurrentUserCollections extends CurrentUserCollections { _$CurrentUserCollections._( {this.id, this.title, this.publishedAt, this.updatedAt}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('CurrentUserCollections', 'id'); - } + BuiltValueNullFieldError.checkNotNull(id, 'CurrentUserCollections', 'id'); } @override @@ -169,11 +171,12 @@ class CurrentUserCollectionsBuilder CurrentUserCollectionsBuilder(); CurrentUserCollectionsBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _title = _$v.title; - _publishedAt = _$v.publishedAt; - _updatedAt = _$v.updatedAt; + final $v = _$v; + if ($v != null) { + _id = $v.id; + _title = $v.title; + _publishedAt = $v.publishedAt; + _updatedAt = $v.updatedAt; _$v = null; } return this; @@ -181,9 +184,7 @@ class CurrentUserCollectionsBuilder @override void replace(CurrentUserCollections other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$CurrentUserCollections; } @@ -196,7 +197,8 @@ class CurrentUserCollectionsBuilder _$CurrentUserCollections build() { final _$result = _$v ?? new _$CurrentUserCollections._( - id: id, + id: BuiltValueNullFieldError.checkNotNull( + id, 'CurrentUserCollections', 'id'), title: title, publishedAt: publishedAt, updatedAt: updatedAt); diff --git a/experimental/desktop_photo_search/lib/src/unsplash/exif.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/exif.g.dart index a4cb2f5fa..5456e90df 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/exif.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/exif.g.dart @@ -22,41 +22,47 @@ class _$ExifSerializer implements StructuredSerializer { Iterable serialize(Serializers serializers, Exif object, {FullType specifiedType = FullType.unspecified}) { final result = []; - if (object.make != null) { + Object value; + value = object.make; + if (value != null) { result ..add('make') - ..add(serializers.serialize(object.make, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.model != null) { + value = object.model; + if (value != null) { result ..add('model') - ..add(serializers.serialize(object.model, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.exposureTime != null) { + value = object.exposureTime; + if (value != null) { result ..add('exposure_time') - ..add(serializers.serialize(object.exposureTime, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.aperture != null) { + value = object.aperture; + if (value != null) { result ..add('aperture') - ..add(serializers.serialize(object.aperture, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.focalLength != null) { + value = object.focalLength; + if (value != null) { result ..add('focal_length') - ..add(serializers.serialize(object.focalLength, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.iso != null) { + value = object.iso; + if (value != null) { result ..add('iso') - ..add(serializers.serialize(object.iso, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } return result; } @@ -70,7 +76,7 @@ class _$ExifSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'make': result.make = serializers.deserialize(value, @@ -203,13 +209,14 @@ class ExifBuilder implements Builder { ExifBuilder(); ExifBuilder get _$this { - if (_$v != null) { - _make = _$v.make; - _model = _$v.model; - _exposureTime = _$v.exposureTime; - _aperture = _$v.aperture; - _focalLength = _$v.focalLength; - _iso = _$v.iso; + final $v = _$v; + if ($v != null) { + _make = $v.make; + _model = $v.model; + _exposureTime = $v.exposureTime; + _aperture = $v.aperture; + _focalLength = $v.focalLength; + _iso = $v.iso; _$v = null; } return this; @@ -217,9 +224,7 @@ class ExifBuilder implements Builder { @override void replace(Exif other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Exif; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/links.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/links.g.dart index fae8c9028..fa97b21e9 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/links.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/links.g.dart @@ -22,28 +22,33 @@ class _$LinksSerializer implements StructuredSerializer { Iterable serialize(Serializers serializers, Links object, {FullType specifiedType = FullType.unspecified}) { final result = []; - if (object.self != null) { + Object value; + value = object.self; + if (value != null) { result ..add('self') - ..add(serializers.serialize(object.self, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.html != null) { + value = object.html; + if (value != null) { result ..add('html') - ..add(serializers.serialize(object.html, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.download != null) { + value = object.download; + if (value != null) { result ..add('download') - ..add(serializers.serialize(object.download, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.downloadLocation != null) { + value = object.downloadLocation; + if (value != null) { result ..add('download_location') - ..add(serializers.serialize(object.downloadLocation, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -58,7 +63,7 @@ class _$LinksSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'self': result.self = serializers.deserialize(value, @@ -157,11 +162,12 @@ class LinksBuilder implements Builder { LinksBuilder(); LinksBuilder get _$this { - if (_$v != null) { - _self = _$v.self; - _html = _$v.html; - _download = _$v.download; - _downloadLocation = _$v.downloadLocation; + final $v = _$v; + if ($v != null) { + _self = $v.self; + _html = $v.html; + _download = $v.download; + _downloadLocation = $v.downloadLocation; _$v = null; } return this; @@ -169,9 +175,7 @@ class LinksBuilder implements Builder { @override void replace(Links other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Links; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/location.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/location.g.dart index a3ea6b11e..6115809ba 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/location.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/location.g.dart @@ -22,22 +22,26 @@ class _$LocationSerializer implements StructuredSerializer { Iterable serialize(Serializers serializers, Location object, {FullType specifiedType = FullType.unspecified}) { final result = []; - if (object.city != null) { + Object value; + value = object.city; + if (value != null) { result ..add('city') - ..add(serializers.serialize(object.city, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.country != null) { + value = object.country; + if (value != null) { result ..add('country') - ..add(serializers.serialize(object.country, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.position != null) { + value = object.position; + if (value != null) { result ..add('position') - ..add(serializers.serialize(object.position, + ..add(serializers.serialize(value, specifiedType: const FullType(Position))); } return result; @@ -52,7 +56,7 @@ class _$LocationSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'city': result.city = serializers.deserialize(value, @@ -136,10 +140,11 @@ class LocationBuilder implements Builder { LocationBuilder(); LocationBuilder get _$this { - if (_$v != null) { - _city = _$v.city; - _country = _$v.country; - _position = _$v.position?.toBuilder(); + final $v = _$v; + if ($v != null) { + _city = $v.city; + _country = $v.country; + _position = $v.position?.toBuilder(); _$v = null; } return this; @@ -147,9 +152,7 @@ class LocationBuilder implements Builder { @override void replace(Location other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Location; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/photo.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/photo.g.dart index 277a171ce..dc399f22b 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/photo.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/photo.g.dart @@ -25,103 +25,116 @@ class _$PhotoSerializer implements StructuredSerializer { 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.createdAt != null) { + Object value; + value = object.createdAt; + if (value != null) { result ..add('created_at') - ..add(serializers.serialize(object.createdAt, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.updatedAt != null) { + value = object.updatedAt; + if (value != null) { result ..add('updated_at') - ..add(serializers.serialize(object.updatedAt, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.width != null) { + value = object.width; + if (value != null) { result ..add('width') - ..add(serializers.serialize(object.width, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.height != null) { + value = object.height; + if (value != null) { result ..add('height') - ..add(serializers.serialize(object.height, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.color != null) { + value = object.color; + if (value != null) { result ..add('color') - ..add(serializers.serialize(object.color, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.downloads != null) { + value = object.downloads; + if (value != null) { result ..add('downloads') - ..add(serializers.serialize(object.downloads, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.likes != null) { + value = object.likes; + if (value != null) { result ..add('likes') - ..add(serializers.serialize(object.likes, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.likedByUser != null) { + value = object.likedByUser; + if (value != null) { result ..add('liked_by_user') - ..add(serializers.serialize(object.likedByUser, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.description != null) { + value = object.description; + if (value != null) { result ..add('description') - ..add(serializers.serialize(object.description, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.exif != null) { + value = object.exif; + if (value != null) { result ..add('exif') - ..add(serializers.serialize(object.exif, - specifiedType: const FullType(Exif))); + ..add( + serializers.serialize(value, specifiedType: const FullType(Exif))); } - if (object.location != null) { + value = object.location; + if (value != null) { result ..add('location') - ..add(serializers.serialize(object.location, + ..add(serializers.serialize(value, specifiedType: const FullType(Location))); } - if (object.tags != null) { + value = object.tags; + if (value != null) { result ..add('tags') - ..add(serializers.serialize(object.tags, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [const FullType(Tags)]))); } - if (object.currentUserCollections != null) { + value = object.currentUserCollections; + if (value != null) { result ..add('current_user_collections') - ..add(serializers.serialize(object.currentUserCollections, + ..add(serializers.serialize(value, specifiedType: const FullType( BuiltList, const [const FullType(CurrentUserCollections)]))); } - if (object.urls != null) { + value = object.urls; + if (value != null) { result ..add('urls') - ..add(serializers.serialize(object.urls, - specifiedType: const FullType(Urls))); + ..add( + serializers.serialize(value, specifiedType: const FullType(Urls))); } - if (object.links != null) { + value = object.links; + if (value != null) { result ..add('links') - ..add(serializers.serialize(object.links, - specifiedType: const FullType(Links))); + ..add( + serializers.serialize(value, specifiedType: const FullType(Links))); } - if (object.user != null) { + value = object.user; + if (value != null) { result ..add('user') - ..add(serializers.serialize(object.user, - specifiedType: const FullType(User))); + ..add( + serializers.serialize(value, specifiedType: const FullType(User))); } return result; } @@ -135,7 +148,7 @@ class _$PhotoSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'id': result.id = serializers.deserialize(value, @@ -274,9 +287,7 @@ class _$Photo extends Photo { this.links, this.user}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('Photo', 'id'); - } + BuiltValueNullFieldError.checkNotNull(id, 'Photo', 'id'); } @override @@ -453,24 +464,25 @@ class PhotoBuilder implements Builder { PhotoBuilder(); PhotoBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _createdAt = _$v.createdAt; - _updatedAt = _$v.updatedAt; - _width = _$v.width; - _height = _$v.height; - _color = _$v.color; - _downloads = _$v.downloads; - _likes = _$v.likes; - _likedByUser = _$v.likedByUser; - _description = _$v.description; - _exif = _$v.exif?.toBuilder(); - _location = _$v.location?.toBuilder(); - _tags = _$v.tags?.toBuilder(); - _currentUserCollections = _$v.currentUserCollections?.toBuilder(); - _urls = _$v.urls?.toBuilder(); - _links = _$v.links?.toBuilder(); - _user = _$v.user?.toBuilder(); + final $v = _$v; + if ($v != null) { + _id = $v.id; + _createdAt = $v.createdAt; + _updatedAt = $v.updatedAt; + _width = $v.width; + _height = $v.height; + _color = $v.color; + _downloads = $v.downloads; + _likes = $v.likes; + _likedByUser = $v.likedByUser; + _description = $v.description; + _exif = $v.exif?.toBuilder(); + _location = $v.location?.toBuilder(); + _tags = $v.tags?.toBuilder(); + _currentUserCollections = $v.currentUserCollections?.toBuilder(); + _urls = $v.urls?.toBuilder(); + _links = $v.links?.toBuilder(); + _user = $v.user?.toBuilder(); _$v = null; } return this; @@ -478,9 +490,7 @@ class PhotoBuilder implements Builder { @override void replace(Photo other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Photo; } @@ -495,7 +505,7 @@ class PhotoBuilder implements Builder { try { _$result = _$v ?? new _$Photo._( - id: id, + id: BuiltValueNullFieldError.checkNotNull(id, 'Photo', 'id'), createdAt: createdAt, updatedAt: updatedAt, width: width, diff --git a/experimental/desktop_photo_search/lib/src/unsplash/position.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/position.g.dart index 30af700df..df9e51afc 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/position.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/position.g.dart @@ -42,7 +42,7 @@ class _$PositionSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'latitude': result.latitude = serializers.deserialize(value, @@ -69,12 +69,8 @@ class _$Position extends Position { (new PositionBuilder()..update(updates)).build(); _$Position._({this.latitude, this.longitude}) : super._() { - if (latitude == null) { - throw new BuiltValueNullFieldError('Position', 'latitude'); - } - if (longitude == null) { - throw new BuiltValueNullFieldError('Position', 'longitude'); - } + BuiltValueNullFieldError.checkNotNull(latitude, 'Position', 'latitude'); + BuiltValueNullFieldError.checkNotNull(longitude, 'Position', 'longitude'); } @override @@ -120,9 +116,10 @@ class PositionBuilder implements Builder { PositionBuilder(); PositionBuilder get _$this { - if (_$v != null) { - _latitude = _$v.latitude; - _longitude = _$v.longitude; + final $v = _$v; + if ($v != null) { + _latitude = $v.latitude; + _longitude = $v.longitude; _$v = null; } return this; @@ -130,9 +127,7 @@ class PositionBuilder implements Builder { @override void replace(Position other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Position; } @@ -143,8 +138,12 @@ class PositionBuilder implements Builder { @override _$Position build() { - final _$result = - _$v ?? new _$Position._(latitude: latitude, longitude: longitude); + final _$result = _$v ?? + new _$Position._( + latitude: BuiltValueNullFieldError.checkNotNull( + latitude, 'Position', 'latitude'), + longitude: BuiltValueNullFieldError.checkNotNull( + longitude, 'Position', 'longitude')); replace(_$result); return _$result; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/search_photos_response.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/search_photos_response.g.dart index d1f968631..29c4f2fd3 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/search_photos_response.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/search_photos_response.g.dart @@ -33,17 +33,18 @@ class _$SearchPhotosResponseSerializer specifiedType: const FullType(BuiltList, const [const FullType(Photo)])), ]; - if (object.total != null) { + Object value; + value = object.total; + if (value != null) { result ..add('total') - ..add(serializers.serialize(object.total, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.totalPages != null) { + value = object.totalPages; + if (value != null) { result ..add('total_pages') - ..add(serializers.serialize(object.totalPages, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } return result; } @@ -58,7 +59,7 @@ class _$SearchPhotosResponseSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'total': result.total = serializers.deserialize(value, @@ -95,9 +96,8 @@ class _$SearchPhotosResponse extends SearchPhotosResponse { _$SearchPhotosResponse._({this.total, this.totalPages, this.results}) : super._() { - if (results == null) { - throw new BuiltValueNullFieldError('SearchPhotosResponse', 'results'); - } + BuiltValueNullFieldError.checkNotNull( + results, 'SearchPhotosResponse', 'results'); } @override @@ -154,10 +154,11 @@ class SearchPhotosResponseBuilder SearchPhotosResponseBuilder(); SearchPhotosResponseBuilder get _$this { - if (_$v != null) { - _total = _$v.total; - _totalPages = _$v.totalPages; - _results = _$v.results?.toBuilder(); + final $v = _$v; + if ($v != null) { + _total = $v.total; + _totalPages = $v.totalPages; + _results = $v.results.toBuilder(); _$v = null; } return this; @@ -165,9 +166,7 @@ class SearchPhotosResponseBuilder @override void replace(SearchPhotosResponse other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$SearchPhotosResponse; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/tags.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/tags.g.dart index 15346d244..f8bcca47b 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/tags.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/tags.g.dart @@ -39,7 +39,7 @@ class _$TagsSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'title': result.title = serializers.deserialize(value, @@ -60,9 +60,7 @@ class _$Tags extends Tags { (new TagsBuilder()..update(updates)).build(); _$Tags._({this.title}) : super._() { - if (title == null) { - throw new BuiltValueNullFieldError('Tags', 'title'); - } + BuiltValueNullFieldError.checkNotNull(title, 'Tags', 'title'); } @override @@ -100,8 +98,9 @@ class TagsBuilder implements Builder { TagsBuilder(); TagsBuilder get _$this { - if (_$v != null) { - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _title = $v.title; _$v = null; } return this; @@ -109,9 +108,7 @@ class TagsBuilder implements Builder { @override void replace(Tags other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Tags; } @@ -122,7 +119,10 @@ class TagsBuilder implements Builder { @override _$Tags build() { - final _$result = _$v ?? new _$Tags._(title: title); + final _$result = _$v ?? + new _$Tags._( + title: + BuiltValueNullFieldError.checkNotNull(title, 'Tags', 'title')); replace(_$result); return _$result; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/unsplash.dart b/experimental/desktop_photo_search/lib/src/unsplash/unsplash.dart index e628b71af..e7cad6183 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/unsplash.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/unsplash.dart @@ -86,13 +86,13 @@ class Unsplash { // https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download _log.info('GET ${photo.urls.full}'); - final futureBytes = http.readBytes(photo.urls.full, headers: { + final futureBytes = http.readBytes(Uri.parse(photo.urls.full), headers: { 'Accept-Version': 'v1', 'Authorization': 'Client-ID $_accessKey', }); _log.info('GET ${photo.links.downloadLocation}'); - unawaited(http.get(photo.links.downloadLocation, headers: { + unawaited(http.get(Uri.parse(photo.links.downloadLocation), headers: { 'Accept-Version': 'v1', 'Authorization': 'Client-ID $_accessKey', })); diff --git a/experimental/desktop_photo_search/lib/src/unsplash/urls.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/urls.g.dart index f83df0b2b..38f76a459 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/urls.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/urls.g.dart @@ -22,34 +22,40 @@ class _$UrlsSerializer implements StructuredSerializer { Iterable serialize(Serializers serializers, Urls object, {FullType specifiedType = FullType.unspecified}) { final result = []; - if (object.raw != null) { + Object value; + value = object.raw; + if (value != null) { result ..add('raw') - ..add(serializers.serialize(object.raw, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.full != null) { + value = object.full; + if (value != null) { result ..add('full') - ..add(serializers.serialize(object.full, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.regular != null) { + value = object.regular; + if (value != null) { result ..add('regular') - ..add(serializers.serialize(object.regular, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.small != null) { + value = object.small; + if (value != null) { result ..add('small') - ..add(serializers.serialize(object.small, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.thumb != null) { + value = object.thumb; + if (value != null) { result ..add('thumb') - ..add(serializers.serialize(object.thumb, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -64,7 +70,7 @@ class _$UrlsSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'raw': result.raw = serializers.deserialize(value, @@ -175,12 +181,13 @@ class UrlsBuilder implements Builder { UrlsBuilder(); UrlsBuilder get _$this { - if (_$v != null) { - _raw = _$v.raw; - _full = _$v.full; - _regular = _$v.regular; - _small = _$v.small; - _thumb = _$v.thumb; + final $v = _$v; + if ($v != null) { + _raw = $v.raw; + _full = $v.full; + _regular = $v.regular; + _small = $v.small; + _thumb = $v.thumb; _$v = null; } return this; @@ -188,9 +195,7 @@ class UrlsBuilder implements Builder { @override void replace(Urls other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Urls; } diff --git a/experimental/desktop_photo_search/lib/src/unsplash/user.g.dart b/experimental/desktop_photo_search/lib/src/unsplash/user.g.dart index 883b2ea33..d3bc02759 100644 --- a/experimental/desktop_photo_search/lib/src/unsplash/user.g.dart +++ b/experimental/desktop_photo_search/lib/src/unsplash/user.g.dart @@ -30,53 +30,59 @@ class _$UserSerializer implements StructuredSerializer { 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), ]; - if (object.updatedAt != null) { + Object value; + value = object.updatedAt; + if (value != null) { result ..add('updated_at') - ..add(serializers.serialize(object.updatedAt, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.portfolioUrl != null) { + value = object.portfolioUrl; + if (value != null) { result ..add('portfolio_url') - ..add(serializers.serialize(object.portfolioUrl, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.bio != null) { + value = object.bio; + if (value != null) { result ..add('bio') - ..add(serializers.serialize(object.bio, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.location != null) { + value = object.location; + if (value != null) { result ..add('location') - ..add(serializers.serialize(object.location, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.totalLikes != null) { + value = object.totalLikes; + if (value != null) { result ..add('total_likes') - ..add(serializers.serialize(object.totalLikes, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.totalPhotos != null) { + value = object.totalPhotos; + if (value != null) { result ..add('total_photos') - ..add(serializers.serialize(object.totalPhotos, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.totalCollections != null) { + value = object.totalCollections; + if (value != null) { result ..add('total_collections') - ..add(serializers.serialize(object.totalCollections, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.links != null) { + value = object.links; + if (value != null) { result ..add('links') - ..add(serializers.serialize(object.links, - specifiedType: const FullType(Links))); + ..add( + serializers.serialize(value, specifiedType: const FullType(Links))); } return result; } @@ -90,7 +96,7 @@ class _$UserSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object value = iterator.current; switch (key) { case 'id': result.id = serializers.deserialize(value, @@ -183,15 +189,9 @@ class _$User extends User { this.totalCollections, this.links}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('User', 'id'); - } - if (username == null) { - throw new BuiltValueNullFieldError('User', 'username'); - } - if (name == null) { - throw new BuiltValueNullFieldError('User', 'name'); - } + BuiltValueNullFieldError.checkNotNull(id, 'User', 'id'); + BuiltValueNullFieldError.checkNotNull(username, 'User', 'username'); + BuiltValueNullFieldError.checkNotNull(name, 'User', 'name'); } @override @@ -311,18 +311,19 @@ class UserBuilder implements Builder { UserBuilder(); UserBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _updatedAt = _$v.updatedAt; - _username = _$v.username; - _name = _$v.name; - _portfolioUrl = _$v.portfolioUrl; - _bio = _$v.bio; - _location = _$v.location; - _totalLikes = _$v.totalLikes; - _totalPhotos = _$v.totalPhotos; - _totalCollections = _$v.totalCollections; - _links = _$v.links?.toBuilder(); + final $v = _$v; + if ($v != null) { + _id = $v.id; + _updatedAt = $v.updatedAt; + _username = $v.username; + _name = $v.name; + _portfolioUrl = $v.portfolioUrl; + _bio = $v.bio; + _location = $v.location; + _totalLikes = $v.totalLikes; + _totalPhotos = $v.totalPhotos; + _totalCollections = $v.totalCollections; + _links = $v.links?.toBuilder(); _$v = null; } return this; @@ -330,9 +331,7 @@ class UserBuilder implements Builder { @override void replace(User other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$User; } @@ -347,10 +346,11 @@ class UserBuilder implements Builder { try { _$result = _$v ?? new _$User._( - id: id, + id: BuiltValueNullFieldError.checkNotNull(id, 'User', 'id'), updatedAt: updatedAt, - username: username, - name: name, + username: BuiltValueNullFieldError.checkNotNull( + username, 'User', 'username'), + name: BuiltValueNullFieldError.checkNotNull(name, 'User', 'name'), portfolioUrl: portfolioUrl, bio: bio, location: location, diff --git a/experimental/desktop_photo_search/lib/src/widgets/photo_details.dart b/experimental/desktop_photo_search/lib/src/widgets/photo_details.dart index 9e3ff28c4..a4ab01dd2 100644 --- a/experimental/desktop_photo_search/lib/src/widgets/photo_details.dart +++ b/experimental/desktop_photo_search/lib/src/widgets/photo_details.dart @@ -3,15 +3,14 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import 'package:flutter/gestures.dart'; import 'package:meta/meta.dart'; import 'package:transparent_image/transparent_image.dart'; -import 'package:url_launcher/url_launcher.dart' as url_launcher; +import 'package:url_launcher/link.dart'; import '../../unsplash_access_key.dart'; import '../unsplash/photo.dart'; -final _unsplashHomepage = Uri.encodeFull( +final _unsplashHomepage = Uri.parse( 'https://unsplash.com/?utm_source=$unsplashAppName&utm_medium=referral'); typedef PhotoDetailsPhotoSaveCallback = void Function(Photo); @@ -31,43 +30,26 @@ class PhotoDetails extends StatefulWidget { class _PhotoDetailsState extends State with TickerProviderStateMixin { Widget _buildPhotoAttribution(BuildContext context) { - return Expanded( - child: RichText( - overflow: TextOverflow.fade, - text: TextSpan( - style: Theme.of(context).textTheme.bodyText2, - children: [ - const TextSpan(text: 'Photo by '), - TextSpan( - text: widget.photo.user.name, - style: const TextStyle( - decoration: TextDecoration.underline, - ), - recognizer: TapGestureRecognizer() - ..onTap = () async { - final url = Uri.encodeFull( - 'https://unsplash.com/@${widget.photo.user.username}?utm_source=$unsplashAppName&utm_medium=referral'); - if (await url_launcher.canLaunch(url)) { - await url_launcher.launch(url); - } - }, - ), - const TextSpan(text: ' on '), - TextSpan( - text: 'Unsplash', - style: const TextStyle( - decoration: TextDecoration.underline, - ), - recognizer: TapGestureRecognizer() - ..onTap = () async { - if (await url_launcher.canLaunch(_unsplashHomepage)) { - await url_launcher.launch(_unsplashHomepage); - } - }, - ), - ], + return Row( + children: [ + Text('Photo by '), + Link( + uri: Uri.parse( + 'https://unsplash.com/@${widget.photo.user.username}?utm_source=$unsplashAppName&utm_medium=referral'), + builder: (context, followLink) => TextButton( + onPressed: followLink, + child: Text(widget.photo.user.name), + ), ), - ), + Text(' on '), + Link( + uri: _unsplashHomepage, + builder: (context, followLink) => TextButton( + onPressed: followLink, + child: Text('Unsplash'), + ), + ), + ], ); } diff --git a/experimental/desktop_photo_search/macos/Podfile b/experimental/desktop_photo_search/macos/Podfile index d60ec7102..dade8dfad 100644 --- a/experimental/desktop_photo_search/macos/Podfile +++ b/experimental/desktop_photo_search/macos/Podfile @@ -9,74 +9,32 @@ project 'Runner', { 'Release' => :release, } -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 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; + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches end - File.foreach(file_abs_path) { |line| - return true if line =~ /^\s*macos:/ - } - return false + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" end +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + 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_install_all_macos_pods File.dirname(File.realpath(__FILE__)) +end - # 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." +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) 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 diff --git a/experimental/desktop_photo_search/macos/Podfile.lock b/experimental/desktop_photo_search/macos/Podfile.lock index 777efc9b2..a4e3b1f48 100644 --- a/experimental/desktop_photo_search/macos/Podfile.lock +++ b/experimental/desktop_photo_search/macos/Podfile.lock @@ -4,36 +4,31 @@ PODS: - FlutterMacOS (1.0.0) - menubar (0.0.2): - FlutterMacOS - - url_launcher (0.0.1) - url_launcher_macos (0.0.1): - FlutterMacOS DEPENDENCIES: - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) - - FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`) + - FlutterMacOS (from `Flutter/ephemeral`) - menubar (from `Flutter/ephemeral/.symlinks/plugins/menubar/macos`) - - url_launcher (from `Flutter/ephemeral/.symlinks/plugins/url_launcher/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) EXTERNAL SOURCES: file_selector_macos: :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos FlutterMacOS: - :path: Flutter/ephemeral/.symlinks/flutter/darwin-x64 + :path: Flutter/ephemeral menubar: :path: Flutter/ephemeral/.symlinks/plugins/menubar/macos - url_launcher: - :path: Flutter/ephemeral/.symlinks/plugins/url_launcher/macos url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos SPEC CHECKSUMS: file_selector_macos: ff6dc948d4ddd34e8602a1f60b7d0b4cc6051a47 - FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9 + FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 menubar: 4e3d461d62d775540277ce6639acafe2a111a231 - url_launcher: af78307ef9bafff91273b34f1c6c0c86a0004fd7 url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 -PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7 +PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c COCOAPODS: 1.10.0 diff --git a/experimental/desktop_photo_search/macos/Runner.xcodeproj/project.pbxproj b/experimental/desktop_photo_search/macos/Runner.xcodeproj/project.pbxproj index aca002247..92789bc48 100644 --- a/experimental/desktop_photo_search/macos/Runner.xcodeproj/project.pbxproj +++ b/experimental/desktop_photo_search/macos/Runner.xcodeproj/project.pbxproj @@ -26,11 +26,7 @@ 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, ); }; }; CB0B59C99242536310F74F61 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D99F26E68F5EBE039D3C364 /* 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 */ @@ -50,8 +46,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */, - 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */, ); name = "Bundle Framework"; runOnlyForDeploymentPostprocessing = 0; @@ -71,7 +65,6 @@ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 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 = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; @@ -79,7 +72,6 @@ 4D99F26E68F5EBE039D3C364 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; }; F4698A353FF15CC75800DADA /* 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 = ""; }; /* End PBXFileReference section */ @@ -88,8 +80,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D73912F022F37F9E000D13A0 /* App.framework in Frameworks */, - 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */, CB0B59C99242536310F74F61 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -145,8 +135,6 @@ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - D73912EF22F37F9E000D13A0 /* App.framework */, - 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */, ); path = Flutter; sourceTree = ""; @@ -280,7 +268,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n"; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; }; 33CC111E2044C6BF0003C045 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -308,9 +296,16 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/file_selector_macos/file_selector_macos.framework", + "${BUILT_PRODUCTS_DIR}/menubar/menubar.framework", + "${BUILT_PRODUCTS_DIR}/url_launcher_macos/url_launcher_macos.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_selector_macos.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/menubar.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_macos.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/experimental/desktop_photo_search/pubspec.lock b/experimental/desktop_photo_search/pubspec.lock index f0ac7f557..0d9b547e9 100644 --- a/experimental/desktop_photo_search/pubspec.lock +++ b/experimental/desktop_photo_search/pubspec.lock @@ -7,21 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "7.0.0" - analysis_server_lib: - dependency: transitive - description: - name: analysis_server_lib - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.10" + version: "14.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.39.17" + version: "0.41.2" ansicolor: dependency: transitive description: @@ -42,91 +35,91 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.3" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" build: dependency: "direct dev" description: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.6.2" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.5" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.10" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "1.3.11" + version: "1.5.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.2" + version: "1.11.1" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "6.0.1" + version: "6.1.7" built_collection: dependency: "direct main" description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "5.0.0" built_value: dependency: "direct main" description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.0.3" built_value_generator: dependency: "direct dev" description: name: built_value_generator url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.0.3" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.5" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.3" + version: "1.2.0" checked_yaml: dependency: transitive description: @@ -147,77 +140,70 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.7.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.5" + version: "1.15.0" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "3.0.0" coverage: dependency: transitive description: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "0.14.2" + version: "0.15.2" cross_file: dependency: transitive description: name: cross_file url: "https://pub.dartlang.org" source: hosted - version: "0.1.0" + version: "0.3.1+1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.2" + version: "3.0.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.0.2" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "1.3.6" + version: "1.3.12" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.3" + version: "1.2.0" file: dependency: transitive description: @@ -231,42 +217,49 @@ packages: name: file_selector url: "https://pub.dartlang.org" source: hosted - version: "0.7.0+2" + version: "0.8.2" file_selector_linux: dependency: "direct main" description: name: file_selector_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1" + version: "0.0.2" file_selector_macos: dependency: "direct main" description: name: file_selector_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1" + version: "0.0.4" file_selector_platform_interface: dependency: transitive description: name: file_selector_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.0.2" + file_selector_web: + dependency: transitive + description: + name: file_selector_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.1" file_selector_windows: dependency: "direct main" description: name: file_selector_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.1" + version: "0.0.2" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "1.0.0" flutter: dependency: "direct main" description: flutter @@ -310,20 +303,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.8.6" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+4" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.13.0" http_multi_server: dependency: transitive description: @@ -337,7 +323,7 @@ packages: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" intl: dependency: transitive description: @@ -351,21 +337,21 @@ packages: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.3.5" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.3" + version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "4.0.0" logging: dependency: "direct main" description: @@ -379,13 +365,13 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.3" + version: "0.12.10" menubar: dependency: "direct main" description: path: "plugins/menubar" ref: HEAD - resolved-ref: ff9c2aebbbf673f9726f5c8052f6a21099fa51fd + resolved-ref: "7812516a5c1fc8ef379e244106953a2b534432b9" url: "https://github.com/google/flutter-desktop-embedding.git" source: git version: "0.1.0" @@ -395,28 +381,28 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.6" + version: "1.3.0" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.7" + version: "1.0.0" msix: dependency: "direct dev" description: name: msix url: "https://pub.dartlang.org" source: hosted - version: "0.1.10" + version: "0.1.19" nested: dependency: transitive description: name: nested url: "https://pub.dartlang.org" source: hosted - version: "0.0.4" + version: "1.0.0" node_interop: dependency: transitive description: @@ -437,7 +423,7 @@ packages: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "1.4.12" + version: "1.4.13" package_config: dependency: transitive description: @@ -451,84 +437,84 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.3" + version: "1.8.0" pedantic: dependency: "direct main" description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.3" + version: "1.11.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "2.0.0" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0-nullsafety.3" + version: "1.5.0" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.2+3" + version: "5.0.0" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.4" + version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.7" + version: "0.1.8" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.9" + version: "1.1.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "3.0.0" shelf_static: dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "0.2.9+1" + version: "1.0.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "0.2.4+1" sky_engine: dependency: transitive description: flutter @@ -540,84 +526,84 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+1" + version: "0.9.10+3" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.4" + version: "2.1.0" source_maps: dependency: transitive description: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.10-nullsafety.3" + version: "0.10.10" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.4" + version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.6" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.3" + version: "1.2.0" test: dependency: "direct dev" description: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.16.0-nullsafety.13" + version: "1.16.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.6" + version: "0.2.19" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.3.12-nullsafety.12" + version: "0.3.15" timing: dependency: transitive description: @@ -631,105 +617,98 @@ packages: name: transparent_image url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" - tuneup: - dependency: "direct dev" - description: - name: tuneup - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.7" + version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.5" + version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.7.10" + version: "6.0.2" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+4" + version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+9" + version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.0.2" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.5+1" + version: "2.0.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+3" + version: "2.0.0" uuid: dependency: "direct main" description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "3.0.1" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.5" + version: "2.1.0" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "5.5.0" + version: "6.1.0+1" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+15" + version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "0.7.4" + version: "0.7.5" yaml: dependency: transitive description: @@ -738,5 +717,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.12.0-0.0 <3.0.0" - flutter: ">=1.22.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=2.0.0" diff --git a/experimental/desktop_photo_search/pubspec.yaml b/experimental/desktop_photo_search/pubspec.yaml index 6b972e273..669ccb7b9 100644 --- a/experimental/desktop_photo_search/pubspec.yaml +++ b/experimental/desktop_photo_search/pubspec.yaml @@ -4,20 +4,20 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ^2.9.0-11.0.dev - flutter: ^1.19.0-3.0.pre + sdk: ^2.11.0 + flutter: ^2.0.0 dependencies: flutter: sdk: flutter - built_collection: ^4.3.0 - built_value: ^7.0.0 - cupertino_icons: ^0.1.3 - file_selector: ^0.7.0 + built_collection: ^5.0.0 + built_value: ^8.0.3 + cupertino_icons: ^1.0.2 + file_selector: ^0.8.2 file_selector_linux: ^0.0.1 file_selector_macos: ^0.0.1 file_selector_windows: ^0.0.1 - http: ^0.12.2 + http: ^0.13.0 logging: ^0.11.3+2 flutter_simple_treeview: ^2.0.1 menubar: @@ -26,23 +26,22 @@ dependencies: path: plugins/menubar meta: ^1.1.8 pedantic: ^1.9.0 - provider: ^4.1.0 - transparent_image: ^1.0.0 - uuid: ^2.0.4 - url_launcher: ^5.4.0 + provider: ^5.0.0 + transparent_image: ^2.0.0 + uuid: ^3.0.1 + url_launcher: ^6.0.2 dev_dependencies: flutter_test: sdk: flutter async: ^2.4.0 build: ^1.2.2 - build_runner: ^1.7.2 - built_value_generator: ^7.0.0 + build_runner: ^1.10.4 + built_value_generator: ^8.0.3 grinder: ^0.8.3 msix: ^0.1.5 source_gen: ^0.9.4 test: ^1.9.4 - tuneup: ^0.3.6 flutter: uses-material-design: true diff --git a/experimental/desktop_photo_search/tool/grind.dart b/experimental/desktop_photo_search/tool/grind.dart index 4bcdae77a..1f6bb89db 100644 --- a/experimental/desktop_photo_search/tool/grind.dart +++ b/experimental/desktop_photo_search/tool/grind.dart @@ -43,7 +43,7 @@ Future watch() async => _logProcessOutput( Future analyzeSource() async => _logProcessOutput( Process.start( 'flutter', - ['pub', 'run', 'tuneup'], + ['analyze'], ), );