From 2a95b969a7d40a7793350265afb4f9d8ec5c3675 Mon Sep 17 00:00:00 2001 From: ketan-sharmaa Date: Thu, 27 Jun 2024 18:22:07 +0530 Subject: [PATCH] fixes --- lib/screens/project_description_map.dart | 219 +++++++++++++---------- lib/screens/routes/projects.dart | 50 ++++-- pubspec.lock | 24 +-- 3 files changed, 170 insertions(+), 123 deletions(-) diff --git a/lib/screens/project_description_map.dart b/lib/screens/project_description_map.dart index 39c2630..59c5e2e 100644 --- a/lib/screens/project_description_map.dart +++ b/lib/screens/project_description_map.dart @@ -1,5 +1,6 @@ import 'dart:developer'; +import 'package:animate_do/animate_do.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; @@ -53,9 +54,12 @@ class ProjectDescriptionMAP extends StatelessWidget { height: defaultPadding, ), yearAndLinks(context), - SizedBox( - height: - Device.width > 599 ? defaultPadding * 4 : defaultPadding), + const SizedBox( + height: defaultPadding, + ), + // SizedBox( + // height: + // Device.width > 599 ? defaultPadding * 4 : defaultPadding), mockupsSection(context), // Wrap( // runAlignment: WrapAlignment.center, @@ -97,14 +101,15 @@ class ProjectDescriptionMAP extends StatelessWidget { } } - SizedBox description(context) { - return SizedBox( - height: 300, - width: project['thumbnail_web'] != null ? 80.w : 50.w, + Widget description(context) { + return ConstrainedBox( + constraints: BoxConstraints(maxWidth: 80.w, minWidth: 60.w), + // height: 300, + // width: project['thumbnail_web'] != null ? 80.w : 70.w, child: MarkdownWidget( styleConfig: StyleConfig( pConfig: - PConfig(textStyle: Theme.of(context).textTheme.titleLarge)), + PConfig(textStyle: Theme.of(context).textTheme.bodyLarge)), padding: EdgeInsets.zero, data: project['description'], shrinkWrap: true, @@ -129,46 +134,68 @@ class ProjectDescriptionMAP extends StatelessWidget { } Wrap mockupsSection(context) { + double from = 100; + const duration = Durations.medium4; + const curve = Curves.easeOut; + List delay = [ + Durations.medium2, + Durations.medium2, + ]; + if (project['thumbnail'] != null && project['thumbnail_web'] != null) { + delay[1] = delay[1] + Durations.short3; + } return Wrap( runAlignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.center, children: [ if (project['thumbnail'] != null) - Padding( - padding: const EdgeInsets.all(defaultPadding), - child: Stack( - alignment: Alignment.center, - children: [ - Image.asset( - project['thumbnail'], - height: 50.h, - ), - Image.asset( - 'mockups/phone.png', - height: 50.h, - ), - ], - ), - ), - if (project['thumbnail_web'] != null) - Padding( - padding: const EdgeInsets.all(defaultPadding), - child: Builder(builder: (context) { - final size = Size(50.h, 30.w); - return Stack( + FadeInUpBig( + duration: duration, + curve: curve, + from: from, + delay: delay[0], + child: Padding( + padding: const EdgeInsets.all(defaultPadding), + child: Stack( alignment: Alignment.center, children: [ Image.asset( - project['thumbnail_web'], - height: size.height, + project['thumbnail'], + height: 50.h, ), Image.asset( - 'mockups/laptop.png', - height: size.height, + 'mockups/phone.png', + height: 50.h, ), ], - ); - }), + ), + ), + ), + if (project['thumbnail_web'] != null) + FadeInUpBig( + duration: duration, + curve: curve, + delay: delay[1], + from: from, + child: Padding( + padding: const EdgeInsets.all(defaultPadding), + child: Builder(builder: (context) { + final size = Size(50.h, 30.w); + return Stack( + alignment: Alignment.center, + children: [ + Image.asset( + project['thumbnail_web'], + height: 50.h, + ), + Image.asset( + 'mockups/laptop.png', + height: 50.h, + ), + ], + ); + }), + ), ) else Column( @@ -216,71 +243,73 @@ class ProjectDescriptionMAP extends StatelessWidget { style: Theme.of(context).textTheme.bodySmall); } - Stack projectTitle() { - return Stack( - alignment: Alignment.center, - clipBehavior: Clip.none, - children: [ - Transform.translate( - // alignment: Alignment(5, 5), - offset: const Offset(6, 3), - child: Text( - project['title'], - style: TextStyle( - fontWeight: FontWeight.w900, - fontSize: 62, - letterSpacing: 4, - foreground: Paint() - ..style = PaintingStyle.stroke - ..strokeWidth = 1 - ..color = Colors.black, + Widget projectTitle() { + return FittedBox( + child: Stack( + alignment: Alignment.center, + clipBehavior: Clip.none, + children: [ + Transform.translate( + // alignment: Alignment(5, 5), + offset: const Offset(6, 3), + child: Text( + project['title'], + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 62, + letterSpacing: 4, + foreground: Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = 1 + ..color = Colors.black, + ), + // style: Theme.of(context) + // .textTheme + // .displayMedium! + // .copyWith(fontWeight: FontWeight.bold), ), - // style: Theme.of(context) - // .textTheme - // .displayMedium! - // .copyWith(fontWeight: FontWeight.bold), ), - ), - Transform.translate( - // alignment: Alignment(5, 5), - offset: const Offset(0, 0), - child: Text( - project['title'], - style: const TextStyle( - fontWeight: FontWeight.w900, - fontFamily: 'Roboto', - fontSize: 62, - letterSpacing: 4, - color: Color.fromARGB(255, 255, 139, 15), - // fontFamily: 'serif' - // foreground: Paint() - // ..style = PaintingStyle.stroke - // ..strokeWidth = 0.2 - // ..color = Colors.black, + Transform.translate( + // alignment: Alignment(5, 5), + offset: const Offset(0, 0), + child: Text( + project['title'], + style: const TextStyle( + fontWeight: FontWeight.w900, + fontFamily: 'Roboto', + fontSize: 62, + letterSpacing: 4, + color: Color.fromARGB(255, 255, 139, 15), + // fontFamily: 'serif' + // foreground: Paint() + // ..style = PaintingStyle.stroke + // ..strokeWidth = 0.2 + // ..color = Colors.black, + ), ), ), - ), - Transform.translate( - // alignment: Alignment(5, 5), - offset: const Offset(0, 0), - child: Text( - project['title'], - style: TextStyle( - fontWeight: FontWeight.w900, - fontSize: 62, - letterSpacing: 4, - foreground: Paint() - ..style = PaintingStyle.stroke - ..strokeWidth = 1 - ..color = Colors.black, + Transform.translate( + // alignment: Alignment(5, 5), + offset: const Offset(0, 0), + child: Text( + project['title'], + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 62, + letterSpacing: 4, + foreground: Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = 1 + ..color = Colors.black, + ), + // style: Theme.of(context) + // .textTheme + // .displayMedium! + // .copyWith(fontWeight: FontWeight.bold), ), - // style: Theme.of(context) - // .textTheme - // .displayMedium! - // .copyWith(fontWeight: FontWeight.bold), ), - ), - ], + ], + ), ); } diff --git a/lib/screens/routes/projects.dart b/lib/screens/routes/projects.dart index 6f3723e..b588914 100644 --- a/lib/screens/routes/projects.dart +++ b/lib/screens/routes/projects.dart @@ -30,16 +30,24 @@ class _ProjectsState extends State { ), ); final List colors = [ - Colors.blueAccent, - Colors.orangeAccent, - Colors.greenAccent, - Colors.purpleAccent, Colors.indigoAccent, + Colors.lightGreenAccent, + Colors.pinkAccent, + Colors.greenAccent, + Colors.limeAccent, ]; int _currentPage = 0; @override void initState() { + controller.addListener(() { + final data = + List.generate(projectsDATA.length, (index) => index.toDouble()); + if (data.contains(controller.page!)) { + appLog(name: 'data', log: controller.page!.toString()); + setPage(); + } + }); super.initState(); } @@ -84,6 +92,10 @@ class _ProjectsState extends State { // padding: const EdgeInsets.all(defaultPadding), margin: const EdgeInsets.all(defaultPadding), decoration: BoxDecoration( + boxShadow: const [ + BoxShadow( + offset: Offset(3, 5), blurRadius: 15, color: Colors.black54) + ], color: Colors.white, borderRadius: BorderRadius.circular(defaultBorderRadius)), child: Row( @@ -91,12 +103,15 @@ class _ProjectsState extends State { mainAxisSize: MainAxisSize.min, children: [ IconButton( - onPressed: () { - controller - .previousPage( - duration: Durations.medium4, curve: Curves.easeOut) - .then((value) => setPage()); - }, + onPressed: _currentPage == 0 + ? null + : () { + controller + .previousPage( + duration: Durations.medium4, + curve: Curves.easeOut) + .then((value) => setPage()); + }, icon: const Icon(Icons.arrow_circle_left_outlined)), Text( (_currentPage + 1).toString(), @@ -106,12 +121,15 @@ class _ProjectsState extends State { .copyWith(fontWeight: FontWeight.bold), ), IconButton( - onPressed: () { - controller - .nextPage( - duration: Durations.medium4, curve: Curves.easeOut) - .then((value) => setPage()); - }, + onPressed: _currentPage == projectsDATA.length - 1 + ? null + : () { + controller + .nextPage( + duration: Durations.medium4, + curve: Curves.easeOut) + .then((value) => setPage()); + }, icon: const Icon(Icons.arrow_circle_right_outlined)) ], ), diff --git a/pubspec.lock b/pubspec.lock index 105e7ee..55011c4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -244,26 +244,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" lints: dependency: transitive description: @@ -324,10 +324,10 @@ packages: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" nested: dependency: transitive description: @@ -538,10 +538,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" typed_data: dependency: transitive description: @@ -698,10 +698,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.2.1" web: dependency: transitive description: