From f13f38402670a911cf40e70a4b275d17312501fc Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 14 Sep 2024 16:28:37 -0700 Subject: [PATCH 01/26] implemented cached network image --- lib/ui/common/image_loader.dart | 24 ++++++++------------ pubspec.lock | 40 +++++++++++++++++++++++++++++++++ pubspec.yaml | 1 + 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/lib/ui/common/image_loader.dart b/lib/ui/common/image_loader.dart index 87de46d20..2156d9b0a 100644 --- a/lib/ui/common/image_loader.dart +++ b/lib/ui/common/image_loader.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cached_network_image/cached_network_image.dart'; class ImageLoader extends StatelessWidget { final String? url; @@ -17,23 +18,16 @@ class ImageLoader extends StatelessWidget { width: 0, height: 0, ) - : Image.network( - url!, + : CachedNetworkImage( + imageUrl: url!, width: fullSize ? null : width, height: fullSize ? null : height, - loadingBuilder: (BuildContext context, Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: CircularProgressIndicator( - color: Theme.of(context).colorScheme.secondary, - value: loadingProgress.expectedTotalBytes != null - ? loadingProgress.cumulativeBytesLoaded / - loadingProgress.expectedTotalBytes! - : null, - ), - ); - }, + placeholder: (context, url) => Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + ), + ), + errorWidget: (context, url, error) => Icon(Icons.error), ); } } diff --git a/pubspec.lock b/pubspec.lock index f57345cc2..e4b323b93 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -161,6 +161,30 @@ packages: url: "https://pub.dev" source: hosted version: "8.6.1" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: fd3d0dc1d451f9a252b32d95d3f0c3c487bc41a75eba2e6097cb0b9c71491b15 + url: "https://pub.dev" + source: hosted + version: "3.2.3" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: bb2b8403b4ccdc60ef5f25c70dead1f3d32d24b9d6117cfc087f496b178594a7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: b8eb814ebfcb4dea049680f8c1ffb2df399e4d03bf7a352c775e26fa06e02fa0 + url: "https://pub.dev" + source: hosted + version: "1.0.2" characters: dependency: transitive description: @@ -446,6 +470,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" + url: "https://pub.dev" + source: hosted + version: "0.7.0" flutter_cache_manager: dependency: transitive description: @@ -867,6 +899,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" + url: "https://pub.dev" + source: hosted + version: "1.0.2" package_config: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b99b568b7..ad9fa854d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -55,6 +55,7 @@ dependencies: just_audio: ^0.9.31 just_audio_background: ^0.0.1-beta.9 device_info_plus: ^9.1.2 + cached_network_image: ^3.2.3 dev_dependencies: build_runner: 2.0.2 flutter_test: From 1087f7b6f241d4c80935e8338350f472b8e82d8b Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Fri, 20 Sep 2024 13:04:07 -0700 Subject: [PATCH 02/26] finished implementing imagecacheloading --- lib/ui/common/image_loader.dart | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/ui/common/image_loader.dart b/lib/ui/common/image_loader.dart index 2156d9b0a..f2813f468 100644 --- a/lib/ui/common/image_loader.dart +++ b/lib/ui/common/image_loader.dart @@ -22,11 +22,14 @@ class ImageLoader extends StatelessWidget { imageUrl: url!, width: fullSize ? null : width, height: fullSize ? null : height, - placeholder: (context, url) => Center( - child: CircularProgressIndicator( - color: Theme.of(context).colorScheme.secondary, - ), - ), + progressIndicatorBuilder: (context, url, downloadProgress) { + return Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + value: downloadProgress.progress, + ), + ); + }, errorWidget: (context, url, error) => Icon(Icons.error), ); } From ae9de03923b2171ee505ca5144ae8e04285eb151 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Fri, 20 Sep 2024 15:16:06 -0700 Subject: [PATCH 03/26] fixed some small ui --- lib/ui/shuttle/shuttle_card.dart | 13 ++++--------- lib/ui/shuttle/shuttle_display.dart | 2 +- lib/ui/wifi/wifi_card.dart | 4 ++-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/ui/shuttle/shuttle_card.dart b/lib/ui/shuttle/shuttle_card.dart index 454e18140..4d2db6c32 100644 --- a/lib/ui/shuttle/shuttle_card.dart +++ b/lib/ui/shuttle/shuttle_card.dart @@ -51,13 +51,12 @@ class _ShuttleCardState extends State { List renderList = []; try { if (_shuttleCardDataProvider.closestStop != null) { - print("CLOSEST STOP"); + print("CLOSEST STOP:"); print(_shuttleCardDataProvider.closestStop!.name); - renderList.add(ShuttleDisplay( stop: _shuttleCardDataProvider.closestStop, - arrivingShuttles: - arrivalsToRender![_shuttleCardDataProvider.closestStop!.id])); + arrivingShuttles: arrivalsToRender![_shuttleCardDataProvider.closestStop!.id] + )); } for (int i = 0; i < _shuttleCardDataProvider.stopsToRender.length; i++) { @@ -69,11 +68,7 @@ class _ShuttleCardState extends State { // Initialize first shuttle display with arrival information if (renderList.isEmpty) { - // if (stopsToRender.isEmpty) { - return Padding( - padding: const EdgeInsets.only(bottom: 42.0), - child: Center(child: Text('No shuttles found. Please add a stop.')), - ); + return Center(child: Text('No shuttles found. Please add a stop.')); } return Column( diff --git a/lib/ui/shuttle/shuttle_display.dart b/lib/ui/shuttle/shuttle_display.dart index 6c8fa0716..9a54f42f9 100644 --- a/lib/ui/shuttle/shuttle_display.dart +++ b/lib/ui/shuttle/shuttle_display.dart @@ -159,7 +159,7 @@ class ShuttleDisplay extends StatelessWidget { Widget whetherNextArrivals() { if (arrivingShuttles!.length <= 1) { - return Text(""); + return Text("No future arrivals."); } else { return Row( mainAxisAlignment: MainAxisAlignment.start, diff --git a/lib/ui/wifi/wifi_card.dart b/lib/ui/wifi/wifi_card.dart index ded4cfc77..e553fa2e5 100644 --- a/lib/ui/wifi/wifi_card.dart +++ b/lib/ui/wifi/wifi_card.dart @@ -504,7 +504,7 @@ class _WiFiCardState extends State child: Text( "Connect to a UCSD Network", style: TextStyle( - fontSize: 25, + fontSize: 22, ), textAlign: TextAlign.center, ), @@ -513,7 +513,7 @@ class _WiFiCardState extends State padding: EdgeInsets.all(4.0), elevation: 0.0, onPressed: () => tryAgain(), - minWidth: 350, + minWidth: 300, height: 40, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5.0), From 93f76e29340bf4dbb8af98c735ca980437806549 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Fri, 20 Sep 2024 15:57:44 -0700 Subject: [PATCH 04/26] cached the image of events, scanner, and myCHart --- lib/ui/events/event_tile.dart | 25 ++++++++++------------- lib/ui/events/events_list.dart | 4 ---- lib/ui/events/events_view_all.dart | 4 +--- lib/ui/mystudentchart/mystudentchart.dart | 7 +++++-- lib/ui/scanner/native_scanner_card.dart | 4 ++-- 5 files changed, 19 insertions(+), 25 deletions(-) diff --git a/lib/ui/events/event_tile.dart b/lib/ui/events/event_tile.dart index 2817014ac..5ebf7969c 100644 --- a/lib/ui/events/event_tile.dart +++ b/lib/ui/events/event_tile.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/app_constants.dart'; import 'package:campus_mobile_experimental/core/models/events.dart'; import 'package:campus_mobile_experimental/core/providers/events.dart'; @@ -22,7 +23,7 @@ class EventTile extends StatelessWidget { Widget buildEventTile(BuildContext context) { return Container( width: tileWidth, - height: 300, + height: 285, margin: EdgeInsets.zero, child: InkWell( onTap: () { @@ -78,28 +79,24 @@ class EventTile extends StatelessWidget { ? Container( child: Image( image: AssetImage('assets/images/UCSDMobile_sharp.png'), - height: 150, + height: 125, width: tileWidth, fit: BoxFit.fill, )) - : Image.network( - url, - loadingBuilder: (BuildContext context, Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; + : CachedNetworkImage( + imageUrl: url, + height: 125, + width: tileWidth, + fit: BoxFit.fill, + progressIndicatorBuilder: (context, url, downloadProgress) { return Center( child: CircularProgressIndicator( color: Theme.of(context).colorScheme.secondary, - value: loadingProgress.expectedTotalBytes != null - ? loadingProgress.cumulativeBytesLoaded / - loadingProgress.expectedTotalBytes! - : null, + value: downloadProgress.progress, ), ); }, - fit: BoxFit.fill, - height: 150, - width: tileWidth, + errorWidget: (context, url, error) => Icon(Icons.error), ); } diff --git a/lib/ui/events/events_list.dart b/lib/ui/events/events_list.dart index 19d0daf50..736dbeab5 100644 --- a/lib/ui/events/events_list.dart +++ b/lib/ui/events/events_list.dart @@ -64,9 +64,5 @@ class EventsList extends StatelessWidget { : EventsAll(), ); } - // ListView( - // children: - // ListTile.divideTiles(tiles: eventTiles, context: context) - // .toList(), } } diff --git a/lib/ui/events/events_view_all.dart b/lib/ui/events/events_view_all.dart index 3fb6b56bb..c05133ccd 100644 --- a/lib/ui/events/events_view_all.dart +++ b/lib/ui/events/events_view_all.dart @@ -30,11 +30,9 @@ class EventsAll extends StatelessWidget { if (listOfEvents.length > 0) { return GridView.count( crossAxisCount: 2, - crossAxisSpacing: 1, - mainAxisSpacing: 8, children: eventTiles, childAspectRatio: MediaQuery.of(context).size.width / - (MediaQuery.of(context).size.height / 1.4), + (MediaQuery.of(context).size.height / 1.6), ); } else { return ContainerView( diff --git a/lib/ui/mystudentchart/mystudentchart.dart b/lib/ui/mystudentchart/mystudentchart.dart index 3ea96db4a..d43906093 100644 --- a/lib/ui/mystudentchart/mystudentchart.dart +++ b/lib/ui/mystudentchart/mystudentchart.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/app_constants.dart'; import 'package:campus_mobile_experimental/core/providers/cards.dart'; import 'package:campus_mobile_experimental/ui/common/card_container.dart'; @@ -32,10 +33,12 @@ class MyStudentChartCard extends StatelessWidget { child: Row( children: [ Container( - child: Image.asset( - 'assets/images/MyChartLogo.png', + child: CachedNetworkImage( + imageUrl: 'assets/images/MyChartLogo.png', fit: BoxFit.contain, height: 56, + placeholder: (context, url) => CircularProgressIndicator(), + errorWidget: (context, url, error) => Icon(Icons.error), ), padding: EdgeInsets.only( left: 10, diff --git a/lib/ui/scanner/native_scanner_card.dart b/lib/ui/scanner/native_scanner_card.dart index b09792282..ffeaf0ff4 100644 --- a/lib/ui/scanner/native_scanner_card.dart +++ b/lib/ui/scanner/native_scanner_card.dart @@ -37,8 +37,8 @@ class NativeScannerCard extends StatelessWidget { child: Row( children: [ Container( - child: Image.asset( - 'assets/images/QRScanIcon.png', + child: Image( + image: AssetImage('assets/images/QRScanIcon.png'), fit: BoxFit.contain, height: 56, ), From 542be64fb7d2a709725a75a7507b8f8b91996b4d Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 13:36:47 -0700 Subject: [PATCH 05/26] implemented ListView.builder in the media card. Also removed unused variable in wifi card --- lib/ui/triton_media/triton_media_list.dart | 56 +++++++++------------- lib/ui/wifi/wifi_card.dart | 2 - 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/lib/ui/triton_media/triton_media_list.dart b/lib/ui/triton_media/triton_media_list.dart index 6dee4c7a8..4bb29becb 100644 --- a/lib/ui/triton_media/triton_media_list.dart +++ b/lib/ui/triton_media/triton_media_list.dart @@ -15,46 +15,36 @@ class MediaList extends StatelessWidget { Widget build(BuildContext context) { return Provider.of(context).isLoading! ? Center( - child: CircularProgressIndicator( - color: Theme.of(context).colorScheme.secondary)) + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary)) : buildMediaList( - Provider.of(context).mediaModels!, context); + Provider.of(context).mediaModels!, context); } Widget buildMediaList(List listOfMedia, BuildContext context) { - final List mediaTiles = []; + // Determine the number of items to show + int size = listSize ?? 3; // If listSize is null, default to 3 - /// check to see if we want to display only a limited number of elements - /// if no constraint is given on the size of the list then all elements - /// are rendered - var size; - if (listSize == null) { - size = 3; - } else - size = listSize; - - /// check to see if we have at least 3 events - if (size > listOfMedia.length) { - size = listOfMedia.length; - } - - for (int i = 0; i < size; i++) { - final MediaModel item = listOfMedia[i]; - final tile = MediaTile(data: item); - final spacer = SizedBox( - width: 5, - ); - mediaTiles.add(tile); - mediaTiles.add(spacer); - } + // check to see if we want to display only a limited number of elements + // if no constraint is given on the size of the list then all elements are rendered + size = size > listOfMedia.length ? listOfMedia.length : size; // Handle case where size exceeds list length if (listSize != null) { - return SingleChildScrollView( - physics: BouncingScrollPhysics(), - scrollDirection: Axis.horizontal, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: mediaTiles, + // check to see if we have at least 3 events + return SizedBox( + height: 250, // Set an appropriate height for the horizontal list + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: size, + itemBuilder: (context, index) { + final MediaModel item = listOfMedia[index]; + return Row( + children: [ + MediaTile(data: item), + SizedBox(width: 5), // Spacer between tiles + ], + ); + }, ), ); } else { diff --git a/lib/ui/wifi/wifi_card.dart b/lib/ui/wifi/wifi_card.dart index e553fa2e5..39c6e90ba 100644 --- a/lib/ui/wifi/wifi_card.dart +++ b/lib/ui/wifi/wifi_card.dart @@ -4,7 +4,6 @@ import 'package:campus_mobile_experimental/app_constants.dart'; import 'package:campus_mobile_experimental/app_styles.dart'; import 'package:campus_mobile_experimental/core/providers/cards.dart'; import 'package:campus_mobile_experimental/core/providers/speed_test.dart'; -import 'package:campus_mobile_experimental/core/providers/user.dart'; import 'package:campus_mobile_experimental/ui/common/card_container.dart'; import 'package:flutter/material.dart'; import 'package:liquid_progress_indicator/liquid_progress_indicator.dart'; @@ -25,7 +24,6 @@ class _WiFiCardState extends State late bool goodSpeed; bool timedOut = false; SpeedTestProvider _speedTestProvider = SpeedTestProvider(); - UserDataProvider? _userDataProvider; bool _buttonEnabled = true; Timer? buttonTimer; static const int SPEED_TEST_TIMEOUT_CONST = 30; From 87bc70660139205426e0d66c5d5727d778ddefd8 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 13:57:18 -0700 Subject: [PATCH 06/26] implemented cachedNetworkImage to weather card --- lib/ui/weather/weather_card.dart | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/ui/weather/weather_card.dart b/lib/ui/weather/weather_card.dart index b6df6e57e..6164282dc 100644 --- a/lib/ui/weather/weather_card.dart +++ b/lib/ui/weather/weather_card.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/app_constants.dart'; import 'package:campus_mobile_experimental/core/models/weather.dart'; import 'package:campus_mobile_experimental/core/providers/cards.dart'; @@ -42,7 +43,8 @@ class WeatherCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ GestureDetector( - onTap: () => openLink('https://developer.apple.com/weatherkit/data-source-attribution/'), + onTap: () => openLink( + 'https://developer.apple.com/weatherkit/data-source-attribution/'), child: Text( "Weather Attribution", style: TextStyle( @@ -128,11 +130,12 @@ class WeatherCard extends StatelessWidget { child: Column( children: [ Text(getDayOfWeek(data.time!)), - Image.network( - WEATHER_ICON_BASE_URL + data.icon! + '.png', - width: 35, - height: 35, - ), + CachedNetworkImage( + imageUrl: WEATHER_ICON_BASE_URL + data.icon! + '.png', + width: 35, + height: 35, + placeholder: (context, url) => CircularProgressIndicator(), + errorWidget: (context, url, error) => Icon(Icons.error)), Text(data.temperatureHigh!.round().toString() + '\u00B0'), Text(data.temperatureLow!.round().toString() + '\u00B0'), ], @@ -145,11 +148,12 @@ class WeatherCard extends StatelessWidget { return Container( child: Row( children: [ - Image.network( - WEATHER_ICON_BASE_URL + data.icon! + '.png', - width: 110, - height: 110, - ), + CachedNetworkImage( + imageUrl: WEATHER_ICON_BASE_URL + data.icon! + '.png', + width: 110, + height: 110, + placeholder: (context, url) => CircularProgressIndicator(), + errorWidget: (context, url, error) => Icon(Icons.error)), Expanded( child: ListTile( title: Text( From 0fd24cae1f165f8693264040421b55fce830b138 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 14:16:59 -0700 Subject: [PATCH 07/26] implemented cache image to student id --- lib/ui/student_id/student_id_card.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ui/student_id/student_id_card.dart b/lib/ui/student_id/student_id_card.dart index 7a30c9a23..7b1843bb6 100644 --- a/lib/ui/student_id/student_id_card.dart +++ b/lib/ui/student_id/student_id_card.dart @@ -1,4 +1,5 @@ import 'package:barcode_widget/barcode_widget.dart'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/app_constants.dart'; import 'package:campus_mobile_experimental/app_styles.dart'; import 'package:campus_mobile_experimental/core/models/student_id_name.dart'; @@ -106,10 +107,11 @@ class _StudentIdCardState extends State { left: cardMargin * 1.5, right: cardMargin * 1.5)), Column( children: [ - Image.network( - photoModel!.photoUrl!, + CachedNetworkImage( + imageUrl: photoModel!.photoUrl!, fit: BoxFit.contain, height: ScalingUtility.verticalSafeBlock * 14, + errorWidget: (context, url, error) => Icon(Icons.error), ), SizedBox( height: ScalingUtility.verticalSafeBlock * 1.5, @@ -255,10 +257,12 @@ class _StudentIdCardState extends State { Container( child: Column( children: [ - Image.network( - photoModel!.photoUrl!, + CachedNetworkImage( + imageUrl: photoModel!.photoUrl!, fit: BoxFit.contain, height: 125, + placeholder: (context, url) => CircularProgressIndicator(), + errorWidget: (context, url, error) => Icon(Icons.error), ), SizedBox(height: 10), Text(profileModel!.classificationType!), From e0314ae2d81c7704267aca0bc53e8fb830b48579 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 14:41:31 -0700 Subject: [PATCH 08/26] implemented pageView.builder in shuttle card --- lib/ui/shuttle/shuttle_card.dart | 81 +++++++++++++------------------- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/lib/ui/shuttle/shuttle_card.dart b/lib/ui/shuttle/shuttle_card.dart index 4d2db6c32..146fa8398 100644 --- a/lib/ui/shuttle/shuttle_card.dart +++ b/lib/ui/shuttle/shuttle_card.dart @@ -48,62 +48,45 @@ class _ShuttleCardState extends State { print("Stops - ${stopsToRender.length}"); print("Arrivals - ${arrivalsToRender?.length}"); - List renderList = []; - try { - if (_shuttleCardDataProvider.closestStop != null) { - print("CLOSEST STOP:"); - print(_shuttleCardDataProvider.closestStop!.name); - renderList.add(ShuttleDisplay( - stop: _shuttleCardDataProvider.closestStop, - arrivingShuttles: arrivalsToRender![_shuttleCardDataProvider.closestStop!.id] - )); - } - - for (int i = 0; i < _shuttleCardDataProvider.stopsToRender.length; i++) { - renderList.add(ShuttleDisplay( - stop: _shuttleCardDataProvider.stopsToRender[i], - arrivingShuttles: arrivalsToRender![ - _shuttleCardDataProvider.stopsToRender[i].id])); - } - - // Initialize first shuttle display with arrival information - if (renderList.isEmpty) { - return Center(child: Text('No shuttles found. Please add a stop.')); - } + // Handle the case where there are no stops to display + if (stopsToRender.isEmpty) { + return Center(child: Text('No shuttles found. Please add a stop.')); + } - return Column( - children: [ - Flexible( - child: PageView( - controller: _controller, - children: renderList, - onPageChanged: (index) async { - // print(index); - }, - ), - ), - DotsIndicator( + // Lazy loading by using PageView.builder + return Column( + children: [ + Flexible( + child: PageView.builder( controller: _controller, - itemCount: renderList.length, - onPageSelected: (int index) { - _controller.animateToPage(index, - duration: Duration(seconds: 1), curve: Curves.ease); + itemCount: stopsToRender.length, + itemBuilder: (context, index) { + final stop = stopsToRender[index]; + final arrivingShuttles = arrivalsToRender?[stop?.id]; + + return ShuttleDisplay( + stop: stop, + arrivingShuttles: arrivingShuttles, + ); + }, + onPageChanged: (index) { + // Optional: Handle page change if needed }, - ) - ], - ); - } catch (e) { - return Container( - width: double.infinity, - child: Center( - child: Container( - child: Text('An error occurred, please try again.' + e.toString()), ), ), - ); - } + DotsIndicator( + controller: _controller, + itemCount: stopsToRender.length, + onPageSelected: (int index) { + _controller.animateToPage(index, + duration: Duration(seconds: 1), curve: Curves.ease); + }, + ), + ], + ); } + List buildActionButtons() { List actionButtons = []; actionButtons.add(TextButton( From 0cbe57b14b653b520b65e774e38b434626466f3b Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 16:39:58 -0700 Subject: [PATCH 09/26] implemented pageVIew.builder in parking card --- lib/ui/parking/parking_card.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ui/parking/parking_card.dart b/lib/ui/parking/parking_card.dart index e39ed342a..39b9c28ba 100644 --- a/lib/ui/parking/parking_card.dart +++ b/lib/ui/parking/parking_card.dart @@ -77,9 +77,12 @@ class _ParkingCardState extends State { return Column( children: [ Expanded( - child: PageView( + child: PageView.builder( controller: _controller, - children: selectedLotsViews, + itemCount: selectedLotsViews.length, + itemBuilder: (context, index) { + return selectedLotsViews[index]; + }, ), ), DotsIndicator( From b763805e64f61984d58e3c215beb866b3a93d583 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 16:52:08 -0700 Subject: [PATCH 10/26] implemented cached image to notices card --- lib/ui/notices/notices_card.dart | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/lib/ui/notices/notices_card.dart b/lib/ui/notices/notices_card.dart index f292b4310..3ce1fcf83 100644 --- a/lib/ui/notices/notices_card.dart +++ b/lib/ui/notices/notices_card.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/app_styles.dart'; import 'package:campus_mobile_experimental/core/models/notices.dart'; import 'package:campus_mobile_experimental/ui/common/image_loader.dart'; @@ -24,17 +25,25 @@ class NoticesCard extends StatelessWidget { Widget buildBannerView(NoticesModel notice) { // The screen reader will read - "image - (text on the image)" return Semantics( - label: notice.title, - image: true, - button: true, - child: GestureDetector( - onTap: () { - openLink(notice.link!); - }, - child: ImageLoader( - url: notice.imageUrl, - fullSize: true, - )), + label: notice.title, + image: true, + button: true, + child: GestureDetector( + onTap: () { + openLink(notice.link!); + }, + child: CachedNetworkImage( + imageUrl: notice.imageUrl!, + progressIndicatorBuilder: (context, url, downloadProgress) => + Center( + child: CircularProgressIndicator( + value: downloadProgress.progress, + color: Theme.of(context).colorScheme.secondary, + ), + ), + errorWidget: (context, url, error) => Icon(Icons.error), + ) + ) ); } From 8f255401aef4a7e3eda9ea994626c592d492517b Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 17:09:58 -0700 Subject: [PATCH 11/26] implemented listview builder to the news card and imageLoader to the notices card --- lib/ui/news/news_list.dart | 32 +++++++++++++++----------------- lib/ui/notices/notices_card.dart | 13 +++---------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/lib/ui/news/news_list.dart b/lib/ui/news/news_list.dart index 7e7718db0..e613ac629 100644 --- a/lib/ui/news/news_list.dart +++ b/lib/ui/news/news_list.dart @@ -27,33 +27,31 @@ class NewsList extends StatelessWidget { Widget buildNewsList(BuildContext context, NewsModel data) { final List? listOfNews = data.items; - final List newsTiles = []; - /// check to see if we want to display only a limited number of elements - /// if no constraint is given on the size of the list then all elements - /// are rendered + /// Check to see if we want to display only a limited number of elements + /// If no constraint is given on the size of the list, all elements are rendered var size; if (listSize == null) size = listOfNews!.length; - else - size = listSize; - for (int i = 0; i < size; i++) { - final Item item = listOfNews![i]; - final tile = buildNewsTile(item, context); - newsTiles.add(tile); - } + else size = listSize; return listSize != null - ? ListView( + ? ListView.builder( physics: NeverScrollableScrollPhysics(), shrinkWrap: true, - children: ListTile.divideTiles(tiles: newsTiles, context: context) - .toList(), + itemCount: size, + itemBuilder: (context, index) { + final Item item = listOfNews![index]; + return buildNewsTile(item, context); + }, ) : ContainerView( - child: ListView( - children: ListTile.divideTiles(tiles: newsTiles, context: context) - .toList(), + child: ListView.builder( + itemCount: size, + itemBuilder: (context, index) { + final Item item = listOfNews![index]; + return buildNewsTile(item, context); + }, ), ); } diff --git a/lib/ui/notices/notices_card.dart b/lib/ui/notices/notices_card.dart index 3ce1fcf83..c39fa9d72 100644 --- a/lib/ui/notices/notices_card.dart +++ b/lib/ui/notices/notices_card.dart @@ -32,16 +32,9 @@ class NoticesCard extends StatelessWidget { onTap: () { openLink(notice.link!); }, - child: CachedNetworkImage( - imageUrl: notice.imageUrl!, - progressIndicatorBuilder: (context, url, downloadProgress) => - Center( - child: CircularProgressIndicator( - value: downloadProgress.progress, - color: Theme.of(context).colorScheme.secondary, - ), - ), - errorWidget: (context, url, error) => Icon(Icons.error), + child: ImageLoader( + url: notice.imageUrl, + fullSize: true, ) ) ); From 0cfa9e23b8e50e021e37c15db14ac5825ad5d126 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sat, 21 Sep 2024 17:33:37 -0700 Subject: [PATCH 12/26] fixed employee_id card and finals card --- lib/ui/employee_id/employee_id_card.dart | 9 +++++---- lib/ui/finals/finals_card.dart | 10 ++++++++-- lib/ui/mystudentchart/mystudentchart.dart | 6 ++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/ui/employee_id/employee_id_card.dart b/lib/ui/employee_id/employee_id_card.dart index 62b243019..122041326 100644 --- a/lib/ui/employee_id/employee_id_card.dart +++ b/lib/ui/employee_id/employee_id_card.dart @@ -1,4 +1,5 @@ import 'package:barcode_widget/barcode_widget.dart'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/app_constants.dart'; import 'package:campus_mobile_experimental/app_styles.dart'; import 'package:campus_mobile_experimental/core/models/employee_id.dart'; @@ -103,8 +104,8 @@ class _EmployeeIdCardState extends State { left: cardMargin * 1.5, right: cardMargin * 1.5)), Column( children: [ - Image.network( - employeeIdModel!.photo.contains("https") + CachedNetworkImage( + imageUrl: employeeIdModel!.photo.contains("https") ? employeeIdModel.photo : placeholderPhotoUrl, fit: BoxFit.contain, @@ -240,8 +241,8 @@ class _EmployeeIdCardState extends State { Container( child: Column( children: [ - Image.network( - employeeIdModel!.photo.contains("https") + CachedNetworkImage( + imageUrl: employeeIdModel!.photo.contains("https") ? employeeIdModel.photo : placeholderPhotoUrl, fit: BoxFit.contain, diff --git a/lib/ui/finals/finals_card.dart b/lib/ui/finals/finals_card.dart index 24889f25a..e4e776720 100644 --- a/lib/ui/finals/finals_card.dart +++ b/lib/ui/finals/finals_card.dart @@ -64,6 +64,7 @@ class FinalsCard extends StatelessWidget { Widget buildFinalsCard(Map> finalsData, DateTime? lastUpdated, String? nextDayWithClasses, BuildContext context) { try { + // Flatten the data into a single list of ListTile widgets List listToReturn = []; finalsData.forEach((key, value) { for (SectionData data in value) { @@ -81,6 +82,7 @@ class FinalsCard extends StatelessWidget { )); } }); + listToReturn = ListTile.divideTiles(tiles: listToReturn, context: context).toList(); listToReturn.add( @@ -89,9 +91,13 @@ class FinalsCard extends StatelessWidget { child: LastUpdatedWidget(time: lastUpdated), ), ); - return ListView( + + return ListView.builder( physics: NeverScrollableScrollPhysics(), - children: listToReturn, + itemCount: listToReturn.length, + itemBuilder: (context, index) { + return listToReturn[index]; + }, shrinkWrap: true, ); } catch (e) { diff --git a/lib/ui/mystudentchart/mystudentchart.dart b/lib/ui/mystudentchart/mystudentchart.dart index d43906093..e43c315a4 100644 --- a/lib/ui/mystudentchart/mystudentchart.dart +++ b/lib/ui/mystudentchart/mystudentchart.dart @@ -33,12 +33,10 @@ class MyStudentChartCard extends StatelessWidget { child: Row( children: [ Container( - child: CachedNetworkImage( - imageUrl: 'assets/images/MyChartLogo.png', + child: Image.asset( + 'assets/images/MyChartLogo.png', fit: BoxFit.contain, height: 56, - placeholder: (context, url) => CircularProgressIndicator(), - errorWidget: (context, url, error) => Icon(Icons.error), ), padding: EdgeInsets.only( left: 10, From 476b0d38952f0613f9e34d5d37128e0ca02bb304 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:05:19 -0700 Subject: [PATCH 13/26] resized shuttle card --- lib/ui/common/card_container.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/common/card_container.dart b/lib/ui/common/card_container.dart index 73a045c1d..4fb17787c 100644 --- a/lib/ui/common/card_container.dart +++ b/lib/ui/common/card_container.dart @@ -133,7 +133,7 @@ class CardContainer extends StatelessWidget { // web cards are still sized with static values return Container( width: double.infinity, - constraints: BoxConstraints(minHeight: cardMinHeight, maxHeight: 340), + constraints: BoxConstraints(minHeight: cardMinHeight, maxHeight: 260), child: child(), ); } else if (titleText == "Parking") { From 22f634f84e94daa92793b925e0e074c670f347bc Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:05:41 -0700 Subject: [PATCH 14/26] implemented lazy loading in dinning card --- lib/ui/dining/dining_list.dart | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/ui/dining/dining_list.dart b/lib/ui/dining/dining_list.dart index 9971c1efa..d90d17dfd 100644 --- a/lib/ui/dining/dining_list.dart +++ b/lib/ui/dining/dining_list.dart @@ -26,34 +26,32 @@ class DiningList extends StatelessWidget { } Widget buildDiningList(List listOfDiners, BuildContext context) { - final List diningTiles = []; - /// check to see if we want to display only a limited number of elements /// if no constraint is given on the size of the list then all elements - /// are rendered + /// are rendered Lazily var size; if (listSize == null) size = listOfDiners.length; else size = listSize; - for (int i = 0; i < size; i++) { - final DiningModel item = listOfDiners[i]; - final tile = buildDiningTile(item, context); - diningTiles.add(tile); - } return listSize != null - ? ListView( + ? ListView.builder( physics: NeverScrollableScrollPhysics(), shrinkWrap: true, - children: ListTile.divideTiles(tiles: diningTiles, context: context) - .toList(), + itemCount: size, + itemBuilder: (context, index) { + final DiningModel item = listOfDiners[index]; + return buildDiningTile(item, context); + }, ) : ContainerView( - child: ListView( - children: - ListTile.divideTiles(tiles: diningTiles, context: context) - .toList(), + child: ListView.builder( + itemCount: size, + itemBuilder: (context, index) { + final DiningModel item = listOfDiners[index]; + return buildDiningTile(item, context); + }, ), ); } From d31b64f848e5b94a8b09024cf62fe708d9721fcf Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:06:01 -0700 Subject: [PATCH 15/26] fixed loading indicator in student id --- lib/ui/student_id/student_id_card.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/ui/student_id/student_id_card.dart b/lib/ui/student_id/student_id_card.dart index 7b1843bb6..6eafcf6c3 100644 --- a/lib/ui/student_id/student_id_card.dart +++ b/lib/ui/student_id/student_id_card.dart @@ -111,6 +111,14 @@ class _StudentIdCardState extends State { imageUrl: photoModel!.photoUrl!, fit: BoxFit.contain, height: ScalingUtility.verticalSafeBlock * 14, + progressIndicatorBuilder: (context, url, downloadProgress) { + return Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + value: downloadProgress.progress, + ), + ); + }, errorWidget: (context, url, error) => Icon(Icons.error), ), SizedBox( @@ -261,7 +269,14 @@ class _StudentIdCardState extends State { imageUrl: photoModel!.photoUrl!, fit: BoxFit.contain, height: 125, - placeholder: (context, url) => CircularProgressIndicator(), + progressIndicatorBuilder: (context, url, downloadProgress) { + return Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + value: downloadProgress.progress, + ), + ); + }, errorWidget: (context, url, error) => Icon(Icons.error), ), SizedBox(height: 10), From 81d699145e40fb94f9eaded8d6e416c26a5ca80f Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:06:17 -0700 Subject: [PATCH 16/26] fixed loading indicator in wheather card --- lib/ui/weather/weather_card.dart | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/ui/weather/weather_card.dart b/lib/ui/weather/weather_card.dart index 6164282dc..0249df64d 100644 --- a/lib/ui/weather/weather_card.dart +++ b/lib/ui/weather/weather_card.dart @@ -134,7 +134,14 @@ class WeatherCard extends StatelessWidget { imageUrl: WEATHER_ICON_BASE_URL + data.icon! + '.png', width: 35, height: 35, - placeholder: (context, url) => CircularProgressIndicator(), + progressIndicatorBuilder: (context, url, downloadProgress) { + return Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + value: downloadProgress.progress, + ), + ); + }, errorWidget: (context, url, error) => Icon(Icons.error)), Text(data.temperatureHigh!.round().toString() + '\u00B0'), Text(data.temperatureLow!.round().toString() + '\u00B0'), @@ -152,7 +159,14 @@ class WeatherCard extends StatelessWidget { imageUrl: WEATHER_ICON_BASE_URL + data.icon! + '.png', width: 110, height: 110, - placeholder: (context, url) => CircularProgressIndicator(), + progressIndicatorBuilder: (context, url, downloadProgress) { + return Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + value: downloadProgress.progress, + ), + ); + }, errorWidget: (context, url, error) => Icon(Icons.error)), Expanded( child: ListTile( From ad3e7f25f06e21ccd9d0e2f5e4a997f08b5d4245 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:06:48 -0700 Subject: [PATCH 17/26] fixed media card --- .../triton_media_detail_view.dart | 26 ++++++++++++++++--- lib/ui/triton_media/triton_media_tile.dart | 15 ++++------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/lib/ui/triton_media/triton_media_detail_view.dart b/lib/ui/triton_media/triton_media_detail_view.dart index 2773b3efa..583cbf050 100644 --- a/lib/ui/triton_media/triton_media_detail_view.dart +++ b/lib/ui/triton_media/triton_media_detail_view.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/core/models/triton_media.dart'; import 'package:campus_mobile_experimental/core/providers/triton_media.dart'; import 'package:campus_mobile_experimental/ui/common/container_view.dart'; @@ -98,7 +99,19 @@ class _MediaDetailView extends State { Padding( padding: const EdgeInsets.all(40.0), child: Center( - child: Image.network(metadata.artUri.toString())), + child: CachedNetworkImage( + imageUrl: metadata.artUri.toString(), + progressIndicatorBuilder: + (context, url, downloadProgress) { + return Center( + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + value: downloadProgress.progress, + ), + ); + }, + errorWidget: (context, url, error) => Icon(Icons.error), + )), ), Text( metadata.title, @@ -156,7 +169,8 @@ class BroadcastScheduleButton extends StatelessWidget { child: Text( 'Broadcast Schedule', style: TextStyle( - fontSize: 16, color: Theme.of(context).textTheme.labelLarge!.color), + fontSize: 16, + color: Theme.of(context).textTheme.labelLarge!.color), ), onPressed: () async { try { @@ -193,7 +207,9 @@ class RadioControlButtons extends StatelessWidget { margin: const EdgeInsets.all(8.0), width: 64.0, height: 64.0, - child: const CircularProgressIndicator(), + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + ), ); } else if (playing != true) { return IconButton( @@ -265,7 +281,9 @@ class ControlButtons extends StatelessWidget { margin: const EdgeInsets.all(8.0), width: 64.0, height: 64.0, - child: const CircularProgressIndicator(), + child: CircularProgressIndicator( + color: Theme.of(context).colorScheme.secondary, + ), ); } else if (playing != true) { return IconButton( diff --git a/lib/ui/triton_media/triton_media_tile.dart b/lib/ui/triton_media/triton_media_tile.dart index 90c495f96..c1ea29759 100644 --- a/lib/ui/triton_media/triton_media_tile.dart +++ b/lib/ui/triton_media/triton_media_tile.dart @@ -1,9 +1,9 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:campus_mobile_experimental/app_constants.dart'; import 'package:campus_mobile_experimental/core/models/triton_media.dart'; import 'package:campus_mobile_experimental/core/providers/triton_media.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:intl/intl.dart'; class MediaTile extends StatelessWidget { const MediaTile({Key? key, required this.data}) : super(key: key); @@ -78,18 +78,13 @@ class MediaTile extends StatelessWidget { width: tileWidth, fit: BoxFit.fill, )) - : Image.network( - url, - loadingBuilder: (BuildContext context, Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; + : CachedNetworkImage( + imageUrl: url, + progressIndicatorBuilder: (context, url, downloadProgress) { return Center( child: CircularProgressIndicator( color: Theme.of(context).colorScheme.secondary, - value: loadingProgress.expectedTotalBytes != null - ? loadingProgress.cumulativeBytesLoaded / - loadingProgress.expectedTotalBytes! - : null, + value: downloadProgress.progress, ), ); }, From a9bdade5952b53682ca3c9722db419ecdc9f3ed8 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:19:49 -0700 Subject: [PATCH 18/26] implemented listview builder in classes card --- lib/ui/classes/upcoming_classes.dart | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/ui/classes/upcoming_classes.dart b/lib/ui/classes/upcoming_classes.dart index cc6b08b4d..320d9f93f 100644 --- a/lib/ui/classes/upcoming_classes.dart +++ b/lib/ui/classes/upcoming_classes.dart @@ -16,16 +16,17 @@ class UpcomingCoursesList extends StatelessWidget { Widget buildListOfCourses( List data, int? selectedCourse, BuildContext context) { - List listOfCourses = List.generate(data.length, (int index) { - return buildTile(index, selectedCourse, data[index], context); - }); return Container( - constraints: - BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3), - child: ListView( - children: listOfCourses, - shrinkWrap: true, - )); + constraints: + BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3), + child: ListView.builder( + itemCount: data.length, + itemBuilder: (context, index) { + return buildTile(index, selectedCourse, data[index], context); + }, + shrinkWrap: true, + ), + ); } Widget buildTile( From 84647eced59207cb569da4f3d5e40213d663a81b Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:30:47 -0700 Subject: [PATCH 19/26] implemented list view builder in availability display .dart --- lib/ui/availability/availability_display.dart | 115 ++++++++---------- 1 file changed, 52 insertions(+), 63 deletions(-) diff --git a/lib/ui/availability/availability_display.dart b/lib/ui/availability/availability_display.dart index cd7aad4e6..1103edb5f 100644 --- a/lib/ui/availability/availability_display.dart +++ b/lib/ui/availability/availability_display.dart @@ -41,66 +41,8 @@ class AvailabilityDisplay extends StatelessWidget { } Widget buildAvailabilityBars(BuildContext context) { - List locations = []; - // add any children the model contains to the listview - if (model.subLocations!.isNotEmpty) { - for (SubLocations subLocation in model.subLocations!) { - locations.add( - ListTile( - onTap: () => subLocation.floors!.length > 0 - ? Navigator.pushNamed( - context, RoutePaths.AvailabilityDetailedView, - arguments: subLocation) - : print('_handleIconClick: no subLocations'), - visualDensity: VisualDensity.compact, - trailing: subLocation.floors!.length > 0 - ? Icon(Icons.arrow_forward_ios_rounded) - : null, - title: Text( - subLocation.name!, - style: TextStyle( - fontSize: LOCATION_FONT_SIZE, - ), - ), - subtitle: Column( - children: [ - Align( - alignment: Alignment.centerLeft, - child: Text( - (100 * percentAvailability(subLocation)) - .toInt() - .toString() + - '% Busy', - // style: TextStyle(color: Colors.black), - )), - Align( - alignment: Alignment.centerLeft, - child: SizedBox( - height: PROGRESS_BAR_HEIGHT, - width: PROGRESS_BAR_WIDTH, - child: ClipRRect( - borderRadius: BorderRadius.circular(BORDER_RADIUS), - child: LinearProgressIndicator( - value: percentAvailability(subLocation) as double?, - backgroundColor: Colors.grey[BACKGROUND_GREY_SHADE], - valueColor: AlwaysStoppedAnimation( - setIndicatorColor( - percentAvailability(subLocation), - ), - ), - ), - ), - ), - ), - ], - ), - ), - ); - } - } - // if no children, return an error container - else { + if (model.subLocations!.isEmpty) { return Container( alignment: Alignment.center, child: Text( @@ -112,18 +54,65 @@ class AvailabilityDisplay extends StatelessWidget { ), ); } - locations = - ListTile.divideTiles(tiles: locations, context: context).toList(); return Flexible( child: Scrollbar( - child: ListView( - children: locations, + child: ListView.builder( + itemCount: model.subLocations!.length, + itemBuilder: (context, index) { + SubLocations subLocation = model.subLocations![index]; + return ListTile( + onTap: () => subLocation.floors!.length > 0 + ? Navigator.pushNamed( + context, RoutePaths.AvailabilityDetailedView, + arguments: subLocation) + : print('_handleIconClick: no subLocations'), + visualDensity: VisualDensity.compact, + trailing: subLocation.floors!.length > 0 + ? Icon(Icons.arrow_forward_ios_rounded) + : null, + title: Text( + subLocation.name!, + style: TextStyle( + fontSize: LOCATION_FONT_SIZE, + ), + ), + subtitle: Column( + children: [ + Align( + alignment: Alignment.centerLeft, + child: Text( + (100 * percentAvailability(subLocation)).toInt().toString() + + '% Busy', + ), + ), + Align( + alignment: Alignment.centerLeft, + child: SizedBox( + height: PROGRESS_BAR_HEIGHT, + width: PROGRESS_BAR_WIDTH, + child: ClipRRect( + borderRadius: BorderRadius.circular(BORDER_RADIUS), + child: LinearProgressIndicator( + value: percentAvailability(subLocation) as double?, + backgroundColor: Colors.grey[BACKGROUND_GREY_SHADE], + valueColor: AlwaysStoppedAnimation( + setIndicatorColor(percentAvailability(subLocation)), + ), + ), + ), + ), + ), + ], + ), + ); + }, ), ), ); } + num percentAvailability(SubLocations location) => location.percentage!; setIndicatorColor(num percentage) { From d88a86f9eb85fb9d9ff9bfdb84eb8789768c2acf Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:48:26 -0700 Subject: [PATCH 20/26] refactored availability detail view to implement listview builder --- .../availability_detail_view.dart | 100 +++++++++--------- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/lib/ui/availability/availability_detail_view.dart b/lib/ui/availability/availability_detail_view.dart index 3cf2452bc..1b0801948 100644 --- a/lib/ui/availability/availability_detail_view.dart +++ b/lib/ui/availability/availability_detail_view.dart @@ -15,65 +15,63 @@ class AvailabilityDetailedView extends StatelessWidget { } Widget buildLocationsList(BuildContext context, subLocation) { - // Add a tile for the subLocation name - List list = []; - list.add(ListTile( - title: Text( - "${subLocation.name}", - style: TextStyle( - color: Theme.of(context).colorScheme.secondary, - fontSize: 24, - fontWeight: FontWeight.bold), - ), - )); - - // Add a tile for every floor in the subLocation list - for (int i = 0; i < subLocation.floors.length; i++) { - Floor floor = subLocation.floors[i]; - list.add( - ListTile( - title: Text( - "${floor.name}", - style: TextStyle( + return ListView.builder( + physics: BouncingScrollPhysics(), + itemCount: subLocation.floors.length + 1, // +1 to include the subLocation name tile + itemBuilder: (context, index) { + if (index == 0) { + // Add the subLocation name as the first ListTile + return ListTile( + title: Text( + "${subLocation.name}", + style: TextStyle( color: Theme.of(context).colorScheme.secondary, - fontSize: LOCATION_FONT_SIZE), - ), - subtitle: Column( - children: [ - Align( + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ), + ); + } else { + // Add tiles for each floor in the subLocation + Floor floor = subLocation.floors[index - 1]; // Adjust index for floors + return ListTile( + title: Text( + "${floor.name}", + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, + fontSize: LOCATION_FONT_SIZE, + ), + ), + subtitle: Column( + children: [ + Align( alignment: Alignment.centerLeft, child: Text( - (100 * percentAvailability(floor)).toInt().toString() + - '% Busy', - // style: TextStyle(color: Colors.black), - )), - Align( - alignment: Alignment.centerLeft, - child: SizedBox( - height: PROGRESS_BAR_HEIGHT, - width: PROGRESS_BAR_WIDTH, - child: ClipRRect( - borderRadius: BorderRadius.circular(BORDER_RADIUS), - child: LinearProgressIndicator( - value: percentAvailability(floor) as double?, - backgroundColor: Colors.grey[BACKGROUND_GREY_SHADE], - valueColor: AlwaysStoppedAnimation( - setIndicatorColor( - percentAvailability(floor), + (100 * percentAvailability(floor)).toInt().toString() + '% Busy', + ), + ), + Align( + alignment: Alignment.centerLeft, + child: SizedBox( + height: PROGRESS_BAR_HEIGHT, + width: PROGRESS_BAR_WIDTH, + child: ClipRRect( + borderRadius: BorderRadius.circular(BORDER_RADIUS), + child: LinearProgressIndicator( + value: percentAvailability(floor) as double?, + backgroundColor: Colors.grey[BACKGROUND_GREY_SHADE], + valueColor: AlwaysStoppedAnimation( + setIndicatorColor(percentAvailability(floor)), ), ), ), ), ), - ), - ], - ), - ), - ); - } - return ListView( - physics: BouncingScrollPhysics(), - children: list, + ], + ), + ); + } + }, ); } From 2ac5e202e3a48cefcaf72aa57efeaf3133155692 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 10:56:34 -0700 Subject: [PATCH 21/26] implemented pageview builder in availability card --- lib/ui/availability/availability_card.dart | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/ui/availability/availability_card.dart b/lib/ui/availability/availability_card.dart index 2be7c65e7..afcacd901 100644 --- a/lib/ui/availability/availability_card.dart +++ b/lib/ui/availability/availability_card.dart @@ -43,19 +43,16 @@ class _AvailabilityCardState extends State { } Widget buildAvailabilityCard(List data) { - List locationsList = []; + // Filter the models and create a list of only the valid ones + List filteredData = data + .where((model) => + model != null && + _availabilityDataProvider.locationViewState[model!.name]!) + .cast() + .toList(); - // loop through all the models, adding each one to locationsList - for (AvailabilityModel? model in data) { - if (model != null) { - if (_availabilityDataProvider.locationViewState[model.name]!) { - locationsList.add(AvailabilityDisplay(model: model)); - } - } - } - - // the user chose no location, so instead show "No Location to Display" - if (locationsList.length == 0) { + // If no location is available, show "No Location to Display" + if (filteredData.isEmpty) { return Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, @@ -80,16 +77,19 @@ class _AvailabilityCardState extends State { return Column( children: [ Flexible( - child: PageView( + child: PageView.builder( controller: _controller, - children: locationsList, + itemCount: filteredData.length, + itemBuilder: (context, index) { + return AvailabilityDisplay(model: filteredData[index]); + }, ), ), SingleChildScrollView( scrollDirection: Axis.horizontal, child: DotsIndicator( controller: _controller, - itemCount: locationsList.length, + itemCount: filteredData.length, onPageSelected: (int index) { _controller.animateToPage(index, duration: Duration(seconds: 1), curve: Curves.ease); From 6bee42b20a6f6a8935e131886e3f2fa39b5e57c6 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 13:15:10 -0700 Subject: [PATCH 22/26] converted student_id_card into a stateless widget card --- lib/ui/student_id/student_id_card.dart | 39 +++++++++++--------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/lib/ui/student_id/student_id_card.dart b/lib/ui/student_id/student_id_card.dart index 6eafcf6c3..7c4bcb329 100644 --- a/lib/ui/student_id/student_id_card.dart +++ b/lib/ui/student_id/student_id_card.dart @@ -12,13 +12,8 @@ import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class StudentIdCard extends StatefulWidget { - @override - _StudentIdCardState createState() => _StudentIdCardState(); -} - -class _StudentIdCardState extends State { - String cardId = "student_id"; +class StudentIdCard extends StatelessWidget { + final String cardId = "student_id"; /// Pop up barcode createAlertDialog( @@ -298,7 +293,7 @@ class _StudentIdCardState extends State { (nameModel!.firstName! + " " + nameModel.lastName!), style: TextStyle( fontWeight: FontWeight.bold, - fontSize: tabletFontSize( + fontSize: tabletFontSize(context, nameModel.firstName! + " " + nameModel.lastName!, "name")), textAlign: TextAlign.left, @@ -314,7 +309,7 @@ class _StudentIdCardState extends State { overflow: TextOverflow.ellipsis, style: TextStyle( color: Colors.grey, - fontSize: tabletFontSize( + fontSize: tabletFontSize(context, profileModel.collegeCurrent!, "college")), textAlign: TextAlign.left, softWrap: false, @@ -329,7 +324,7 @@ class _StudentIdCardState extends State { ? profileModel.graduatePrimaryMajorCurrent : profileModel.ugPrimaryMajorCurrent!, style: TextStyle( - fontSize: tabletFontSize( + fontSize: tabletFontSize(context, profileModel.graduatePrimaryMajorCurrent != "" ? profileModel.graduatePrimaryMajorCurrent : profileModel.ugPrimaryMajorCurrent!, @@ -348,12 +343,12 @@ class _StudentIdCardState extends State { padding: EdgeInsets.all(0), ), child: returnBarcodeContainerTablet( - profileModel!.barcode.toString(), false, context), + profileModel.barcode.toString(), false, context), onPressed: () { createAlertDialog( context, returnBarcodeContainer( - profileModel!.barcode.toString(), true, context), + profileModel.barcode.toString(), true, context), profileModel.barcode.toString(), true); }, @@ -436,8 +431,8 @@ class _StudentIdCardState extends State { cardNumber, style: TextStyle( color: Colors.black, - fontSize: fontSizeForTablet(), - letterSpacing: letterSpacingForTablet()), + fontSize: fontSizeForTablet(context), + letterSpacing: letterSpacingForTablet(context)), ) ], ), @@ -465,14 +460,14 @@ class _StudentIdCardState extends State { } } - double letterSpacingForTablet() { + double letterSpacingForTablet(context) { if (MediaQuery.of(context).orientation == Orientation.landscape) { return ScalingUtility.horizontalSafeBlock * 1; } return ScalingUtility.horizontalSafeBlock * 3; } - double fontSizeForTablet() { + double fontSizeForTablet(context) { if (MediaQuery.of(context).orientation == Orientation.landscape) { return ScalingUtility.horizontalSafeBlock * 2; } @@ -532,8 +527,8 @@ class _StudentIdCardState extends State { cardNumber, style: TextStyle( color: Colors.black, - fontSize: getRotatedPopUpFontSize(), - letterSpacing: letterSpacing()), + fontSize: getRotatedPopUpFontSize(context), + letterSpacing: letterSpacing(context)), ) ], ), @@ -567,12 +562,12 @@ class _StudentIdCardState extends State { } } - double letterSpacing() => + double letterSpacing(context) => MediaQuery.of(context).orientation == Orientation.landscape ? SizeConfig.safeBlockHorizontal * 1 : SizeConfig.safeBlockHorizontal * 3; - double getRotatedPopUpFontSize() => + double getRotatedPopUpFontSize(context) => MediaQuery.of(context).orientation == Orientation.landscape ? SizeConfig.safeBlockHorizontal * 2 : SizeConfig.safeBlockHorizontal * 4; @@ -596,9 +591,9 @@ class _StudentIdCardState extends State { return base; } - double tabletFontSize(String input, String textField) { + double tabletFontSize(BuildContext context, String input, String textField) { /// Base font size - double base = letterSpacingForTablet(); + double base = letterSpacingForTablet(context); /// If threshold is passed, shrink text if (input.length >= 21) { From aec972a3b274a4df3050ef5863a2110476b7139a Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 14:00:42 -0700 Subject: [PATCH 23/26] converted employee id to stateless --- lib/ui/employee_id/employee_id_card.dart | 50 ++++++++++-------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/lib/ui/employee_id/employee_id_card.dart b/lib/ui/employee_id/employee_id_card.dart index 122041326..e350f9957 100644 --- a/lib/ui/employee_id/employee_id_card.dart +++ b/lib/ui/employee_id/employee_id_card.dart @@ -11,28 +11,16 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class EmployeeIdCard extends StatefulWidget { - @override - _EmployeeIdCardState createState() => _EmployeeIdCardState(); -} - -class _EmployeeIdCardState extends State { - String cardId = "employee_id"; - String placeholderPhotoUrl = +class EmployeeIdCard extends StatelessWidget { + final String cardId = "employee_id"; + final String placeholderPhotoUrl = "https://mobile.ucsd.edu/replatform/v1/qa/webview/resources/img/placeholderPerson.png"; - bool isValidId = false; - @override Widget build(BuildContext context) { ScalingUtility().getCurrentMeasurements(context); EmployeeIdModel? employeeModel = Provider.of(context).employeeIdModel; - isValidId = employeeModel != null && - (employeeModel.barcode != null) && - (employeeModel.employeePreferredDisplayName != null && - employeeModel.employeeId != null); - return CardContainer( active: Provider.of(context).cardStates![cardId], hide: () => Provider.of(context, listen: false) @@ -42,7 +30,10 @@ class _EmployeeIdCardState extends State { isLoading: Provider.of(context).isLoading, titleText: CardTitleConstants.titleMap[cardId], errorText: Provider.of(context).error, - child: () => isValidId + child: () => (employeeModel != null && + (employeeModel.barcode != null) && + (employeeModel.employeePreferredDisplayName != null && + employeeModel.employeeId != null)) ? buildCardContent( Provider.of(context).employeeIdModel, context) @@ -60,7 +51,6 @@ class _EmployeeIdCardState extends State { bottom: 32.0, ), child: Column( - // mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Center( @@ -267,7 +257,7 @@ class _EmployeeIdCardState extends State { employeeIdModel.employeePreferredDisplayName, style: TextStyle( fontWeight: FontWeight.bold, - fontSize: tabletFontSize( + fontSize: tabletFontSize(context, employeeIdModel.employeePreferredDisplayName, "name")), textAlign: TextAlign.left, @@ -284,7 +274,7 @@ class _EmployeeIdCardState extends State { style: TextStyle( color: Colors.grey, fontSize: - tabletFontSize(employeeIdModel.department, "")), + tabletFontSize(context, employeeIdModel.department, "")), textAlign: TextAlign.left, softWrap: false, maxLines: 1, @@ -296,7 +286,7 @@ class _EmployeeIdCardState extends State { child: Text( "Employee ID " + employeeIdModel.employeeId, style: TextStyle( - fontSize: tabletFontSize( + fontSize: tabletFontSize(context, "Employee ID " + employeeIdModel.employeeId, "")), textAlign: TextAlign.left, softWrap: false, @@ -444,8 +434,8 @@ class _EmployeeIdCardState extends State { cardNumber, style: TextStyle( color: Colors.black, - fontSize: fontSizeForTablet(), - letterSpacing: letterSpacingForTablet()), + fontSize: fontSizeForTablet(context), + letterSpacing: letterSpacingForTablet(context)), ) ], ), @@ -473,14 +463,14 @@ class _EmployeeIdCardState extends State { } } - double letterSpacingForTablet() { + double letterSpacingForTablet(BuildContext context) { if (MediaQuery.of(context).orientation == Orientation.landscape) { return ScalingUtility.horizontalSafeBlock * 1; } return ScalingUtility.horizontalSafeBlock * 3; } - double fontSizeForTablet() { + double fontSizeForTablet(BuildContext context) { if (MediaQuery.of(context).orientation == Orientation.landscape) { return ScalingUtility.horizontalSafeBlock * 2; } @@ -540,8 +530,8 @@ class _EmployeeIdCardState extends State { cardNumber, style: TextStyle( color: Colors.black, - fontSize: getRotatedPopUpFontSize(), - letterSpacing: letterSpacing()), + fontSize: getRotatedPopUpFontSize(context), + letterSpacing: letterSpacing(context)), ) ], ), @@ -575,12 +565,12 @@ class _EmployeeIdCardState extends State { } } - double letterSpacing() => + double letterSpacing(BuildContext context) => MediaQuery.of(context).orientation == Orientation.landscape ? SizeConfig.safeBlockHorizontal * 1 : SizeConfig.safeBlockHorizontal * 3; - double getRotatedPopUpFontSize() => + double getRotatedPopUpFontSize(BuildContext context) => MediaQuery.of(context).orientation == Orientation.landscape ? SizeConfig.safeBlockHorizontal * 2 : SizeConfig.safeBlockHorizontal * 4; @@ -604,9 +594,9 @@ class _EmployeeIdCardState extends State { return base; } - double tabletFontSize(String input, String textField) { + double tabletFontSize(BuildContext context, String input, String textField) { /// Base font size - double base = letterSpacingForTablet(); + double base = letterSpacingForTablet(context); /// If threshold is passed, shrink text // if (input.length >= 21) { From f69db5745e7ea5301116d01dffb32e0c0712aef6 Mon Sep 17 00:00:00 2001 From: klortiz13 Date: Sun, 22 Sep 2024 14:01:01 -0700 Subject: [PATCH 24/26] fixed typo in student id card --- lib/ui/student_id/student_id_card.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ui/student_id/student_id_card.dart b/lib/ui/student_id/student_id_card.dart index 7c4bcb329..5fe407ec9 100644 --- a/lib/ui/student_id/student_id_card.dart +++ b/lib/ui/student_id/student_id_card.dart @@ -460,14 +460,14 @@ class StudentIdCard extends StatelessWidget { } } - double letterSpacingForTablet(context) { + double letterSpacingForTablet(BuildContext context) { if (MediaQuery.of(context).orientation == Orientation.landscape) { return ScalingUtility.horizontalSafeBlock * 1; } return ScalingUtility.horizontalSafeBlock * 3; } - double fontSizeForTablet(context) { + double fontSizeForTablet(BuildContext context) { if (MediaQuery.of(context).orientation == Orientation.landscape) { return ScalingUtility.horizontalSafeBlock * 2; } @@ -562,12 +562,12 @@ class StudentIdCard extends StatelessWidget { } } - double letterSpacing(context) => + double letterSpacing(BuildContext context) => MediaQuery.of(context).orientation == Orientation.landscape ? SizeConfig.safeBlockHorizontal * 1 : SizeConfig.safeBlockHorizontal * 3; - double getRotatedPopUpFontSize(context) => + double getRotatedPopUpFontSize(BuildContext context) => MediaQuery.of(context).orientation == Orientation.landscape ? SizeConfig.safeBlockHorizontal * 2 : SizeConfig.safeBlockHorizontal * 4; From 038a06e4799201d4c88b2f2298ecd001fb8555ab Mon Sep 17 00:00:00 2001 From: Parth Shinde Date: Mon, 14 Oct 2024 14:24:25 -0700 Subject: [PATCH 25/26] updated --- pubspec.lock | 80 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index f57345cc2..c1794b99a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" audio_service: dependency: "direct main" description: @@ -165,10 +165,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -205,10 +205,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" connectivity: dependency: "direct main" description: @@ -802,6 +802,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.8" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.dev" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" linkify: dependency: transitive description: @@ -831,26 +855,26 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.15.0" mime: dependency: transitive description: @@ -887,10 +911,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.0" path_provider: dependency: transitive description: @@ -1172,10 +1196,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: transitive description: @@ -1196,18 +1220,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1244,10 +1268,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.7.2" timezone: dependency: transitive description: @@ -1368,6 +1392,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + url: "https://pub.dev" + source: hosted + version: "14.2.5" watcher: dependency: transitive description: @@ -1442,5 +1474,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=2.19.0 <3.0.0" - flutter: ">=3.3.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" From f52041a26e24b637e40fd91815f768cc597ff8d9 Mon Sep 17 00:00:00 2001 From: Parth Shinde Date: Sun, 15 Dec 2024 14:07:06 -0800 Subject: [PATCH 26/26] updated pubspeck --- pubspec.lock | 80 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index ff1386403..03cbd9a4a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" barcode: dependency: transitive description: @@ -133,10 +133,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" connectivity: dependency: "direct main" description: @@ -730,6 +730,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.dev" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" linkify: dependency: transitive description: @@ -759,18 +783,18 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.11.1" measured_size: dependency: "direct main" description: @@ -783,10 +807,10 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.15.0" mime: dependency: transitive description: @@ -823,10 +847,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.0" path_provider: dependency: transitive description: @@ -1100,10 +1124,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sprintf: dependency: transitive description: @@ -1116,18 +1140,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1156,10 +1180,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.7.2" timezone: dependency: transitive description: @@ -1280,6 +1304,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + url: "https://pub.dev" + source: hosted + version: "14.2.5" watcher: dependency: transitive description: @@ -1378,5 +1410,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=2.19.0 <3.0.0" - flutter: ">=3.7.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54"