1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Dart 3.9 / Flutter 3.35 [first LLM release] (#2714)

I got carried away with Gemini and basically rewrote CI and the release
process for the new LLM reality. This work was largely completed by
Gemini.

- Bump all SDK versions to the current beta (3.9.0-0)
- Run `flutter channel beta`
- Wrote `ci_script.dart` to replace the bash scripts
- Converted repository to pub workspace #2499 
- Added llm.md and release.md
- Added redirect for deprecated Samples Index

## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [x] I have added sample code updates to the [changelog].
- [x] I updated/added relevant documentation (doc comments with `///`).
This commit is contained in:
Eric Windmill
2025-08-14 12:26:24 -07:00
committed by GitHub
parent 0aa5415d5e
commit 2999d738b8
410 changed files with 28166 additions and 27661 deletions

View File

@@ -1,30 +0,0 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

View File

@@ -15,13 +15,12 @@ import 'package:shelf/shelf_io.dart';
import 'package:shelf_router/shelf_router.dart';
// Configure routes.
final _router =
Router()
..get('/continent', continentHandler)
..mount('/destination', DestinationApi().router.call)
..mount('/booking', BookingApi().router.call)
..mount('/user', UserApi().router.call)
..mount('/login', LoginApi().router.call);
final _router = Router()
..get('/continent', continentHandler)
..mount('/destination', DestinationApi().router.call)
..mount('/booking', BookingApi().router.call)
..mount('/user', UserApi().router.call)
..mount('/login', LoginApi().router.call);
void main(List<String> args) async {
// Use any available host or container IP (usually `0.0.0.0`).

View File

@@ -109,56 +109,46 @@ class _$ActivityCopyWithImpl<$Res, $Val extends Activity>
}) {
return _then(
_value.copyWith(
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
description:
null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
locationName:
null == locationName
? _value.locationName
: locationName // ignore: cast_nullable_to_non_nullable
as String,
duration:
null == duration
? _value.duration
: duration // ignore: cast_nullable_to_non_nullable
as int,
timeOfDay:
null == timeOfDay
? _value.timeOfDay
: timeOfDay // ignore: cast_nullable_to_non_nullable
as TimeOfDay,
familyFriendly:
null == familyFriendly
? _value.familyFriendly
: familyFriendly // ignore: cast_nullable_to_non_nullable
as bool,
price:
null == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as int,
destinationRef:
null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
ref:
null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
imageUrl:
null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
locationName: null == locationName
? _value.locationName
: locationName // ignore: cast_nullable_to_non_nullable
as String,
duration: null == duration
? _value.duration
: duration // ignore: cast_nullable_to_non_nullable
as int,
timeOfDay: null == timeOfDay
? _value.timeOfDay
: timeOfDay // ignore: cast_nullable_to_non_nullable
as TimeOfDay,
familyFriendly: null == familyFriendly
? _value.familyFriendly
: familyFriendly // ignore: cast_nullable_to_non_nullable
as bool,
price: null == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as int,
destinationRef: null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
ref: null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
imageUrl: null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
@@ -215,56 +205,46 @@ class __$$ActivityImplCopyWithImpl<$Res>
}) {
return _then(
_$ActivityImpl(
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
description:
null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
locationName:
null == locationName
? _value.locationName
: locationName // ignore: cast_nullable_to_non_nullable
as String,
duration:
null == duration
? _value.duration
: duration // ignore: cast_nullable_to_non_nullable
as int,
timeOfDay:
null == timeOfDay
? _value.timeOfDay
: timeOfDay // ignore: cast_nullable_to_non_nullable
as TimeOfDay,
familyFriendly:
null == familyFriendly
? _value.familyFriendly
: familyFriendly // ignore: cast_nullable_to_non_nullable
as bool,
price:
null == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as int,
destinationRef:
null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
ref:
null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
imageUrl:
null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
locationName: null == locationName
? _value.locationName
: locationName // ignore: cast_nullable_to_non_nullable
as String,
duration: null == duration
? _value.duration
: duration // ignore: cast_nullable_to_non_nullable
as int,
timeOfDay: null == timeOfDay
? _value.timeOfDay
: timeOfDay // ignore: cast_nullable_to_non_nullable
as TimeOfDay,
familyFriendly: null == familyFriendly
? _value.familyFriendly
: familyFriendly // ignore: cast_nullable_to_non_nullable
as bool,
price: null == price
? _value.price
: price // ignore: cast_nullable_to_non_nullable
as int,
destinationRef: null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
ref: null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
imageUrl: null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
),
);
}

View File

@@ -88,36 +88,30 @@ class _$BookingCopyWithImpl<$Res, $Val extends Booking>
}) {
return _then(
_value.copyWith(
id:
freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
startDate:
null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
endDate:
null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
destinationRef:
null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
activitiesRef:
null == activitiesRef
? _value.activitiesRef
: activitiesRef // ignore: cast_nullable_to_non_nullable
as List<String>,
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
endDate: null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
destinationRef: null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
activitiesRef: null == activitiesRef
? _value.activitiesRef
: activitiesRef // ignore: cast_nullable_to_non_nullable
as List<String>,
)
as $Val,
);
@@ -165,36 +159,30 @@ class __$$BookingImplCopyWithImpl<$Res>
}) {
return _then(
_$BookingImpl(
id:
freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
startDate:
null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
endDate:
null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
destinationRef:
null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
activitiesRef:
null == activitiesRef
? _value._activitiesRef
: activitiesRef // ignore: cast_nullable_to_non_nullable
as List<String>,
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
endDate: null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as DateTime,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
destinationRef: null == destinationRef
? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable
as String,
activitiesRef: null == activitiesRef
? _value._activitiesRef
: activitiesRef // ignore: cast_nullable_to_non_nullable
as List<String>,
),
);
}

View File

@@ -13,10 +13,9 @@ _$BookingImpl _$$BookingImplFromJson(Map<String, dynamic> json) =>
endDate: DateTime.parse(json['endDate'] as String),
name: json['name'] as String,
destinationRef: json['destinationRef'] as String,
activitiesRef:
(json['activitiesRef'] as List<dynamic>)
.map((e) => e as String)
.toList(),
activitiesRef: (json['activitiesRef'] as List<dynamic>)
.map((e) => e as String)
.toList(),
);
Map<String, dynamic> _$$BookingImplToJson(_$BookingImpl instance) =>

View File

@@ -62,16 +62,14 @@ class _$ContinentCopyWithImpl<$Res, $Val extends Continent>
$Res call({Object? name = null, Object? imageUrl = null}) {
return _then(
_value.copyWith(
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
imageUrl:
null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
imageUrl: null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
@@ -106,16 +104,14 @@ class __$$ContinentImplCopyWithImpl<$Res>
$Res call({Object? name = null, Object? imageUrl = null}) {
return _then(
_$ContinentImpl(
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
imageUrl:
null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
imageUrl: null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
),
);
}

View File

@@ -95,41 +95,34 @@ class _$DestinationCopyWithImpl<$Res, $Val extends Destination>
}) {
return _then(
_value.copyWith(
ref:
null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
country:
null == country
? _value.country
: country // ignore: cast_nullable_to_non_nullable
as String,
continent:
null == continent
? _value.continent
: continent // ignore: cast_nullable_to_non_nullable
as String,
knownFor:
null == knownFor
? _value.knownFor
: knownFor // ignore: cast_nullable_to_non_nullable
as String,
tags:
null == tags
? _value.tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
imageUrl:
null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
ref: null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
country: null == country
? _value.country
: country // ignore: cast_nullable_to_non_nullable
as String,
continent: null == continent
? _value.continent
: continent // ignore: cast_nullable_to_non_nullable
as String,
knownFor: null == knownFor
? _value.knownFor
: knownFor // ignore: cast_nullable_to_non_nullable
as String,
tags: null == tags
? _value.tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
imageUrl: null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
@@ -180,41 +173,34 @@ class __$$DestinationImplCopyWithImpl<$Res>
}) {
return _then(
_$DestinationImpl(
ref:
null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
country:
null == country
? _value.country
: country // ignore: cast_nullable_to_non_nullable
as String,
continent:
null == continent
? _value.continent
: continent // ignore: cast_nullable_to_non_nullable
as String,
knownFor:
null == knownFor
? _value.knownFor
: knownFor // ignore: cast_nullable_to_non_nullable
as String,
tags:
null == tags
? _value._tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
imageUrl:
null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
ref: null == ref
? _value.ref
: ref // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
country: null == country
? _value.country
: country // ignore: cast_nullable_to_non_nullable
as String,
continent: null == continent
? _value.continent
: continent // ignore: cast_nullable_to_non_nullable
as String,
knownFor: null == knownFor
? _value.knownFor
: knownFor // ignore: cast_nullable_to_non_nullable
as String,
tags: null == tags
? _value._tags
: tags // ignore: cast_nullable_to_non_nullable
as List<String>,
imageUrl: null == imageUrl
? _value.imageUrl
: imageUrl // ignore: cast_nullable_to_non_nullable
as String,
),
);
}

View File

@@ -64,16 +64,14 @@ class _$LoginRequestCopyWithImpl<$Res, $Val extends LoginRequest>
$Res call({Object? email = null, Object? password = null}) {
return _then(
_value.copyWith(
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password:
null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
@@ -108,16 +106,14 @@ class __$$LoginRequestImplCopyWithImpl<$Res>
$Res call({Object? email = null, Object? password = null}) {
return _then(
_$LoginRequestImpl(
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password:
null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
),
);
}

View File

@@ -64,16 +64,14 @@ class _$LoginResponseCopyWithImpl<$Res, $Val extends LoginResponse>
$Res call({Object? token = null, Object? userId = null}) {
return _then(
_value.copyWith(
token:
null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as String,
token: null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
@@ -108,16 +106,14 @@ class __$$LoginResponseImplCopyWithImpl<$Res>
$Res call({Object? token = null, Object? userId = null}) {
return _then(
_$LoginResponseImpl(
token:
null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as String,
token: null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as String,
),
);
}

View File

@@ -72,26 +72,22 @@ class _$UserCopyWithImpl<$Res, $Val extends User>
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
picture:
null == picture
? _value.picture
: picture // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
picture: null == picture
? _value.picture
: picture // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
@@ -128,26 +124,22 @@ class __$$UserImplCopyWithImpl<$Res>
}) {
return _then(
_$UserImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
picture:
null == picture
? _value.picture
: picture // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
picture: null == picture
? _value.picture
: picture // ignore: cast_nullable_to_non_nullable
as String,
),
);
}

View File

@@ -22,11 +22,10 @@ class BookingApi {
BookingApi() {
// Create a default booking
final destination = Assets.destinations.first;
final activitiesRef =
Assets.activities
.where((activity) => activity.destinationRef == destination.ref)
.map((activity) => activity.ref)
.toList();
final activitiesRef = Assets.activities
.where((activity) => activity.destinationRef == destination.ref)
.map((activity) => activity.ref)
.toList();
_bookings.add(
Booking(
id: _sequentialId++,
@@ -60,8 +59,9 @@ class BookingApi {
// Get a booking by id
router.get('/<id>', (Request request, String id) {
final bookingId = int.parse(id);
final booking =
_bookings.where((booking) => booking.id == bookingId).firstOrNull;
final booking = _bookings
.where((booking) => booking.id == bookingId)
.firstOrNull;
if (booking == null) {
return Response.notFound('Invalid id');
@@ -102,8 +102,9 @@ class BookingApi {
// Delete booking
router.delete('/<id>', (Request request, String id) async {
final bookingId = int.parse(id);
final booking =
_bookings.where((booking) => booking.id == bookingId).firstOrNull;
final booking = _bookings
.where((booking) => booking.id == bookingId)
.firstOrNull;
if (booking == null) {
return Response.notFound('Invalid id');
}

View File

@@ -21,10 +21,9 @@ class DestinationApi {
});
router.get('/<id>/activity', (Request request, String id) {
final list =
Assets.activities
.where((activity) => activity.destinationRef == id)
.toList();
final list = Assets.activities
.where((activity) => activity.destinationRef == id)
.toList();
return Response.ok(
json.encode(list),
headers: {'Content-Type': 'application/json'},

View File

@@ -2,9 +2,10 @@ name: compass_server
description: A server app using the shelf package and Docker.
publish_to: 'none'
version: 1.0.0
resolution: workspace
environment:
sdk: ^3.7.0-0
sdk: ^3.9.0-0
dependencies:
args: ^2.4.0
@@ -15,7 +16,8 @@ dependencies:
dev_dependencies:
http: ^1.1.0
lints: ^5.0.0
analysis_defaults:
path: ../../analysis_defaults
test: ^1.24.0
build_runner: ^2.4.11
freezed: ^2.5.7