| 1 | import 'dart:ui'; |
| 2 | |
| 3 | import 'package:cached_network_image/cached_network_image.dart'; |
| 4 | import 'package:flutter_svg/svg.dart'; |
| 5 | import 'package:latlong2/latlong.dart'; |
| 6 | import 'package:openapi/openapi.dart'; |
| 7 | import 'package:aero/screens/home/home_controller.dart'; |
| 8 | import 'package:aero/screens/home/widgets/airport_details_sheet.dart'; |
| 9 | import 'package:aero/screens/home/widgets/animated_flight_info_bar.dart'; |
| 10 | import 'package:aero/screens/home/widgets/date_selection_list.dart'; |
| 11 | import 'package:aero/screens/home/widgets/booking_details_sheet.dart'; |
| 12 | import 'package:aero/screens/home/widgets/flight_info.dart'; |
| 13 | import 'package:aero/screens/home/widgets/flight_map.dart'; |
| 14 | import 'package:aero/screens/home/widgets/flight_search_bar.dart'; |
| 15 | import 'package:aero/screens/home/widgets/flight_selection_list.dart'; |
| 16 | import 'package:aero/screens/home/widgets/flights_list.dart'; |
| 17 | import 'package:aero/screens/home/widgets/refresh_countdown_timer.dart'; |
| 18 | import 'package:aero/screens/home/widgets/search_header.dart'; |
| 19 | import 'package:aero/screens/home/widgets/search_results_list.dart'; |
| 20 | import 'package:aero/screens/home/widgets/selected_filters.dart'; |
| 21 | import 'package:aero/screens/home/widgets/tracked_flights_list.dart'; |
| 22 | import 'package:flutter/material.dart'; |
| 23 | import 'package:flutter/services.dart'; |
| 24 | import 'package:flutter_map_animations/flutter_map_animations.dart'; |
| 25 | import 'package:gap/gap.dart'; |
| 26 | |
| 27 | class HomeScreen extends StatefulWidget |
| 28 | const HomeScreen({ |
| 29 | super.key, |
| 30 | }); |
| 31 | |
| 32 | @override |
| 33 | State<HomeScreen> createState |
| 34 | } |
| 35 | |
| 36 | class _HomeScreenState extends State |
| 37 | with WidgetsBindingObserver, TickerProviderStateMixin |
| 38 | late final HomeController |
| 39 | late final AnimatedMapController |
| 40 | vsync: this, |
| 41 | duration: const Duration(milliseconds |
| 42 | curve: Curves.easeInOut, |
| 43 | cancelPreviousAnimations: true, |
| 44 | ); |
| 45 | final DraggableScrollableController _bottomSheetController = |
| 46 | DraggableScrollableController(); |
| 47 | LatLng? _lastAnimatedPosition; |
| 48 | FlightResponseEntity? _lastFlightInfo; |
| 49 | |
| 50 | @override |
| 51 | void initState() { |
| 52 | super.initState(); |
| 53 | _homeController = HomeController(); |
| 54 | _homeController.addListener(_handleControllerUpdate); |
| 55 | WidgetsBinding.instance.addObserver( |
| 56 | SystemChrome.setSystemUIOverlayStyle( |
| 57 | const SystemUiOverlayStyle( |
| 58 | statusBarColor: Colors.transparent, |
| 59 | statusBarIconBrightness: Brightness.dark, |
| 60 | systemNavigationBarColor: Colors.transparent, |
| 61 | systemNavigationBarIconBrightness: Brightness.dark, |
| 62 | ), |
| 63 | ); |
| 64 | _homeController.initialize(); |
| 65 | } |
| 66 | |
| 67 | @override |
| 68 | void didChangeMetrics() { |
| 69 | final bottomInset = WidgetsBinding. |
| 70 | if (bottomInset > 0) { |
| 71 | _bottomSheetController.animateTo( |
| 72 | 0.75, |
| 73 | duration: const Duration( |
| 74 | milliseconds: 150, |
| 75 | ), |
| 76 | curve: Curves.easeInOut, |
| 77 | ); |
| 78 | } else {} |
| 79 | } |
| 80 | |
| 81 | @override |
| 82 | void dispose() { |
| 83 | WidgetsBinding.instance.removeObserver( |
| 84 | _bottomSheetController.dispose(); |
| 85 | _homeController.removeListener(_handleControllerUpdate); |
| 86 | _homeController.dispose(); |
| 87 | _mapController.dispose(); |
| 88 | super.dispose(); |
| 89 | } |
| 90 | |
| 91 | void _handleControllerUpdate() { |
| 92 | final hasNewFlight = |
| 93 | _homeController.flightInfo?.id != _lastFlightInfo?. |
| 94 | _homeController.flightInfo != null; |
| 95 | setState(() {}); |
| 96 | _maybeAnimateMap(hasNewFlight); |
| 97 | if (hasNewFlight) { |
| 98 | _expandBottomSheet(); |
| 99 | _lastFlightInfo = _homeController.flightInfo; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | void _expandBottomSheet() { |
| 104 | _bottomSheetController.animateTo( |
| 105 | 0.75, |
| 106 | duration: const Duration(milliseconds |
| 107 | curve: Curves.easeInOut, |
| 108 | ); |
| 109 | } |
| 110 | |
| 111 | void _maybeAnimateMap(bool |
| 112 | final position = _homeController.currentPosition; |
| 113 | if (position != null) { |
| 114 | final target = LatLng( |
| 115 | position.latitude.toDouble(), |
| 116 | position.longitude.toDouble(), |
| 117 | ); |
| 118 | final shouldAnimate = _lastAnimatedPosition == null |
| 119 | _lastAnimatedPosition!.latitude != target.latitude || |
| 120 | _lastAnimatedPosition!.longitude != target.longitude; |
| 121 | if (shouldAnimate) { |
| 122 | _mapController.animateTo(dest: target); |
| 123 | _lastAnimatedPosition = target; |
| 124 | } |
| 125 | return; |
| 126 | } |
| 127 | |
| 128 | if (flightChanged && |
| 129 | _homeController.coordinates.length == 2 && |
| 130 | _homeController.coordinates[1] != _lastAnimatedPosition) { |
| 131 | final destination = _homeController.coordinates[1 |
| 132 | _mapController.animateTo(dest: destination); |
| 133 | _lastAnimatedPosition = destination; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | void _showAirportDetailsSheet(AirportEntity |
| 138 | showModalBottomSheet( |
| 139 | context: context, |
| 140 | isScrollControlled: true, |
| 141 | backgroundColor: Colors.white, |
| 142 | shape: const RoundedRectangleBorder( |
| 143 | borderRadius: BorderRadius.vertical(top |
| 144 | ), |
| 145 | builder: (context) => AirportDetailsSheet(airport: |
| 146 | ); |
| 147 | } |
| 148 | |
| 149 | void _showBookingDetailsSheet() { |
| 150 | final info = _homeController.flightInfo; |
| 151 | if (info == null) return |
| 152 | |
| 153 | // Get the first booking if it exists |
| 154 | final existingBooking = info.bookings != |
| 155 | ? info.bookings!.first |
| 156 | : null; |
| 157 | |
| 158 | showModalBottomSheet( |
| 159 | context: context, |
| 160 | isScrollControlled: true, |
| 161 | backgroundColor: Colors.transparent, |
| 162 | builder: (context) => BookingDetailsSheet( |
| 163 | flightId: info.id, |
| 164 | existingBooking: existingBooking, |
| 165 | onSaved: () { |
| 166 | // Refresh flight data to get updated booking |
| 167 | _homeController.loadFlightInfo( |
| 168 | info.flightNo, |
| 169 | info.flightNo, |
| 170 | info.date.toLocal(), |
| 171 | forceUpdate: true, |
| 172 | ); |
| 173 | }, |
| 174 | onDeleted: () { |
| 175 | // Refresh flight data after deletion |
| 176 | _homeController.loadFlightInfo( |
| 177 | info.flightNo, |
| 178 | info.flightNo, |
| 179 | info.date.toLocal(), |
| 180 | forceUpdate: true, |
| 181 | ); |
| 182 | }, |
| 183 | ), |
| 184 | ); |
| 185 | } |
| 186 | |
| 187 | @override |
| 188 | Widget build(BuildContext |
| 189 | final controller = _homeController; |
| 190 | final isSelectingFlight = |
| 191 | controller.panelState == FlightPanelState.selectingFlight |
| 192 | controller.flightSearchResults != null; |
| 193 | final isShowingFlight = |
| 194 | controller.panelState == FlightPanelState.showingFlight |
| 195 | controller.flightInfo != null; |
| 196 | final isLoadingFlight = |
| 197 | controller.panelState == FlightPanelState.loadingFlight |
| 198 | |
| 199 | return Scaffold( |
| 200 | body: Stack( |
| 201 | children: [ |
| 202 | Positioned.fill( |
| 203 | bottom: MediaQuery.of(context) |
| 204 | child: FlightMap( |
| 205 | mapController: _mapController, |
| 206 | arrivalAirport: controller.arrivalAirport, |
| 207 | departureAirport: controller.departureAirport, |
| 208 | coordinates: controller.coordinates, |
| 209 | flightTrackPoints: controller.flightTrackPoints, |
| 210 | currentHeading: controller.currentPosition?.heading?. |
| 211 | onAircraftSelected: controller.onAircraftSelected, |
| 212 | isFlightInAir: controller.isInAir, |
| 213 | airports: controller.nearbyAirports, |
| 214 | onBoundsChanged: controller.loadAirportsInBounds, |
| 215 | onAirportTap: _showAirportDetailsSheet, |
| 216 | ), |
| 217 | ), |
| 218 | if (controller.isTrackingActive) |
| 219 | Positioned( |
| 220 | top: MediaQuery.of(context) |
| 221 | right: 10, |
| 222 | child: RefreshCountdownTimer( |
| 223 | secondsRemaining: controller.secondsUntilNextUpdate, |
| 224 | ), |
| 225 | ), |
| 226 | if (controller.isInAir && controller.currentPosition != |
| 227 | Positioned( |
| 228 | top: MediaQuery.of(context) |
| 229 | left: 20, |
| 230 | right: 20, |
| 231 | child: Center( |
| 232 | child: AnimatedFlightInfoBar( |
| 233 | altitude: |
| 234 | (controller.currentPosition!.altitude * 100) |
| 235 | speed: controller.currentPosition!.groundspeed.toInt |
| 236 | heading: controller.currentPosition!.heading?. |
| 237 | ), |
| 238 | ), |
| 239 | ), |
| 240 | DraggableScrollableSheet( |
| 241 | initialChildSize: .25, |
| 242 | controller: _bottomSheetController, |
| 243 | minChildSize: .25, |
| 244 | builder: (context, scrollController) { |
| 245 | return SafeArea( |
| 246 | child: Container( |
| 247 | decoration: BoxDecoration( |
| 248 | color: Colors.white, |
| 249 | borderRadius: BorderRadius.circular( |
| 250 | ), |
| 251 | child: SingleChildScrollView( |
| 252 | controller: scrollController, |
| 253 | child: Padding( |
| 254 | padding: const EdgeInsets. |
| 255 | child: isSelectingFlight |
| 256 | ? _buildFlightSelection(controller) |
| 257 | : isShowingFlight |
| 258 | ? _buildFlightInfoCard(controller, context) |
| 259 | : isLoadingFlight |
| 260 | ? _buildFlightInfoSkeleton() |
| 261 | : _buildSearchContent( |
| 262 | controller, |
| 263 | context, |
| 264 | ), |
| 265 | ), |
| 266 | ), |
| 267 | ), |
| 268 | ); |
| 269 | }, |
| 270 | ), |
| 271 | ], |
| 272 | ), |
| 273 | ); |
| 274 | } |
| 275 | |
| 276 | Widget _buildFlightSelection(HomeController |
| 277 | return FlightSelectionList( |
| 278 | flights: controller.flightSearchResults!.flights, |
| 279 | onFlightSelected: controller.handleFlightSelection, |
| 280 | onClose: controller.closeFlightSelection, |
| 281 | ); |
| 282 | } |
| 283 | |
| 284 | Widget _buildFlightInfoCard( |
| 285 | HomeController controller, |
| 286 | BuildContext context, |
| 287 | ) { |
| 288 | final info = controller.flightInfo! |
| 289 | return FlightInfoWidget( |
| 290 | info: info, |
| 291 | flightPositions: controller.flightPositions, |
| 292 | onRefreshFlightData: () { |
| 293 | controller.loadFlightInfo( |
| 294 | info.flightNo, |
| 295 | info.flightNo, |
| 296 | info.date.toLocal(), |
| 297 | forceUpdate: true, |
| 298 | ); |
| 299 | }, |
| 300 | onClose: controller.clearFlightContext, |
| 301 | onRefreshTracking: () { |
| 302 | controller.refreshTracking(); |
| 303 | ScaffoldMessenger.of(context).showSnackBar |
| 304 | const SnackBar( |
| 305 | content: Text('Tracking refreshed'), |
| 306 | duration: Duration(seconds: 2 |
| 307 | ), |
| 308 | ); |
| 309 | }, |
| 310 | onBookingDetails: _showBookingDetailsSheet, |
| 311 | ); |
| 312 | } |
| 313 | |
| 314 | Widget _buildSearchContent( |
| 315 | HomeController controller, |
| 316 | BuildContext context, |
| 317 | ) { |
| 318 | final selectedAirline = controller.selectedAirline; |
| 319 | final selectedFlightNumber = controller.selectedFlightNumber; |
| 320 | final departureAirport = controller.departureAirport; |
| 321 | final arrivalAirport = controller.arrivalAirport; |
| 322 | final selectedDate = controller.selectedDate; |
| 323 | final error = controller.error; |
| 324 | final searchEnabled = |
| 325 | !(departureAirport != null && arrivalAirport != |
| 326 | !(selectedAirline != null && selectedFlightNumber != |
| 327 | final showDateSelector = |
| 328 | ((departureAirport != null && arrivalAirport != null |
| 329 | (selectedAirline != null && selectedFlightNumber != null |
| 330 | (selectedDate == null || error != null |
| 331 | final flightController = controller.flightController; |
| 332 | |
| 333 | return Column( |
| 334 | crossAxisAlignment: CrossAxisAlignment.start, |
| 335 | children: [ |
| 336 | SearchHeader(), |
| 337 | Row( |
| 338 | children: [ |
| 339 | SelectedFilters( |
| 340 | onAirlineClear: controller.clearAirline, |
| 341 | onFlightNumberClear: controller.clearFlightNumber, |
| 342 | onAirportsClear: controller.clearAirports, |
| 343 | onDepartureAirportClear: controller.clearDepartureAirport, |
| 344 | selectedAirline: selectedAirline, |
| 345 | arrivalAirport: arrivalAirport, |
| 346 | departureAirport: departureAirport, |
| 347 | selectedFlightNumber: selectedFlightNumber, |
| 348 | ), |
| 349 | Expanded( |
| 350 | child: FlightSearchBar( |
| 351 | searchController: flightController, |
| 352 | isSearchEnabled: searchEnabled, |
| 353 | hintText: _buildSearchHint(controller), |
| 354 | onSearchChanged: (value) { |
| 355 | if (departureAirport != null && arrivalAirport != |
| 356 | return; |
| 357 | } |
| 358 | controller.clearError(); |
| 359 | controller.debounceSearch(value); |
| 360 | }, |
| 361 | ), |
| 362 | ), |
| 363 | ], |
| 364 | ), |
| 365 | const Gap(16) |
| 366 | if (arrivalAirport == null && |
| 367 | departureAirport == null && |
| 368 | selectedAirline != null && |
| 369 | selectedFlightNumber == null) |
| 370 | Padding( |
| 371 | padding: const EdgeInsets. |
| 372 | child: Text( |
| 373 | "Tip: For flight numbers like 6E1045, just enter 1045", |
| 374 | style: TextStyle( |
| 375 | fontSize: 12, |
| 376 | color: Colors.grey[600] |
| 377 | fontStyle: FontStyle.italic, |
| 378 | ), |
| 379 | ), |
| 380 | ), |
| 381 | if (error != null) _buildErrorBanner |
| 382 | if (showDateSelector) |
| 383 | DateSelectionList( |
| 384 | onDateSelected: (date) => controller.loadFlightsForSelection(date) |
| 385 | ), |
| 386 | if (selectedAirline != null && |
| 387 | flightController.text.isNotEmpty && |
| 388 | selectedFlightNumber == null) |
| 389 | ListTile( |
| 390 | title: Text(selectedAirline.name), |
| 391 | subtitle: Text( |
| 392 | "${selectedAirline.iata}${ |
| 393 | ), |
| 394 | leading: selectedAirline.image != null && |
| 395 | selectedAirline.image!.isNotEmpty |
| 396 | ? SvgPicture.network( |
| 397 | selectedAirline.image!, |
| 398 | width: 24, |
| 399 | height: 18, |
| 400 | ) |
| 401 | : CachedNetworkImage( |
| 402 | imageUrl: |
| 403 | "https://www.flightaware.com/images/airline_logos/180px/${selectedAirline.icao} |
| 404 | width: 24, |
| 405 | height: 18, |
| 406 | errorWidget: (context, url, error) => const |
| 407 | ), |
| 408 | onTap: () { |
| 409 | controller.selectFlightNumber(flightController.text); |
| 410 | FocusScope.of(context).unfocus |
| 411 | }, |
| 412 | ), |
| 413 | SearchResultsList( |
| 414 | results: controller.results, |
| 415 | loading: controller.searchState == SearchState |
| 416 | selectedAirline: selectedAirline, |
| 417 | selectedFlightNumber: selectedFlightNumber, |
| 418 | flightController: flightController, |
| 419 | onAirportSelected: (airport) { |
| 420 | controller.selectAirport(airport); |
| 421 | }, |
| 422 | onAirlineSelected: (airline) { |
| 423 | controller.selectAirline( |
| 424 | airline, |
| 425 | currentInput: flightController.text, |
| 426 | ); |
| 427 | }, |
| 428 | onFlightNumberSelected: (flightNumber) { |
| 429 | controller.selectFlightNumber(flightNumber); |
| 430 | FocusScope.of(context).unfocus |
| 431 | }, |
| 432 | ), |
| 433 | if (selectedAirline == null && |
| 434 | arrivalAirport == null && |
| 435 | departureAirport == null && |
| 436 | selectedFlightNumber == null && |
| 437 | controller.results.isEmpty && |
| 438 | controller.searchState == SearchState.idle |
| 439 | !controller.loadingTrackedFlights && |
| 440 | controller.trackedFlights.isNotEmpty) |
| 441 | TrackedFlightsList( |
| 442 | trackedFlights: controller.trackedFlights, |
| 443 | onFlightTap: (iata, icao, date, forceUpdate) => |
| 444 | controller.loadFlightInfo( |
| 445 | iata, |
| 446 | icao, |
| 447 | date, |
| 448 | forceUpdate: forceUpdate, |
| 449 | ), |
| 450 | ), |
| 451 | FlightsList( |
| 452 | flights: controller.flights, |
| 453 | selectedDate: controller.selectedDate, |
| 454 | onFlightTap: controller.loadFlightInfo, |
| 455 | ), |
| 456 | ], |
| 457 | ); |
| 458 | } |
| 459 | |
| 460 | Widget _buildErrorBanner(String |
| 461 | return Padding( |
| 462 | padding: const EdgeInsets. |
| 463 | child: Container( |
| 464 | padding: const EdgeInsets. |
| 465 | decoration: BoxDecoration( |
| 466 | color: Colors.red[50] |
| 467 | borderRadius: BorderRadius.circular( |
| 468 | border: Border.all( |
| 469 | color: Colors.red[200] |
| 470 | width: 1, |
| 471 | ), |
| 472 | ), |
| 473 | child: Row( |
| 474 | children: [ |
| 475 | Expanded( |
| 476 | child: Text( |
| 477 | message, |
| 478 | style: TextStyle( |
| 479 | color: Colors.red[900] |
| 480 | fontSize: 14, |
| 481 | ), |
| 482 | ), |
| 483 | ), |
| 484 | IconButton( |
| 485 | icon: Icon( |
| 486 | Icons.close, |
| 487 | size: 20, |
| 488 | color: Colors.red[900] |
| 489 | ), |
| 490 | onPressed: () { |
| 491 | _homeController.clearError(); |
| 492 | }, |
| 493 | padding: EdgeInsets.zero, |
| 494 | constraints: const BoxConstraints() |
| 495 | ), |
| 496 | ], |
| 497 | ), |
| 498 | ), |
| 499 | ); |
| 500 | } |
| 501 | |
| 502 | String _buildSearchHint(HomeController |
| 503 | if (controller.selectedFlightNumber != null) { |
| 504 | return "Select date"; |
| 505 | } |
| 506 | if (controller.selectedAirline != null && |
| 507 | controller.arrivalAirport == null && |
| 508 | controller.departureAirport == null) { |
| 509 | return "Flight No"; |
| 510 | } |
| 511 | if (controller.departureAirport == null) { |
| 512 | return "Search airline, flight or airport"; |
| 513 | } |
| 514 | if (controller.arrivalAirport == null) { |
| 515 | return "Search arrival airport"; |
| 516 | } |
| 517 | return "Select date"; |
| 518 | } |
| 519 | |
| 520 | Widget _buildFlightInfoSkeleton() { |
| 521 | return Padding( |
| 522 | padding: const EdgeInsets. |
| 523 | child: Column( |
| 524 | crossAxisAlignment: CrossAxisAlignment.start, |
| 525 | spacing: 4, |
| 526 | children: [ |
| 527 | // Header skeleton |
| 528 | Row( |
| 529 | spacing: 8, |
| 530 | crossAxisAlignment: CrossAxisAlignment.center, |
| 531 | children: [ |
| 532 | Container( |
| 533 | width: 30, |
| 534 | height: 30, |
| 535 | decoration: BoxDecoration( |
| 536 | color: Colors.grey[300] |
| 537 | borderRadius: BorderRadius.circular( |
| 538 | ), |
| 539 | ), |
| 540 | Column( |
| 541 | spacing: 2, |
| 542 | crossAxisAlignment: CrossAxisAlignment.start, |
| 543 | children: [ |
| 544 | Container( |
| 545 | width: 200, |
| 546 | height: 18, |
| 547 | decoration: BoxDecoration( |
| 548 | color: Colors.grey[300] |
| 549 | borderRadius: BorderRadius.circular( |
| 550 | ), |
| 551 | ), |
| 552 | const Gap(4) |
| 553 | Container( |
| 554 | width: 150, |
| 555 | height: 14, |
| 556 | decoration: BoxDecoration( |
| 557 | color: Colors.grey[300] |
| 558 | borderRadius: BorderRadius.circular( |
| 559 | ), |
| 560 | ), |
| 561 | ], |
| 562 | ), |
| 563 | Spacer(), |
| 564 | Container( |
| 565 | width: 24, |
| 566 | height: 24, |
| 567 | decoration: BoxDecoration( |
| 568 | color: Colors.grey[300] |
| 569 | borderRadius: BorderRadius.circular( |
| 570 | ), |
| 571 | ), |
| 572 | Container( |
| 573 | width: 24, |
| 574 | height: 24, |
| 575 | decoration: BoxDecoration( |
| 576 | color: Colors.grey[300] |
| 577 | borderRadius: BorderRadius.circular( |
| 578 | ), |
| 579 | ), |
| 580 | ], |
| 581 | ), |
| 582 | Divider(), |
| 583 | // Time message skeleton |
| 584 | Container( |
| 585 | width: 180, |
| 586 | height: 20, |
| 587 | decoration: BoxDecoration( |
| 588 | color: Colors.grey[300] |
| 589 | borderRadius: BorderRadius.circular( |
| 590 | ), |
| 591 | ), |
| 592 | const Gap(8) |
| 593 | // Route info skeleton |
| 594 | Container( |
| 595 | height: 120, |
| 596 | decoration: BoxDecoration( |
| 597 | color: Colors.grey[200] |
| 598 | borderRadius: BorderRadius.circular( |
| 599 | ), |
| 600 | child: Padding( |
| 601 | padding: const EdgeInsets. |
| 602 | child: Column( |
| 603 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 604 | children: [ |
| 605 | Row( |
| 606 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 607 | children: [ |
| 608 | Column( |
| 609 | crossAxisAlignment: CrossAxisAlignment.start, |
| 610 | children: [ |
| 611 | Container( |
| 612 | width: 60, |
| 613 | height: 12, |
| 614 | decoration: BoxDecoration( |
| 615 | color: Colors.grey[300] |
| 616 | borderRadius: BorderRadius.circular( |
| 617 | ), |
| 618 | ), |
| 619 | const Gap(8) |
| 620 | Container( |
| 621 | width: 80, |
| 622 | height: 24, |
| 623 | decoration: BoxDecoration( |
| 624 | color: Colors.grey[300] |
| 625 | borderRadius: BorderRadius.circular( |
| 626 | ), |
| 627 | ), |
| 628 | const Gap(4) |
| 629 | Container( |
| 630 | width: 100, |
| 631 | height: 14, |
| 632 | decoration: BoxDecoration( |
| 633 | color: Colors.grey[300] |
| 634 | borderRadius: BorderRadius.circular( |
| 635 | ), |
| 636 | ), |
| 637 | const Gap(4) |
| 638 | Container( |
| 639 | width: 70, |
| 640 | height: 16, |
| 641 | decoration: BoxDecoration( |
| 642 | color: Colors.grey[300] |
| 643 | borderRadius: BorderRadius.circular( |
| 644 | ), |
| 645 | ), |
| 646 | ], |
| 647 | ), |
| 648 | Column( |
| 649 | crossAxisAlignment: CrossAxisAlignment.end, |
| 650 | children: [ |
| 651 | Container( |
| 652 | width: 60, |
| 653 | height: 12, |
| 654 | decoration: BoxDecoration( |
| 655 | color: Colors.grey[300] |
| 656 | borderRadius: BorderRadius.circular( |
| 657 | ), |
| 658 | ), |
| 659 | const Gap(8) |
| 660 | Container( |
| 661 | width: 80, |
| 662 | height: 24, |
| 663 | decoration: BoxDecoration( |
| 664 | color: Colors.grey[300] |
| 665 | borderRadius: BorderRadius.circular( |
| 666 | ), |
| 667 | ), |
| 668 | const Gap(4) |
| 669 | Container( |
| 670 | width: 100, |
| 671 | height: 14, |
| 672 | decoration: BoxDecoration( |
| 673 | color: Colors.grey[300] |
| 674 | borderRadius: BorderRadius.circular( |
| 675 | ), |
| 676 | ), |
| 677 | const Gap(4) |
| 678 | Container( |
| 679 | width: 70, |
| 680 | height: 16, |
| 681 | decoration: BoxDecoration( |
| 682 | color: Colors.grey[300] |
| 683 | borderRadius: BorderRadius.circular( |
| 684 | ), |
| 685 | ), |
| 686 | ], |
| 687 | ), |
| 688 | ], |
| 689 | ), |
| 690 | ], |
| 691 | ), |
| 692 | ), |
| 693 | ), |
| 694 | const Gap(8) |
| 695 | // "Worth Noting" section skeleton |
| 696 | Container( |
| 697 | width: 100, |
| 698 | height: 18, |
| 699 | decoration: BoxDecoration( |
| 700 | color: Colors.grey[300] |
| 701 | borderRadius: BorderRadius.circular( |
| 702 | ), |
| 703 | ), |
| 704 | const Gap(8) |
| 705 | Container( |
| 706 | height: 60, |
| 707 | decoration: BoxDecoration( |
| 708 | color: Colors.grey[200] |
| 709 | borderRadius: BorderRadius.circular( |
| 710 | ), |
| 711 | ), |
| 712 | ], |
| 713 | ), |
| 714 | ); |
| 715 | } |
| 716 | } |