gemini ran ci

pull/2701/head
Eric Windmill 1 month ago
parent 535a71c6b1
commit a94af64678

@ -38,19 +38,19 @@ jobs:
# Verify the Android add-to-app samples build and pass tests with the beta # Verify the Android add-to-app samples build and pass tests with the beta
# channel. # channel.
# android-build: android-build:
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# if: github.repository == 'flutter/samples' if: github.repository == 'flutter/samples'
# steps: steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
# - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
# with: with:
# distribution: 'zulu' distribution: 'zulu'
# java-version: '17' java-version: '17'
# - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
# with: with:
# channel: beta channel: beta
# - run: ./tool/android_ci_script.sh - run: ./tool/android_ci_script.sh
# Verify the iOS add-to-app samples build and pass tests with the beta # Verify the iOS add-to-app samples build and pass tests with the beta
# channel. # channel.

@ -24,7 +24,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
flutter_version: [stable, beta, master] flutter_version: [stable]
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
steps: steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@ -37,19 +37,19 @@ jobs:
channel: ${{ matrix.flutter_version }} channel: ${{ matrix.flutter_version }}
- run: ./tool/flutter_ci_script_${{ matrix.flutter_version }}.sh - run: ./tool/flutter_ci_script_${{ matrix.flutter_version }}.sh
# android-build: android-build:
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# if: github.repository == 'flutter/samples' if: github.repository == 'flutter/samples'
# steps: steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
# - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
# with: with:
# distribution: 'zulu' distribution: 'zulu'
# java-version: '17' java-version: '17'
# - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
# with: with:
# channel: stable channel: stable
# - run: ./tool/android_ci_script.sh - run: ./tool/android_ci_script.sh
ios-build: ios-build:
runs-on: macos-latest runs-on: macos-latest

@ -112,8 +112,7 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
child: StreamBuilder<AccelerometerEvent>( child: StreamBuilder<AccelerometerEvent>(
// Don't continuously rebuild for nothing when the // Don't continuously rebuild for nothing when the
// cell isn't visible. // cell isn't visible.
stream: stream: appLifecycleState == AppLifecycleState.resumed
appLifecycleState == AppLifecycleState.resumed
? accelerometerEventStream() ? accelerometerEventStream()
: Stream.value(defaultPosition), : Stream.value(defaultPosition),
initialData: defaultPosition, initialData: defaultPosition,
@ -121,7 +120,8 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
return Transform( return Transform(
// Figure out the phone's orientation relative // Figure out the phone's orientation relative
// to gravity's direction. Ignore the z vector. // to gravity's direction. Ignore the z vector.
transform: Matrix4.rotationX( transform:
Matrix4.rotationX(
snapshot.data!.y / gravity * pi / 2, snapshot.data!.y / gravity * pi / 2,
)..multiply( )..multiply(
Matrix4.rotationY( Matrix4.rotationY(

@ -4,13 +4,13 @@ description: An example Flutter module that uses a plugin.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
provider: ^6.0.2 provider: ^6.1.5
url_launcher: ^6.0.20 url_launcher: ^6.3.2
sensors_plus: ^5.0.1 sensors_plus: ^5.0.1
dev_dependencies: dev_dependencies:

@ -125,8 +125,7 @@ class _BookDetailState extends State<BookDetail> {
IconButton( IconButton(
icon: const Icon(Icons.check), icon: const Icon(Icons.check),
// Pressing save sends the updated book to the platform. // Pressing save sends the updated book to the platform.
onPressed: onPressed: book != null
book != null
? () { ? () {
hostApi.finishEditingBook(book!); hostApi.finishEditingBook(book!);
clear(); clear();
@ -135,8 +134,7 @@ class _BookDetailState extends State<BookDetail> {
), ),
], ],
), ),
body: body: book == null
book == null
// Draw a spinner until the platform gives us the book to show details // Draw a spinner until the platform gives us the book to show details
// for. // for.
? const Center(child: CircularProgressIndicator()) ? const Center(child: CircularProgressIndicator())

@ -6,7 +6,7 @@ description: A Flutter module using the Pigeon package to demonstrate
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -24,7 +24,9 @@ void main() {
MockHostBookApi mockHostApi = MockHostBookApi(); MockHostBookApi mockHostApi = MockHostBookApi();
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp(home: BookDetail(book: Book(), hostApi: mockHostApi)), MaterialApp(
home: BookDetail(book: Book(), hostApi: mockHostApi),
),
); );
await tester.tap(find.byIcon(Icons.check)); await tester.tap(find.byIcon(Icons.check));

@ -4,7 +4,7 @@ description: An example Flutter module.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -4,7 +4,7 @@ description: A module that is embedded in the multiple_flutters_ios and multiple
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -112,8 +112,7 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
child: StreamBuilder<AccelerometerEvent>( child: StreamBuilder<AccelerometerEvent>(
// Don't continuously rebuild for nothing when the // Don't continuously rebuild for nothing when the
// cell isn't visible. // cell isn't visible.
stream: stream: appLifecycleState == AppLifecycleState.resumed
appLifecycleState == AppLifecycleState.resumed
? accelerometerEventStream() ? accelerometerEventStream()
: Stream.value(defaultPosition), : Stream.value(defaultPosition),
initialData: defaultPosition, initialData: defaultPosition,
@ -125,7 +124,8 @@ class _CellState extends State<Cell> with WidgetsBindingObserver {
return Transform( return Transform(
// Figure out the phone's orientation relative // Figure out the phone's orientation relative
// to gravity's direction. Ignore the z vector. // to gravity's direction. Ignore the z vector.
transform: Matrix4.rotationX( transform:
Matrix4.rotationX(
data.y / gravity * pi / 2, data.y / gravity * pi / 2,
)..multiply( )..multiply(
Matrix4.rotationY(data.x / gravity * pi / 2), Matrix4.rotationY(data.x / gravity * pi / 2),

@ -4,7 +4,7 @@ description: An example Flutter module that uses a plugin.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -4,7 +4,7 @@ description: An example Flutter module.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -3,7 +3,7 @@ description: Analysis defaults for flutter/samples
publish_to: none publish_to: none
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
# NOTE: Code is not allowed in this package. Do not add more dependencies. # NOTE: Code is not allowed in this package. Do not add more dependencies.
# The `flutter_lints` dependency is required for `lib/flutter.yaml`. # The `flutter_lints` dependency is required for `lib/flutter.yaml`.

@ -6,7 +6,7 @@ publish_to: "none"
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -53,8 +53,7 @@ class _FadeTransitionDemoState extends State<FadeTransitionDemo>
), ),
ElevatedButton( ElevatedButton(
child: const Text('animate'), child: const Text('animate'),
onPressed: onPressed: () => setState(() {
() => setState(() {
_controller _controller
.animateTo(1.0) .animateTo(1.0)
.then<TickerFuture>( .then<TickerFuture>(

@ -54,10 +54,8 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
left: leftPosition, left: leftPosition,
duration: const Duration(seconds: 1), duration: const Duration(seconds: 1),
child: InkWell( child: InkWell(
onTap: onTap: () => changePosition(
() => changePosition( size.height - (appBar.preferredSize.height + topPadding + 50),
size.height -
(appBar.preferredSize.height + topPadding + 50),
size.width - 150, size.width - 150,
), ),
child: Container( child: Container(
@ -68,8 +66,9 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
child: Text( child: Text(
'Click Me', 'Click Me',
style: TextStyle( style: TextStyle(
color: color: Theme.of(
Theme.of(context).buttonTheme.colorScheme!.onPrimary, context,
).buttonTheme.colorScheme!.onPrimary,
), ),
), ),
), ),

@ -48,8 +48,8 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
title: const Text('AnimatedSwitcher'), title: const Text('AnimatedSwitcher'),
actions: [ actions: [
TextButton( TextButton(
onPressed: onPressed: () =>
() => setState(() => container = generateContainer(++keyCount)), setState(() => container = generateContainer(++keyCount)),
child: const Text('Change Widget'), child: const Text('Change Widget'),
), ),
], ],
@ -61,8 +61,7 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
child: AnimatedSwitcher( child: AnimatedSwitcher(
duration: const Duration(seconds: 1), duration: const Duration(seconds: 1),
child: container, child: container,
transitionBuilder: transitionBuilder: (child, animation) =>
(child, animation) =>
ScaleTransition(scale: animation, child: child), ScaleTransition(scale: animation, child: child),
), ),
), ),

@ -15,8 +15,9 @@ class CarouselDemo extends StatelessWidget {
'assets/eat_sydney_sm.jpg', 'assets/eat_sydney_sm.jpg',
]; ];
final List<Widget> images = final List<Widget> images = fileNames
fileNames.map((file) => Image.asset(file, fit: BoxFit.cover)).toList(); .map((file) => Image.asset(file, fit: BoxFit.cover))
.toList();
@override @override
Widget build(context) { Widget build(context) {
@ -79,12 +80,10 @@ class _CarouselState extends State<Carousel> {
scrollBehavior: ScrollConfiguration.of(context).copyWith( scrollBehavior: ScrollConfiguration.of(context).copyWith(
dragDevices: {ui.PointerDeviceKind.touch, ui.PointerDeviceKind.mouse}, dragDevices: {ui.PointerDeviceKind.touch, ui.PointerDeviceKind.mouse},
), ),
itemBuilder: itemBuilder: (context, index) => AnimatedBuilder(
(context, index) => AnimatedBuilder(
animation: _controller, animation: _controller,
builder: (context, child) { builder: (context, child) {
var result = var result = _pageHasChanged ? _controller.page! : _currentPage * 1.0;
_pageHasChanged ? _controller.page! : _currentPage * 1.0;
// The horizontal position of the page between a 1 and 0 // The horizontal position of the page between a 1 and 0
var value = result - index; var value = result - index;

@ -91,8 +91,7 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,
), ),
DropdownButton<CurveChoice>( DropdownButton<CurveChoice>(
items: items: curves.map((curve) {
curves.map((curve) {
return DropdownMenuItem<CurveChoice>( return DropdownMenuItem<CurveChoice>(
value: curve, value: curve,
child: Text(curve.name), child: Text(curve.name),
@ -114,8 +113,7 @@ class _CurvedAnimationDemoState extends State<CurvedAnimationDemo>
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,
), ),
DropdownButton<CurveChoice>( DropdownButton<CurveChoice>(
items: items: curves.map((curve) {
curves.map((curve) {
return DropdownMenuItem<CurveChoice>( return DropdownMenuItem<CurveChoice>(
value: curve, value: curve,
child: Text(curve.name), child: Text(curve.name),

@ -52,22 +52,20 @@ class _ExpandCardState extends State<ExpandCard>
duration: duration, duration: duration,
firstCurve: Curves.easeInOutCubic, firstCurve: Curves.easeInOutCubic,
secondCurve: Curves.easeInOutCubic, secondCurve: Curves.easeInOutCubic,
crossFadeState: crossFadeState: selected
selected
? CrossFadeState.showSecond ? CrossFadeState.showSecond
: CrossFadeState.showFirst, : CrossFadeState.showFirst,
// Use Positioned.fill() to pass the constraints to its children. // Use Positioned.fill() to pass the constraints to its children.
// This allows the Images to use BoxFit.cover to cover the correct // This allows the Images to use BoxFit.cover to cover the correct
// size // size
layoutBuilder: ( layoutBuilder:
topChild, (topChild, topChildKey, bottomChild, bottomChildKey) {
topChildKey,
bottomChild,
bottomChildKey,
) {
return Stack( return Stack(
children: [ children: [
Positioned.fill(key: bottomChildKey, child: bottomChild), Positioned.fill(
key: bottomChildKey,
child: bottomChild,
),
Positioned.fill(key: topChildKey, child: topChild), Positioned.fill(key: topChildKey, child: topChild),
], ],
); );

@ -18,7 +18,8 @@ class FlutterAnimateDemo extends StatelessWidget {
body: Center( body: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Text( child:
Text(
"Hello Flutter Animate", "Hello Flutter Animate",
style: Theme.of(context).textTheme.headlineLarge, style: Theme.of(context).textTheme.headlineLarge,
) )

@ -17,10 +17,9 @@ class HeroAnimationDemo extends StatelessWidget {
tag: 'hero-page-child', tag: 'hero-page-child',
child: _createHeroContainer(size: 50.0, color: Colors.grey.shade300), child: _createHeroContainer(size: 50.0, color: Colors.grey.shade300),
), ),
onTap: onTap: () => Navigator.of(
() => Navigator.of(context).push<void>( context,
MaterialPageRoute(builder: (context) => const HeroPage()), ).push<void>(MaterialPageRoute(builder: (context) => const HeroPage())),
),
), ),
); );
} }

@ -92,17 +92,18 @@ class _DraggableCardState extends State<DraggableCard>
final size = MediaQuery.of(context).size; final size = MediaQuery.of(context).size;
return GestureDetector( return GestureDetector(
onPanStart: (details) => _controller.stop(canceled: true), onPanStart: (details) => _controller.stop(canceled: true),
onPanUpdate: onPanUpdate: (details) => setState(
(details) => setState( () => _dragAlignment += Alignment(
() =>
_dragAlignment += Alignment(
details.delta.dx / (size.width / 2), details.delta.dx / (size.width / 2),
details.delta.dy / (size.height / 2), details.delta.dy / (size.height / 2),
), ),
), ),
onPanEnd: onPanEnd: (details) =>
(details) => _runAnimation(details.velocity.pixelsPerSecond, size), _runAnimation(details.velocity.pixelsPerSecond, size),
child: Align(alignment: _dragAlignment, child: Card(child: widget.child)), child: Align(
alignment: _dragAlignment,
child: Card(child: widget.child),
),
); );
} }
} }

@ -4,7 +4,7 @@ version: 1.0.0+1
publish_to: none publish_to: none
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -3,7 +3,7 @@ description: A sample command-line application.
version: 1.0.0 version: 1.0.0
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
args: ^2.4.2 args: ^2.4.2

@ -4,7 +4,7 @@ publish_to: 'none'
version: 0.1.0 version: 0.1.0
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -69,8 +69,8 @@ class _MyHomePageState extends State<MyHomePage> {
.then( .then(
(sharedPreferences) => sharedPreferences.setBool('isDebug', true), (sharedPreferences) => sharedPreferences.setBool('isDebug', true),
); );
final Future<Directory> tempDirFuture = final Future<Directory> tempDirFuture = path_provider
path_provider.getTemporaryDirectory(); .getTemporaryDirectory();
// Wait until the [SharedPreferences] value is set and the temporary // Wait until the [SharedPreferences] value is set and the temporary
// directory is received before opening the database. If // directory is received before opening the database. If
@ -130,8 +130,9 @@ class _MyHomePageState extends State<MyHomePage> {
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: SearchBar( child: SearchBar(
hintText: 'Search', hintText: 'Search',
onChanged: onChanged: _database == null
_database == null ? null : (query) => _refresh(query: query), ? null
: (query) => _refresh(query: query),
trailing: const [Icon(Icons.search), SizedBox(width: 8)], trailing: const [Icon(Icons.search), SizedBox(width: 8)],
), ),
), ),

@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2

@ -4,7 +4,7 @@ publish_to: "none"
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2

@ -9,8 +9,7 @@ import 'package:shelf_router/shelf_router.dart';
int count = 0; int count = 0;
// Configure routes. // Configure routes.
final _router = final _router = Router()
Router()
..post('/', _incrementHandler) ..post('/', _incrementHandler)
..get('/', _getValueHandler); ..get('/', _getValueHandler);

@ -4,7 +4,7 @@ version: 1.0.0
publish_to: "none" publish_to: "none"
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
args: ^2.0.0 args: ^2.0.0

@ -52,8 +52,7 @@ class _$IncrementCopyWithImpl<$Res, $Val extends Increment>
$Res call({Object? by = null}) { $Res call({Object? by = null}) {
return _then( return _then(
_value.copyWith( _value.copyWith(
by: by: null == by
null == by
? _value.by ? _value.by
: by // ignore: cast_nullable_to_non_nullable : by // ignore: cast_nullable_to_non_nullable
as int, as int,
@ -89,8 +88,7 @@ class __$$IncrementImplCopyWithImpl<$Res>
$Res call({Object? by = null}) { $Res call({Object? by = null}) {
return _then( return _then(
_$IncrementImpl( _$IncrementImpl(
by: by: null == by
null == by
? _value.by ? _value.by
: by // ignore: cast_nullable_to_non_nullable : by // ignore: cast_nullable_to_non_nullable
as int, as int,
@ -189,8 +187,7 @@ class _$CountCopyWithImpl<$Res, $Val extends Count>
$Res call({Object? value = null}) { $Res call({Object? value = null}) {
return _then( return _then(
_value.copyWith( _value.copyWith(
value: value: null == value
null == value
? _value.value ? _value.value
: value // ignore: cast_nullable_to_non_nullable : value // ignore: cast_nullable_to_non_nullable
as int, as int,

@ -3,7 +3,7 @@ description: Common data models required by our client and server
version: 1.0.0 version: 1.0.0
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
freezed_annotation: ">=2.1.0 <4.0.0" freezed_annotation: ">=2.1.0 <4.0.0"

@ -36,8 +36,7 @@ import '../domain/use_cases/booking/booking_share_use_case.dart';
List<SingleChildWidget> _sharedProviders = [ List<SingleChildWidget> _sharedProviders = [
Provider( Provider(
lazy: true, lazy: true,
create: create: (context) => BookingCreateUseCase(
(context) => BookingCreateUseCase(
destinationRepository: context.read(), destinationRepository: context.read(),
activityRepository: context.read(), activityRepository: context.read(),
bookingRepository: context.read(), bookingRepository: context.read(),
@ -57,8 +56,7 @@ List<SingleChildWidget> get providersRemote {
Provider(create: (context) => ApiClient()), Provider(create: (context) => ApiClient()),
Provider(create: (context) => SharedPreferencesService()), Provider(create: (context) => SharedPreferencesService()),
ChangeNotifierProvider( ChangeNotifierProvider(
create: create: (context) =>
(context) =>
AuthRepositoryRemote( AuthRepositoryRemote(
authApiClient: context.read(), authApiClient: context.read(),
apiClient: context.read(), apiClient: context.read(),
@ -67,20 +65,17 @@ List<SingleChildWidget> get providersRemote {
as AuthRepository, as AuthRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
DestinationRepositoryRemote(apiClient: context.read()) DestinationRepositoryRemote(apiClient: context.read())
as DestinationRepository, as DestinationRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
ContinentRepositoryRemote(apiClient: context.read()) ContinentRepositoryRemote(apiClient: context.read())
as ContinentRepository, as ContinentRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
ActivityRepositoryRemote(apiClient: context.read()) ActivityRepositoryRemote(apiClient: context.read())
as ActivityRepository, as ActivityRepository,
), ),
@ -88,14 +83,12 @@ List<SingleChildWidget> get providersRemote {
value: ItineraryConfigRepositoryMemory() as ItineraryConfigRepository, value: ItineraryConfigRepositoryMemory() as ItineraryConfigRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
BookingRepositoryRemote(apiClient: context.read()) BookingRepositoryRemote(apiClient: context.read())
as BookingRepository, as BookingRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
UserRepositoryRemote(apiClient: context.read()) as UserRepository, UserRepositoryRemote(apiClient: context.read()) as UserRepository,
), ),
..._sharedProviders, ..._sharedProviders,
@ -110,26 +103,22 @@ List<SingleChildWidget> get providersLocal {
ChangeNotifierProvider.value(value: AuthRepositoryDev() as AuthRepository), ChangeNotifierProvider.value(value: AuthRepositoryDev() as AuthRepository),
Provider.value(value: LocalDataService()), Provider.value(value: LocalDataService()),
Provider( Provider(
create: create: (context) =>
(context) =>
DestinationRepositoryLocal(localDataService: context.read()) DestinationRepositoryLocal(localDataService: context.read())
as DestinationRepository, as DestinationRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
ContinentRepositoryLocal(localDataService: context.read()) ContinentRepositoryLocal(localDataService: context.read())
as ContinentRepository, as ContinentRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
ActivityRepositoryLocal(localDataService: context.read()) ActivityRepositoryLocal(localDataService: context.read())
as ActivityRepository, as ActivityRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
BookingRepositoryLocal(localDataService: context.read()) BookingRepositoryLocal(localDataService: context.read())
as BookingRepository, as BookingRepository,
), ),
@ -137,8 +126,7 @@ List<SingleChildWidget> get providersLocal {
value: ItineraryConfigRepositoryMemory() as ItineraryConfigRepository, value: ItineraryConfigRepositoryMemory() as ItineraryConfigRepository,
), ),
Provider( Provider(
create: create: (context) =>
(context) =>
UserRepositoryLocal(localDataService: context.read()) UserRepositoryLocal(localDataService: context.read())
as UserRepository, as UserRepository,
), ),

@ -18,8 +18,7 @@ class ActivityRepositoryLocal implements ActivityRepository {
@override @override
Future<Result<List<Activity>>> getByDestination(String ref) async { Future<Result<List<Activity>>> getByDestination(String ref) async {
try { try {
final activities = final activities = (await _localDataService.getActivities())
(await _localDataService.getActivities())
.where((activity) => activity.destinationRef == ref) .where((activity) => activity.destinationRef == ref)
.toList(); .toList();

@ -68,8 +68,7 @@ class BookingRepositoryLocal implements BookingRepository {
// create a default booking the first time // create a default booking the first time
if (_bookings.isEmpty) { if (_bookings.isEmpty) {
final destination = (await _localDataService.getDestinations()).first; final destination = (await _localDataService.getDestinations()).first;
final activities = final activities = (await _localDataService.getActivities())
(await _localDataService.getActivities())
.where((activity) => activity.destinationRef == destination.ref) .where((activity) => activity.destinationRef == destination.ref)
.take(4) .take(4)
.toList(); .toList();

@ -27,8 +27,9 @@ class BookingRepositoryRemote implements BookingRepository {
endDate: booking.endDate, endDate: booking.endDate,
name: '${booking.destination.name}, ${booking.destination.continent}', name: '${booking.destination.name}, ${booking.destination.continent}',
destinationRef: booking.destination.ref, destinationRef: booking.destination.ref,
activitiesRef: activitiesRef: booking.activity
booking.activity.map((activity) => activity.ref).toList(), .map((activity) => activity.ref)
.toList(),
); );
return _apiClient.postBooking(bookingApiModel); return _apiClient.postBooking(bookingApiModel);
} on Exception catch (e) { } on Exception catch (e) {
@ -72,8 +73,7 @@ class BookingRepositoryRemote implements BookingRepository {
return Result.error(resultActivities.error); return Result.error(resultActivities.error);
case Ok<List<Activity>>(): case Ok<List<Activity>>():
} }
final activities = final activities = resultActivities.value
resultActivities.value
.where((activity) => booking.activitiesRef.contains(activity.ref)) .where((activity) => booking.activitiesRef.contains(activity.ref))
.toList(); .toList();

@ -95,8 +95,9 @@ class ApiClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
final stringData = await response.transform(utf8.decoder).join(); final stringData = await response.transform(utf8.decoder).join();
final json = jsonDecode(stringData) as List<dynamic>; final json = jsonDecode(stringData) as List<dynamic>;
final activities = final activities = json
json.map((element) => Activity.fromJson(element)).toList(); .map((element) => Activity.fromJson(element))
.toList();
return Result.ok(activities); return Result.ok(activities);
} else { } else {
return const Result.error(HttpException("Invalid response")); return const Result.error(HttpException("Invalid response"));
@ -117,8 +118,9 @@ class ApiClient {
if (response.statusCode == 200) { if (response.statusCode == 200) {
final stringData = await response.transform(utf8.decoder).join(); final stringData = await response.transform(utf8.decoder).join();
final json = jsonDecode(stringData) as List<dynamic>; final json = jsonDecode(stringData) as List<dynamic>;
final bookings = final bookings = json
json.map((element) => BookingApiModel.fromJson(element)).toList(); .map((element) => BookingApiModel.fromJson(element))
.toList();
return Result.ok(bookings); return Result.ok(bookings);
} else { } else {
return const Result.error(HttpException("Invalid response")); return const Result.error(HttpException("Invalid response"));

@ -91,33 +91,27 @@ class _$BookingApiModelCopyWithImpl<$Res, $Val extends BookingApiModel>
}) { }) {
return _then( return _then(
_value.copyWith( _value.copyWith(
id: id: freezed == id
freezed == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as int?, as int?,
startDate: startDate: null == startDate
null == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
endDate: endDate: null == endDate
null == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
destinationRef: destinationRef: null == destinationRef
null == destinationRef
? _value.destinationRef ? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable : destinationRef // ignore: cast_nullable_to_non_nullable
as String, as String,
activitiesRef: activitiesRef: null == activitiesRef
null == activitiesRef
? _value.activitiesRef ? _value.activitiesRef
: activitiesRef // ignore: cast_nullable_to_non_nullable : activitiesRef // ignore: cast_nullable_to_non_nullable
as List<String>, as List<String>,
@ -169,33 +163,27 @@ class __$$BookingApiModelImplCopyWithImpl<$Res>
}) { }) {
return _then( return _then(
_$BookingApiModelImpl( _$BookingApiModelImpl(
id: id: freezed == id
freezed == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as int?, as int?,
startDate: startDate: null == startDate
null == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
endDate: endDate: null == endDate
null == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
destinationRef: destinationRef: null == destinationRef
null == destinationRef
? _value.destinationRef ? _value.destinationRef
: destinationRef // ignore: cast_nullable_to_non_nullable : destinationRef // ignore: cast_nullable_to_non_nullable
as String, as String,
activitiesRef: activitiesRef: null == activitiesRef
null == activitiesRef
? _value._activitiesRef ? _value._activitiesRef
: activitiesRef // ignore: cast_nullable_to_non_nullable : activitiesRef // ignore: cast_nullable_to_non_nullable
as List<String>, as List<String>,

@ -14,8 +14,9 @@ _$BookingApiModelImpl _$$BookingApiModelImplFromJson(
endDate: DateTime.parse(json['endDate'] as String), endDate: DateTime.parse(json['endDate'] as String),
name: json['name'] as String, name: json['name'] as String,
destinationRef: json['destinationRef'] as String, destinationRef: json['destinationRef'] as String,
activitiesRef: activitiesRef: (json['activitiesRef'] as List<dynamic>)
(json['activitiesRef'] as List<dynamic>).map((e) => e as String).toList(), .map((e) => e as String)
.toList(),
); );
Map<String, dynamic> _$$BookingApiModelImplToJson( Map<String, dynamic> _$$BookingApiModelImplToJson(

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

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

@ -75,23 +75,19 @@ class _$UserApiModelCopyWithImpl<$Res, $Val extends UserApiModel>
}) { }) {
return _then( return _then(
_value.copyWith( _value.copyWith(
id: id: null == id
null == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as String, as String,
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
email: email: null == email
null == email
? _value.email ? _value.email
: email // ignore: cast_nullable_to_non_nullable : email // ignore: cast_nullable_to_non_nullable
as String, as String,
picture: picture: null == picture
null == picture
? _value.picture ? _value.picture
: picture // ignore: cast_nullable_to_non_nullable : picture // ignore: cast_nullable_to_non_nullable
as String, as String,
@ -134,23 +130,19 @@ class __$$UserApiModelImplCopyWithImpl<$Res>
}) { }) {
return _then( return _then(
_$UserApiModelImpl( _$UserApiModelImpl(
id: id: null == id
null == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as String, as String,
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
email: email: null == email
null == email
? _value.email ? _value.email
: email // ignore: cast_nullable_to_non_nullable : email // ignore: cast_nullable_to_non_nullable
as String, as String,
picture: picture: null == picture
null == picture
? _value.picture ? _value.picture
: picture // ignore: cast_nullable_to_non_nullable : picture // ignore: cast_nullable_to_non_nullable
as String, as String,

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

@ -85,28 +85,23 @@ class _$BookingCopyWithImpl<$Res, $Val extends Booking>
}) { }) {
return _then( return _then(
_value.copyWith( _value.copyWith(
id: id: freezed == id
freezed == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as int?, as int?,
startDate: startDate: null == startDate
null == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
endDate: endDate: null == endDate
null == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
destination: destination: null == destination
null == destination
? _value.destination ? _value.destination
: destination // ignore: cast_nullable_to_non_nullable : destination // ignore: cast_nullable_to_non_nullable
as Destination, as Destination,
activity: activity: null == activity
null == activity
? _value.activity ? _value.activity
: activity // ignore: cast_nullable_to_non_nullable : activity // ignore: cast_nullable_to_non_nullable
as List<Activity>, as List<Activity>,
@ -168,28 +163,23 @@ class __$$BookingImplCopyWithImpl<$Res>
}) { }) {
return _then( return _then(
_$BookingImpl( _$BookingImpl(
id: id: freezed == id
freezed == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as int?, as int?,
startDate: startDate: null == startDate
null == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
endDate: endDate: null == endDate
null == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
destination: destination: null == destination
null == destination
? _value.destination ? _value.destination
: destination // ignore: cast_nullable_to_non_nullable : destination // ignore: cast_nullable_to_non_nullable
as Destination, as Destination,
activity: activity: null == activity
null == activity
? _value._activity ? _value._activity
: activity // ignore: cast_nullable_to_non_nullable : activity // ignore: cast_nullable_to_non_nullable
as List<Activity>, as List<Activity>,

@ -14,8 +14,7 @@ _$BookingImpl _$$BookingImplFromJson(Map<String, dynamic> json) =>
destination: Destination.fromJson( destination: Destination.fromJson(
json['destination'] as Map<String, dynamic>, json['destination'] as Map<String, dynamic>,
), ),
activity: activity: (json['activity'] as List<dynamic>)
(json['activity'] as List<dynamic>)
.map((e) => Activity.fromJson(e as Map<String, dynamic>)) .map((e) => Activity.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
); );

@ -75,23 +75,19 @@ class _$BookingSummaryCopyWithImpl<$Res, $Val extends BookingSummary>
}) { }) {
return _then( return _then(
_value.copyWith( _value.copyWith(
id: id: null == id
null == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as int, as int,
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
startDate: startDate: null == startDate
null == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
endDate: endDate: null == endDate
null == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
@ -134,23 +130,19 @@ class __$$BookingSummaryImplCopyWithImpl<$Res>
}) { }) {
return _then( return _then(
_$BookingSummaryImpl( _$BookingSummaryImpl(
id: id: null == id
null == id
? _value.id ? _value.id
: id // ignore: cast_nullable_to_non_nullable : id // ignore: cast_nullable_to_non_nullable
as int, as int,
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
startDate: startDate: null == startDate
null == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,
endDate: endDate: null == endDate
null == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime, as DateTime,

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

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

@ -90,33 +90,27 @@ class _$ItineraryConfigCopyWithImpl<$Res, $Val extends ItineraryConfig>
}) { }) {
return _then( return _then(
_value.copyWith( _value.copyWith(
continent: continent: freezed == continent
freezed == continent
? _value.continent ? _value.continent
: continent // ignore: cast_nullable_to_non_nullable : continent // ignore: cast_nullable_to_non_nullable
as String?, as String?,
startDate: startDate: freezed == startDate
freezed == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime?, as DateTime?,
endDate: endDate: freezed == endDate
freezed == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime?, as DateTime?,
guests: guests: freezed == guests
freezed == guests
? _value.guests ? _value.guests
: guests // ignore: cast_nullable_to_non_nullable : guests // ignore: cast_nullable_to_non_nullable
as int?, as int?,
destination: destination: freezed == destination
freezed == destination
? _value.destination ? _value.destination
: destination // ignore: cast_nullable_to_non_nullable : destination // ignore: cast_nullable_to_non_nullable
as String?, as String?,
activities: activities: null == activities
null == activities
? _value.activities ? _value.activities
: activities // ignore: cast_nullable_to_non_nullable : activities // ignore: cast_nullable_to_non_nullable
as List<String>, as List<String>,
@ -168,33 +162,27 @@ class __$$ItineraryConfigImplCopyWithImpl<$Res>
}) { }) {
return _then( return _then(
_$ItineraryConfigImpl( _$ItineraryConfigImpl(
continent: continent: freezed == continent
freezed == continent
? _value.continent ? _value.continent
: continent // ignore: cast_nullable_to_non_nullable : continent // ignore: cast_nullable_to_non_nullable
as String?, as String?,
startDate: startDate: freezed == startDate
freezed == startDate
? _value.startDate ? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable : startDate // ignore: cast_nullable_to_non_nullable
as DateTime?, as DateTime?,
endDate: endDate: freezed == endDate
freezed == endDate
? _value.endDate ? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable : endDate // ignore: cast_nullable_to_non_nullable
as DateTime?, as DateTime?,
guests: guests: freezed == guests
freezed == guests
? _value.guests ? _value.guests
: guests // ignore: cast_nullable_to_non_nullable : guests // ignore: cast_nullable_to_non_nullable
as int?, as int?,
destination: destination: freezed == destination
freezed == destination
? _value.destination ? _value.destination
: destination // ignore: cast_nullable_to_non_nullable : destination // ignore: cast_nullable_to_non_nullable
as String?, as String?,
activities: activities: null == activities
null == activities
? _value._activities ? _value._activities
: activities // ignore: cast_nullable_to_non_nullable : activities // ignore: cast_nullable_to_non_nullable
as List<String>, as List<String>,

@ -10,12 +10,10 @@ _$ItineraryConfigImpl _$$ItineraryConfigImplFromJson(
Map<String, dynamic> json, Map<String, dynamic> json,
) => _$ItineraryConfigImpl( ) => _$ItineraryConfigImpl(
continent: json['continent'] as String?, continent: json['continent'] as String?,
startDate: startDate: json['startDate'] == null
json['startDate'] == null
? null ? null
: DateTime.parse(json['startDate'] as String), : DateTime.parse(json['startDate'] as String),
endDate: endDate: json['endDate'] == null
json['endDate'] == null
? null ? null
: DateTime.parse(json['endDate'] as String), : DateTime.parse(json['endDate'] as String),
guests: (json['guests'] as num?)?.toInt(), guests: (json['guests'] as num?)?.toInt(),

@ -61,13 +61,11 @@ class _$UserCopyWithImpl<$Res, $Val extends User>
$Res call({Object? name = null, Object? picture = null}) { $Res call({Object? name = null, Object? picture = null}) {
return _then( return _then(
_value.copyWith( _value.copyWith(
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
picture: picture: null == picture
null == picture
? _value.picture ? _value.picture
: picture // ignore: cast_nullable_to_non_nullable : picture // ignore: cast_nullable_to_non_nullable
as String, as String,
@ -102,13 +100,11 @@ class __$$UserImplCopyWithImpl<$Res>
$Res call({Object? name = null, Object? picture = null}) { $Res call({Object? name = null, Object? picture = null}) {
return _then( return _then(
_$UserImpl( _$UserImpl(
name: name: null == name
null == name
? _value.name ? _value.name
: name // ignore: cast_nullable_to_non_nullable : name // ignore: cast_nullable_to_non_nullable
as String, as String,
picture: picture: null == picture
null == picture
? _value.picture ? _value.picture
: picture // ignore: cast_nullable_to_non_nullable : picture // ignore: cast_nullable_to_non_nullable
as String, as String,

@ -63,11 +63,8 @@ class BookingCreateUseCase {
return Result.error(activitiesResult.error); return Result.error(activitiesResult.error);
case Ok<List<Activity>>(): case Ok<List<Activity>>():
} }
final activities = final activities = activitiesResult.value
activitiesResult.value .where((activity) => itineraryConfig.activities.contains(activity.ref))
.where(
(activity) => itineraryConfig.activities.contains(activity.ref),
)
.toList(); .toList();
_log.fine('Activities loaded (${activities.length})'); _log.fine('Activities loaded (${activities.length})');

@ -67,8 +67,7 @@ class ActivitiesViewModel extends ChangeNotifier {
switch (resultActivities) { switch (resultActivities) {
case Ok(): case Ok():
{ {
_daytimeActivities = _daytimeActivities = resultActivities.value
resultActivities.value
.where( .where(
(activity) => [ (activity) => [
TimeOfDay.any, TimeOfDay.any,
@ -78,8 +77,7 @@ class ActivitiesViewModel extends ChangeNotifier {
) )
.toList(); .toList();
_eveningActivities = _eveningActivities = resultActivities.value
resultActivities.value
.where( .where(
(activity) => [ (activity) => [
TimeOfDay.evening, TimeOfDay.evening,

@ -71,8 +71,7 @@ class _ActivitiesScreenState extends State<ActivitiesScreen> {
Expanded( Expanded(
child: Center( child: Center(
child: ErrorIndicator( child: ErrorIndicator(
title: title: AppLocalization.of(
AppLocalization.of(
context, context,
).errorWhileLoadingActivities, ).errorWhileLoadingActivities,
label: AppLocalization.of(context).tryAgain, label: AppLocalization.of(context).tryAgain,
@ -171,8 +170,7 @@ class _BottomArea extends StatelessWidget {
), ),
FilledButton( FilledButton(
key: const Key(confirmButtonKey), key: const Key(confirmButtonKey),
onPressed: onPressed: viewModel.selectedActivities.isNotEmpty
viewModel.selectedActivities.isNotEmpty
? viewModel.saveActivities.execute ? viewModel.saveActivities.execute
: null, : null,
child: Text(AppLocalization.of(context).confirm), child: Text(AppLocalization.of(context).confirm),

@ -99,8 +99,7 @@ class _LoginScreenState extends State<LoginScreen> {
content: Text(AppLocalization.of(context).errorWhileLogin), content: Text(AppLocalization.of(context).errorWhileLogin),
action: SnackBarAction( action: SnackBarAction(
label: AppLocalization.of(context).tryAgain, label: AppLocalization.of(context).tryAgain,
onPressed: onPressed: () => widget.viewModel.login.execute((
() => widget.viewModel.login.execute((
_email.value.text, _email.value.text,
_password.value.text, _password.value.text,
)), )),

@ -50,8 +50,8 @@ class BookingViewModel extends ChangeNotifier {
Future<Result<void>> _createBooking() async { Future<Result<void>> _createBooking() async {
_log.fine('Loading booking'); _log.fine('Loading booking');
final itineraryConfig = final itineraryConfig = await _itineraryConfigRepository
await _itineraryConfigRepository.getItineraryConfig(); .getItineraryConfig();
switch (itineraryConfig) { switch (itineraryConfig) {
case Ok<ItineraryConfig>(): case Ok<ItineraryConfig>():
_log.fine('Loaded stored ItineraryConfig'); _log.fine('Loaded stored ItineraryConfig');

@ -90,8 +90,7 @@ class _Tags extends StatelessWidget {
child: Wrap( child: Wrap(
spacing: 6, spacing: 6,
runSpacing: 6, runSpacing: 6,
children: children: booking.destination.tags
booking.destination.tags
.map( .map(
(tag) => TagChip( (tag) => TagChip(
tag: tag, tag: tag,

@ -44,13 +44,11 @@ class _BookingScreenState extends State<BookingScreen> {
child: Scaffold( child: Scaffold(
floatingActionButton: ListenableBuilder( floatingActionButton: ListenableBuilder(
listenable: widget.viewModel, listenable: widget.viewModel,
builder: builder: (context, _) => FloatingActionButton.extended(
(context, _) => FloatingActionButton.extended(
// Workaround for https://github.com/flutter/flutter/issues/115358#issuecomment-2117157419 // Workaround for https://github.com/flutter/flutter/issues/115358#issuecomment-2117157419
heroTag: null, heroTag: null,
key: const ValueKey('share-button'), key: const ValueKey('share-button'),
onPressed: onPressed: widget.viewModel.booking != null
widget.viewModel.booking != null
? widget.viewModel.shareBooking.execute ? widget.viewModel.shareBooking.execute
: null, : null,
label: Text(AppLocalization.of(context).shareTrip), label: Text(AppLocalization.of(context).shareTrip),

@ -35,9 +35,8 @@ abstract final class Dimens {
static const Dimens mobile = _DimensMobile(); static const Dimens mobile = _DimensMobile();
/// Get dimensions definition based on screen size /// Get dimensions definition based on screen size
factory Dimens.of(BuildContext context) => switch (MediaQuery.sizeOf( factory Dimens.of(BuildContext context) =>
context, switch (MediaQuery.sizeOf(context).width) {
).width) {
> 600 && < 840 => desktop, > 600 && < 840 => desktop,
_ => mobile, _ => mobile,
}; };

@ -28,8 +28,7 @@ class CustomCheckbox extends StatelessWidget {
), ),
child: Material( child: Material(
borderRadius: BorderRadius.circular(24), borderRadius: BorderRadius.circular(24),
color: color: value
value
? Theme.of(context).colorScheme.primary ? Theme.of(context).colorScheme.primary
: Colors.transparent, : Colors.transparent,
child: SizedBox( child: SizedBox(

@ -93,12 +93,10 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
SliverList.builder( SliverList.builder(
itemCount: widget.viewModel.bookings.length, itemCount: widget.viewModel.bookings.length,
itemBuilder: itemBuilder: (_, index) => _Booking(
(_, index) => _Booking(
key: ValueKey(widget.viewModel.bookings[index].id), key: ValueKey(widget.viewModel.bookings[index].id),
booking: widget.viewModel.bookings[index], booking: widget.viewModel.bookings[index],
onTap: onTap: () => context.push(
() => context.push(
Routes.bookingWithId( Routes.bookingWithId(
widget.viewModel.bookings[index].id, widget.viewModel.bookings[index].id,
), ),

@ -61,8 +61,7 @@ class _Title extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ShaderMask( return ShaderMask(
blendMode: BlendMode.srcIn, blendMode: BlendMode.srcIn,
shaderCallback: shaderCallback: (bounds) => RadialGradient(
(bounds) => RadialGradient(
center: Alignment.bottomLeft, center: Alignment.bottomLeft,
radius: 2, radius: 2,
colors: [Colors.purple.shade700, Colors.purple.shade400], colors: [Colors.purple.shade700, Colors.purple.shade400],

@ -67,8 +67,7 @@ class ResultsViewModel extends ChangeNotifier {
case Ok(): case Ok():
{ {
// If the result is Ok, update the list of destinations // If the result is Ok, update the list of destinations
_destinations = _destinations = result.value
result.value
.where( .where(
(destination) => (destination) =>
destination.continent == _itineraryConfig!.continent, destination.continent == _itineraryConfig!.continent,

@ -42,8 +42,9 @@ class ResultCard extends StatelessWidget {
spacing: 4.0, spacing: 4.0,
runSpacing: 4.0, runSpacing: 4.0,
direction: Axis.horizontal, direction: Axis.horizontal,
children: children: destination.tags
destination.tags.map((e) => TagChip(tag: e)).toList(), .map((e) => TagChip(tag: e))
.toList(),
), ),
], ],
), ),

@ -67,8 +67,7 @@ class _ResultsScreenState extends State<ResultsScreen> {
Expanded( Expanded(
child: Center( child: Center(
child: ErrorIndicator( child: ErrorIndicator(
title: title: AppLocalization.of(
AppLocalization.of(
context, context,
).errorWhileLoadingDestinations, ).errorWhileLoadingDestinations,
label: AppLocalization.of(context).tryAgain, label: AppLocalization.of(context).tryAgain,

@ -75,11 +75,9 @@ class _QuantitySelector extends StatelessWidget {
), ),
ListenableBuilder( ListenableBuilder(
listenable: viewModel, listenable: viewModel,
builder: builder: (context, _) => Text(
(context, _) => Text(
viewModel.guests.toString(), viewModel.guests.toString(),
style: style: viewModel.guests == 0
viewModel.guests == 0
? Theme.of(context).inputDecorationTheme.hintStyle ? Theme.of(context).inputDecorationTheme.hintStyle
: Theme.of(context).textTheme.bodyMedium, : Theme.of(context).textTheme.bodyMedium,
), ),

@ -65,8 +65,7 @@ class _SearchFormSubmitState extends State<SearchFormSubmit> {
builder: (context, child) { builder: (context, child) {
return FilledButton( return FilledButton(
key: const ValueKey(searchFormSubmitButtonKey), key: const ValueKey(searchFormSubmitButtonKey),
onPressed: onPressed: widget.viewModel.valid
widget.viewModel.valid
? widget.viewModel.updateItineraryConfig.execute ? widget.viewModel.updateItineraryConfig.execute
: null, : null,
child: child, child: child,

@ -5,7 +5,7 @@ publish_to: none
version: 0.1.0 version: 0.1.0
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
cached_network_image: ^3.4.1 cached_network_image: ^3.4.1

@ -15,8 +15,7 @@ import 'package:shelf/shelf_io.dart';
import 'package:shelf_router/shelf_router.dart'; import 'package:shelf_router/shelf_router.dart';
// Configure routes. // Configure routes.
final _router = final _router = Router()
Router()
..get('/continent', continentHandler) ..get('/continent', continentHandler)
..mount('/destination', DestinationApi().router.call) ..mount('/destination', DestinationApi().router.call)
..mount('/booking', BookingApi().router.call) ..mount('/booking', BookingApi().router.call)

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

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

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

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

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

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

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

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

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

@ -21,8 +21,7 @@ class DestinationApi {
}); });
router.get('/<id>/activity', (Request request, String id) { router.get('/<id>/activity', (Request request, String id) {
final list = final list = Assets.activities
Assets.activities
.where((activity) => activity.destinationRef == id) .where((activity) => activity.destinationRef == id)
.toList(); .toList();
return Response.ok( return Response.ok(

@ -4,7 +4,7 @@ publish_to: 'none'
version: 1.0.0 version: 1.0.0
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
args: ^2.4.0 args: ^2.4.0

@ -234,8 +234,7 @@ class _MyCascadingContextMenuState extends State<_MyCascadingContextMenu> {
// already hidden. // already hidden.
MenuEntry( MenuEntry(
label: 'Reset', label: 'Reset',
onPressed: onPressed: widget.showingMessage
widget.showingMessage
? () { ? () {
ContextMenuController.removeAny(); ContextMenuController.removeAny();
widget.onChangeSelection('Reset'); widget.onChangeSelection('Reset');

@ -52,8 +52,9 @@ class CustomButtonsPage extends StatelessWidget {
// Build the default buttons, but make them look custom. // Build the default buttons, but make them look custom.
// Note that in a real project you may want to build // Note that in a real project you may want to build
// different buttons depending on the platform. // different buttons depending on the platform.
children: children: editableTextState.contextMenuButtonItems.map((
editableTextState.contextMenuButtonItems.map((buttonItem) { buttonItem,
) {
return CupertinoButton( return CupertinoButton(
borderRadius: null, borderRadius: null,
color: const Color(0xffaaaa00), color: const Color(0xffaaaa00),

@ -47,8 +47,7 @@ class CustomMenuPage extends StatelessWidget {
contextMenuBuilder: (context, editableTextState) { contextMenuBuilder: (context, editableTextState) {
return _MyContextMenu( return _MyContextMenu(
anchor: editableTextState.contextMenuAnchors.primaryAnchor, anchor: editableTextState.contextMenuAnchors.primaryAnchor,
children: children: AdaptiveTextSelectionToolbar.getAdaptiveButtons(
AdaptiveTextSelectionToolbar.getAdaptiveButtons(
context, context,
editableTextState.contextMenuButtonItems, editableTextState.contextMenuButtonItems,
).toList(), ).toList(),

@ -22,8 +22,7 @@ class EmailButtonPage extends StatelessWidget {
DialogRoute _showDialog(BuildContext context) { DialogRoute _showDialog(BuildContext context) {
return DialogRoute<void>( return DialogRoute<void>(
context: context, context: context,
builder: builder: (context) =>
(context) =>
const AlertDialog(title: Text('You clicked send email!')), const AlertDialog(title: Text('You clicked send email!')),
); );
} }

@ -85,8 +85,7 @@ class FieldTypesPage extends StatelessWidget {
contextMenuBuilder: (context, editableTextState) { contextMenuBuilder: (context, editableTextState) {
return DesktopTextSelectionToolbar( return DesktopTextSelectionToolbar(
anchor: editableTextState.contextMenuAnchors.primaryAnchor, anchor: editableTextState.contextMenuAnchors.primaryAnchor,
children: children: AdaptiveTextSelectionToolbar.getAdaptiveButtons(
AdaptiveTextSelectionToolbar.getAdaptiveButtons(
context, context,
editableTextState.contextMenuButtonItems, editableTextState.contextMenuButtonItems,
).toList(), ).toList(),

@ -126,8 +126,7 @@ class FullPage extends StatelessWidget {
// Build the default buttons, but make them look crazy. // Build the default buttons, but make them look crazy.
// Note that in a real project you may want to build // Note that in a real project you may want to build
// different buttons depending on the platform. // different buttons depending on the platform.
children: children: buttonItems.map((buttonItem) {
buttonItems.map((buttonItem) {
return CupertinoButton( return CupertinoButton(
borderRadius: null, borderRadius: null,
color: const Color(0xffaaaa00), color: const Color(0xffaaaa00),

@ -19,10 +19,8 @@ class ImagePage extends StatelessWidget {
DialogRoute _showDialog(BuildContext context) { DialogRoute _showDialog(BuildContext context) {
return DialogRoute<void>( return DialogRoute<void>(
context: context, context: context,
builder: builder: (context) =>
(context) => const AlertDialog( const AlertDialog(title: Text('Image saved! (not really though)')),
title: Text('Image saved! (not really though)'),
),
); );
} }

@ -64,35 +64,29 @@ class _MyAppState extends State<MyApp> {
initialRoute: '/', initialRoute: '/',
routes: <String, Widget Function(BuildContext)>{ routes: <String, Widget Function(BuildContext)>{
'/': (context) => MyHomePage(onChangedPlatform: onChangedPlatform), '/': (context) => MyHomePage(onChangedPlatform: onChangedPlatform),
AnywherePage.route: AnywherePage.route: (context) =>
(context) => AnywherePage(onChangedPlatform: onChangedPlatform), AnywherePage(onChangedPlatform: onChangedPlatform),
CustomButtonsPage.route: CustomButtonsPage.route: (context) =>
(context) =>
CustomButtonsPage(onChangedPlatform: onChangedPlatform), CustomButtonsPage(onChangedPlatform: onChangedPlatform),
CustomMenuPage.route: CustomMenuPage.route: (context) =>
(context) => CustomMenuPage(onChangedPlatform: onChangedPlatform), CustomMenuPage(onChangedPlatform: onChangedPlatform),
ReorderedButtonsPage.route: ReorderedButtonsPage.route: (context) =>
(context) =>
ReorderedButtonsPage(onChangedPlatform: onChangedPlatform), ReorderedButtonsPage(onChangedPlatform: onChangedPlatform),
EmailButtonPage.route: EmailButtonPage.route: (context) =>
(context) => EmailButtonPage(onChangedPlatform: onChangedPlatform), EmailButtonPage(onChangedPlatform: onChangedPlatform),
ImagePage.route: ImagePage.route: (context) =>
(context) => ImagePage(onChangedPlatform: onChangedPlatform), ImagePage(onChangedPlatform: onChangedPlatform),
FieldTypesPage.route: FieldTypesPage.route: (context) =>
(context) => FieldTypesPage(onChangedPlatform: onChangedPlatform), FieldTypesPage(onChangedPlatform: onChangedPlatform),
FullPage.route: FullPage.route: (context) =>
(context) => FullPage(onChangedPlatform: onChangedPlatform), FullPage(onChangedPlatform: onChangedPlatform),
ModifiedActionPage.route: ModifiedActionPage.route: (context) =>
(context) =>
ModifiedActionPage(onChangedPlatform: onChangedPlatform), ModifiedActionPage(onChangedPlatform: onChangedPlatform),
GlobalSelectionPage.route: GlobalSelectionPage.route: (context) =>
(context) =>
GlobalSelectionPage(onChangedPlatform: onChangedPlatform), GlobalSelectionPage(onChangedPlatform: onChangedPlatform),
DefaultValuesPage.route: DefaultValuesPage.route: (context) =>
(context) =>
DefaultValuesPage(onChangedPlatform: onChangedPlatform), DefaultValuesPage(onChangedPlatform: onChangedPlatform),
CascadingMenuPage.route: CascadingMenuPage.route: (context) =>
(context) =>
CascadingMenuPage(onChangedPlatform: onChangedPlatform), CascadingMenuPage(onChangedPlatform: onChangedPlatform),
}, },
); );

@ -22,8 +22,7 @@ class ModifiedActionPage extends StatelessWidget {
DialogRoute _showDialog(BuildContext context) { DialogRoute _showDialog(BuildContext context) {
return DialogRoute<void>( return DialogRoute<void>(
context: context, context: context,
builder: builder: (context) => const AlertDialog(
(context) => const AlertDialog(
title: Text('Copied, but also showed this dialog.'), title: Text('Copied, but also showed this dialog.'),
), ),
); );

@ -37,8 +37,7 @@ class _PlatformSelectorState extends State<PlatformSelector> {
widget.onChangedPlatform(value); widget.onChangedPlatform(value);
setState(() {}); setState(() {});
}, },
items: items: TargetPlatform.values.map((platform) {
TargetPlatform.values.map((platform) {
return DropdownMenuItem<TargetPlatform>( return DropdownMenuItem<TargetPlatform>(
value: platform, value: platform,
child: Row( child: Row(

@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions

@ -4,7 +4,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.1.0 version: 0.1.0
environment: environment:
sdk: ^3.7.0 sdk: '>=3.9.0-0 <4.0.0'
dependencies: dependencies:
flutter: flutter:

@ -30,8 +30,7 @@ class ProductCategoryList extends StatelessWidget {
value.toString().contains(state.pathParameters['category']!), value.toString().contains(state.pathParameters['category']!),
orElse: () => Category.all, orElse: () => Category.all,
); );
final List<Widget> children = final List<Widget> children = ProductsRepository.loadProducts(
ProductsRepository.loadProducts(
category: category, category: category,
).map<Widget>((Product p) => RowItem(product: p)).toList(); ).map<Widget>((Product p) => RowItem(product: p)).toList();
return Scaffold( return Scaffold(

@ -23,8 +23,7 @@ class ProductList extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<Widget> children = final List<Widget> children = ProductsRepository.loadProducts()
ProductsRepository.loadProducts()
.map<Widget>((Product p) => RowItem(product: p)) .map<Widget>((Product p) => RowItem(product: p))
.toList(); .toList();
return Scaffold( return Scaffold(

@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ^3.7.0-0 sdk: '>=3.9.0-0 <4.0.0'
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions

@ -39,8 +39,8 @@ void main() {
runApp( runApp(
ChangeNotifierProvider<PhotoSearchModel>( ChangeNotifierProvider<PhotoSearchModel>(
create: create: (context) =>
(context) => PhotoSearchModel(Unsplash(accessKey: unsplashAccessKey)), PhotoSearchModel(Unsplash(accessKey: unsplashAccessKey)),
child: const UnsplashSearchApp(), child: const UnsplashSearchApp(),
), ),
); );
@ -84,8 +84,7 @@ class UnsplashHomePage extends StatelessWidget {
onSelected: () { onSelected: () {
showDialog<void>( showDialog<void>(
context: context, context: context,
builder: builder: (context) =>
(context) =>
PhotoSearchDialog(callback: photoSearchModel.addSearch), PhotoSearchDialog(callback: photoSearchModel.addSearch),
); );
}, },
@ -118,8 +117,7 @@ class UnsplashHomePage extends StatelessWidget {
return UnsplashNotice( return UnsplashNotice(
child: Container( child: Container(
color: Colors.white, color: Colors.white,
child: child: photoSearchModel.entries.isNotEmpty
photoSearchModel.entries.isNotEmpty
? const UnsplashSearchContent() ? const UnsplashSearchContent()
: const Center( : const Center(
child: Text('Search for Photos using the Search menu'), child: Text('Search for Photos using the Search menu'),

@ -106,8 +106,9 @@ class _$ApiError extends ApiError {
@override @override
String toString() { String toString() {
return (newBuiltValueToStringHelper(r'ApiError') return (newBuiltValueToStringHelper(
..add('errors', errors)).toString(); r'ApiError',
)..add('errors', errors)).toString();
} }
} }

@ -98,8 +98,9 @@ class _$Tags extends Tags {
@override @override
String toString() { String toString() {
return (newBuiltValueToStringHelper(r'Tags') return (newBuiltValueToStringHelper(
..add('title', title)).toString(); r'Tags',
)..add('title', title)).toString();
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save