From 7c2902b75bee33470251a11b309f12f4edbae6b3 Mon Sep 17 00:00:00 2001 From: priyanka Date: Thu, 18 Apr 2024 02:30:43 -0700 Subject: [PATCH] blog article and subscription changes done --- .dart_tool/extension_discovery/README.md | 31 --- .dart_tool/extension_discovery/vs_code.json | 1 - .dart_tool/package_config.json | 14 +- .dart_tool/package_config_subset | 8 + .vscode/settings.json | 2 +- gsf/lib/views/pages/blog/blog_inner.dart | 25 +- gsf/lib/views/pages/blog/blog_main.dart | 222 +++++++++++------- .../pages/subscription/my_subscription.dart | 84 ++++--- gsf/pubspec.lock | 8 + gsf/pubspec.yaml | 4 +- pubspec.lock | 16 ++ pubspec.yaml | 2 + 12 files changed, 246 insertions(+), 171 deletions(-) delete mode 100644 .dart_tool/extension_discovery/README.md delete mode 100644 .dart_tool/extension_discovery/vs_code.json diff --git a/.dart_tool/extension_discovery/README.md b/.dart_tool/extension_discovery/README.md deleted file mode 100644 index 9dc6757..0000000 --- a/.dart_tool/extension_discovery/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Extension Discovery Cache -========================= - -This folder is used by `package:extension_discovery` to cache lists of -packages that contains extensions for other packages. - -DO NOT USE THIS FOLDER ----------------------- - - * Do not read (or rely) the contents of this folder. - * Do write to this folder. - -If you're interested in the lists of extensions stored in this folder use the -API offered by package `extension_discovery` to get this information. - -If this package doesn't work for your use-case, then don't try to read the -contents of this folder. It may change, and will not remain stable. - -Use package `extension_discovery` ---------------------------------- - -If you want to access information from this folder. - -Feel free to delete this folder -------------------------------- - -Files in this folder act as a cache, and the cache is discarded if the files -are older than the modification time of `.dart_tool/package_config.json`. - -Hence, it should never be necessary to clear this cache manually, if you find a -need to do please file a bug. diff --git a/.dart_tool/extension_discovery/vs_code.json b/.dart_tool/extension_discovery/vs_code.json deleted file mode 100644 index 18073f8..0000000 --- a/.dart_tool/extension_discovery/vs_code.json +++ /dev/null @@ -1 +0,0 @@ -{"version":2,"entries":[{"package":"icdevicemanager_flutter","rootUri":"../","packageUri":"lib/"}]} \ No newline at end of file diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index ac65b28..9035c89 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -199,6 +199,12 @@ "packageUri": "lib/", "languageVersion": "2.12" }, + { + "name": "intl", + "rootUri": "file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.18.1", + "packageUri": "lib/", + "languageVersion": "2.12" + }, { "name": "io", "rootUri": "file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/io-1.0.4", @@ -373,6 +379,12 @@ "packageUri": "lib/", "languageVersion": "2.18" }, + { + "name": "timeago", + "rootUri": "file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/timeago-3.6.1", + "packageUri": "lib/", + "languageVersion": "2.12" + }, { "name": "timing", "rootUri": "file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/timing-1.0.1", @@ -416,7 +428,7 @@ "languageVersion": "2.17" } ], - "generated": "2024-04-11T06:11:34.892808Z", + "generated": "2024-04-17T13:38:49.333490Z", "generator": "pub", "generatorVersion": "2.19.6" } diff --git a/.dart_tool/package_config_subset b/.dart_tool/package_config_subset index 2573cd5..88228a5 100644 --- a/.dart_tool/package_config_subset +++ b/.dart_tool/package_config_subset @@ -138,6 +138,10 @@ http_parser 2.12 file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/http_parser-4.0.2/ file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/http_parser-4.0.2/lib/ +intl +2.12 +file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.18.1/ +file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/intl-0.18.1/lib/ io 2.12 file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/io-1.0.4/ @@ -250,6 +254,10 @@ test_api 2.18 file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/test_api-0.4.16/ file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/test_api-0.4.16/lib/ +timeago +2.12 +file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/timeago-3.6.1/ +file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/timeago-3.6.1/lib/ timing 2.14 file:///C:/Users/WDI-/AppData/Local/Pub/Cache/hosted/pub.dev/timing-1.0.1/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 8257e8d..38cbd47 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "dart.flutterSdkPath": "~/Flutter/Sdk/3.7.12" + "dart.flutterSdkPath": "C:\\Flutter_SDK\\flutter" } \ No newline at end of file diff --git a/gsf/lib/views/pages/blog/blog_inner.dart b/gsf/lib/views/pages/blog/blog_inner.dart index cb65826..96221fb 100644 --- a/gsf/lib/views/pages/blog/blog_inner.dart +++ b/gsf/lib/views/pages/blog/blog_inner.dart @@ -73,19 +73,24 @@ class BlogDetails extends StatelessWidget { ), ), const SizedBox(height: 10), - Image.network( - imageUpload!, - // 'assets/image/blog/philosophyCard.jpg', - // height: 400, - width: Get.size.width, - fit: BoxFit.fitWidth, + Container( + height: 300, + child: Image.network( + imageUpload!, + // 'assets/image/blog/philosophyCard.jpg', + // height: 400, + width: Get.size.width, + fit: BoxFit.fill, + ), ), const SizedBox(height: 30), - Column( - children: [ - Html(data: description) - ], + Expanded( + child: SingleChildScrollView( + child: Column( + children: [Html(data: description)], + ), + ), ) // Expanded( // child: Padding( diff --git a/gsf/lib/views/pages/blog/blog_main.dart b/gsf/lib/views/pages/blog/blog_main.dart index 50dcd0f..585626b 100644 --- a/gsf/lib/views/pages/blog/blog_main.dart +++ b/gsf/lib/views/pages/blog/blog_main.dart @@ -14,6 +14,7 @@ import '../../../modals/search_blogModel.dart'; import '../../components/appbar.dart'; import '../../theme.dart'; import 'blog_inner.dart'; +import 'package:timeago/timeago.dart' as timeago; class BlogMain extends StatefulWidget { const BlogMain({Key? key}) : super(key: key); @@ -242,94 +243,63 @@ class _NewsBodyState extends State { return (searchArticle?.result != null && searchArticle!.result!.isNotEmpty) ? Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 20), - Text( - 'Top News', - style: TextStyle( - fontSize: 22, - color: Color(0xff858585), - fontFamily: 'SFPRO', - fontWeight: FontWeight.w700, + child: SingleChildScrollView( + child: Container( + // color: Colors.red, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 20), + Text( + 'Top News', + style: TextStyle( + fontSize: 22, + color: Color(0xff858585), + fontFamily: 'SFPRO', + fontWeight: FontWeight.w700, + ), ), - ), - SizedBox(height: 15), - SizedBox( - height: 280, - child: ListView.builder( - itemCount: searchArticle!.result!.length, - scrollDirection: Axis.horizontal, - itemBuilder: (context, index) { - var updatedAtTime = - searchArticle!.result![index].updatedAt; - DateTime updatedAt = - DateTime.parse(updatedAtTime!); - Duration difference = - DateTime.now().difference(updatedAt); - String formattedDifference = - DateFormat().add_Hm().format(updatedAt); - - return philosophyCard( - ArticleName: searchArticle! - .result![index].shortText ?? - '', - shortText: searchArticle! - .result![index].articleName ?? - '', - image_upload: searchArticle! - .result![index].thumbnailPath ?? - '', - updatedAtTime: formattedDifference, - categoryId: - searchArticle!.result![index].id ?? 0, - InnerimageUpload: searchArticle! - .result![index].imageUpload ?? - '', - Innertages: - searchArticle!.result![index].tags, - InnerDescription: searchArticle! - .result![index].description, - Innerformattedtime: formattedDifference, - - // articleid: widget.category.articles![index], - ); - }), - ), - SizedBox(height: 10), - Expanded( + SizedBox(height: 15), + SizedBox( + height: 280, child: ListView.builder( - itemCount: searchArticle?.result!.length, - physics: ScrollPhysics(), - shrinkWrap: true, + // shrinkWrap: true, + itemCount: searchArticle!.result!.length, + scrollDirection: Axis.horizontal, itemBuilder: (context, index) { - String formatDateTime( + var updatedAtTime = searchArticle! + .result![index].updatedAt; + DateTime updatedAt = + DateTime.parse(updatedAtTime!); + Duration difference = + DateTime.now().difference(updatedAt); + String formattedDifference = DateFormat() + .add_Hm() + .format(updatedAt); + + String formatDateTime2( String dateTimeString) { - // Parse the datetime string DateTime dateTime = DateTime.parse(dateTimeString); - String formattedDateTime = - DateFormat('MMM dd, yyyy hh:mm a') - .format(dateTime); - - formattedDateTime += ' IST'; - - return formattedDateTime; + String formatedtime = timeago + .format(dateTime, locale: 'en'); + return formatedtime; } - return cardList( - articleName: searchArticle! + return philosophyCard( + ArticleName: searchArticle! + .result![index].shortText ?? + '', + shortText: searchArticle! .result![index].articleName ?? '', - thumbnailimg: searchArticle! + image_upload: searchArticle! .result![index].thumbnailPath ?? '', - updatedTime: formatDateTime( - searchArticle! - .result![index].updatedAt ?? - ''), + updatedAtTime: formatDateTime2( + searchArticle!.result![index] + .updatedAt as String), categoryId: searchArticle!.result![index].id ?? 0, @@ -340,16 +310,80 @@ class _NewsBodyState extends State { searchArticle!.result![index].tags, InnerDescription: searchArticle! .result![index].description, - Innerformattedtime: formatDateTime( - searchArticle! - .result![index].updatedAt ?? - ''), + Innerformattedtime: formatDateTime2( + searchArticle!.result![index] + .updatedAt as String), + + // Innerformattedtime: formattedDifference, + // articleid: widget.category.articles![index], ); - })) - ], + }), + ), + SizedBox(height: 10), + ListView.builder( + itemCount: searchArticle?.result!.length, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + String formatDateTime( + String dateTimeString) { + // Parse the datetime string + DateTime dateTime = + DateTime.parse(dateTimeString); + + String formattedDateTime = + DateFormat('MMM dd, yyyy hh:mm a') + .format(dateTime); + + formattedDateTime += ' IST'; + + return formattedDateTime; + } + + String formatDateTime2( + String dateTimeString) { + DateTime dateTime = + DateTime.parse(dateTimeString); + + String formatedtime = timeago + .format(dateTime, locale: 'en'); + return formatedtime; + } + + return cardList( + articleName: searchArticle! + .result![index].articleName ?? + '', + thumbnailimg: searchArticle! + .result![index].thumbnailPath ?? + '', + updatedTime: formatDateTime(searchArticle! + .result![index].updatedAt ?? + ''), + categoryId: + searchArticle!.result![index].id ?? 0, + InnerimageUpload: searchArticle! + .result![index].imageUpload ?? + '', + Innertages: + searchArticle!.result![index].tags, + InnerDescription: searchArticle! + .result![index].description, + Innerformattedtime: formatDateTime2( + searchArticle!.result![index] + .updatedAt as String) ?? + '', + // articleid: widget.category.articles![index], + ); + }), + // SizedBox( + // height: 400, + // ) + ], + ), ), - ) + )) : Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -422,20 +456,26 @@ philosophyCard({ SizedBox(height: 10), Expanded( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + padding: const EdgeInsets.symmetric(horizontal: 16), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - shortText, - style: TextStyle( - fontSize: 14, - color: Color(0xff919191), - fontFamily: 'SFPRO', + SizedBox( + width: 225, + child: Text( + shortText, + maxLines: 1, + style: TextStyle( + overflow: TextOverflow.ellipsis, + fontSize: 14, + color: Color(0xff919191), + fontFamily: 'SFPRO', + ), ), ), - Spacer(), Text( updatedAtTime, style: TextStyle( @@ -449,7 +489,9 @@ philosophyCard({ SizedBox(height: 10), Text( ArticleName, + maxLines: 1, style: TextStyle( + overflow: TextOverflow.ellipsis, fontSize: 18, color: ColorConstants.kWhite, fontFamily: 'SFPRO', diff --git a/gsf/lib/views/pages/subscription/my_subscription.dart b/gsf/lib/views/pages/subscription/my_subscription.dart index f5b7b9c..dc1e4b0 100644 --- a/gsf/lib/views/pages/subscription/my_subscription.dart +++ b/gsf/lib/views/pages/subscription/my_subscription.dart @@ -90,47 +90,54 @@ class _MySubscriptionState extends State { borderRadius: BorderRadius.circular(30), ), child: Padding( - padding: const EdgeInsets.all(20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + padding: const EdgeInsets.all(16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - subscriptionObj!.result!.utmSource ?? '', + 'Current active plan:-', style: TextStyle( - fontSize: 25, + fontSize: 22, color: !globalController.darkMode.value ? ColorConstants.kBlack : ColorConstants.kWhite, fontFamily: 'SFPRO', ), ), - SizedBox( - height: 30, - ), - rowTile( - text: - 'Unlimited access to live virtual fitness classes led by certified trainers.'), - SizedBox( - height: 20, - ), - rowTile( - text: - 'Access to a library of workout videos covering various fitness levels and goals.'), - SizedBox( - height: 20, - ), - rowTile( - text: - 'Progress tracking to monitor your achievements and stay motivated.'), - SizedBox( - height: 20, - ), - rowTile( - text: - 'Basic nutrition guidance and meal planning tips.'), - SizedBox( - height: 20, + Text( + subscriptionObj!.result!.utmSource ?? '', + style: TextStyle( + fontSize: 22, + color: !globalController.darkMode.value + ? ColorConstants.kBlack + : ColorConstants.kWhite, + fontFamily: 'SFPRO', + ), ), + // rowTile( + // text: + // 'Unlimited access to live virtual fitness classes led by certified trainers.'), + // SizedBox( + // height: 20, + // ), + // rowTile( + // text: + // 'Access to a library of workout videos covering various fitness levels and goals.'), + // SizedBox( + // height: 20, + // ), + // rowTile( + // text: + // 'Progress tracking to monitor your achievements and stay motivated.'), + // SizedBox( + // height: 20, + // ), + // rowTile( + // text: + // 'Basic nutrition guidance and meal planning tips.'), + // SizedBox( + // height: 20, + // ), ], ), ), @@ -161,9 +168,16 @@ class _MySubscriptionState extends State { child: Center( child: Row( children: [ - Icon( - Icons.calendar_month_outlined, - color: Color(0xFFBBF046), + Column( + children: [ + SizedBox( + height: 4, + ), + Icon( + Icons.calendar_month_outlined, + color: Color(0xFFBBF046), + ), + ], ), SizedBox( width: 10, @@ -171,7 +185,7 @@ class _MySubscriptionState extends State { Expanded( child: Text( // 'Membership till : 15/04/2024 - 15/10/2024', - 'Membership till : $formattedStartDate - $formattedEndDate', + 'Next renewal date : $formattedEndDate', style: TextStyle( fontSize: 14, diff --git a/gsf/pubspec.lock b/gsf/pubspec.lock index 7759843..8a6f09e 100644 --- a/gsf/pubspec.lock +++ b/gsf/pubspec.lock @@ -1684,6 +1684,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.16" + timeago: + dependency: "direct main" + description: + name: timeago + sha256: "46c128312ab0ea144b146c0ac6426ddd96810efec2de3fccc425d00179cd8254" + url: "https://pub.dev" + source: hosted + version: "3.3.0" timing: dependency: transitive description: diff --git a/gsf/pubspec.yaml b/gsf/pubspec.yaml index 7066fe1..34f5552 100644 --- a/gsf/pubspec.yaml +++ b/gsf/pubspec.yaml @@ -38,13 +38,12 @@ dependencies: image_cropper: ^3.0.1 image_picker: ^0.8.7 carousel_slider: ^4.1.1 - + intl: ^0.17.0 modal_bottom_sheet: ^2.1.2 flutter_branch_sdk: any health: any pin_code_fields: ^7.4.0 - intl: ^0.17.0 percent_indicator: ^4.2.1 vibration: ^1.7.6 audioplayers: ^1.1.1 @@ -118,6 +117,7 @@ dependencies: video_player: ^2.6.1 flutter_isolate: ^2.0.2 injectable: ^1.4.1 + timeago: any # flutter_launcher_icons: ^0.12.0 # dependency_overrides: diff --git a/pubspec.lock b/pubspec.lock index cc72a13..b3f5bee 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -259,6 +259,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" + source: hosted + version: "0.18.1" io: dependency: transitive description: @@ -488,6 +496,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.16" + timeago: + dependency: "direct main" + description: + name: timeago + sha256: d3204eb4c788214883380253da7f23485320a58c11d145babc82ad16bf4e7764 + url: "https://pub.dev" + source: hosted + version: "3.6.1" timing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 6c2ba83..e0b9c63 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,6 +14,8 @@ dependencies: json_annotation: ^4.6.0 build_runner: ^1.7.0 plugin_platform_interface: ^2.0.2 + + intl: ^0.17.0 dev_dependencies: change_app_package_name: ^1.0.0