From c30ca7350ca054ef2dbc65fd8fe7fed2afa2ad3e Mon Sep 17 00:00:00 2001 From: Atharv Joshi Date: Sun, 28 Nov 2021 16:14:58 +0530 Subject: [PATCH] overflow errors --- .../lib/widgets/introduction_section.dart | 262 +++++++-------- doclense/lib/widgets/maintainers_section.dart | 307 +++++++++--------- doclense/lib/widgets/section_template.dart | 1 - 3 files changed, 293 insertions(+), 277 deletions(-) diff --git a/doclense/lib/widgets/introduction_section.dart b/doclense/lib/widgets/introduction_section.dart index 87e632e..e860aa6 100644 --- a/doclense/lib/widgets/introduction_section.dart +++ b/doclense/lib/widgets/introduction_section.dart @@ -15,150 +15,158 @@ class IntroductionSection extends StatelessWidget { ), builder: (context, sizingInformation){ if(sizingInformation.deviceScreenType == DeviceScreenType.desktop){ - return Container( - height: MediaQuery.of(context).size.height, - padding: MediaQuery.of(context).size.width <= 1024 ? const EdgeInsets.symmetric(horizontal: 10) : EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.1445), - color: const Color(0xff080F35), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: const EdgeInsets.fromLTRB(0, 145, 0, 50), - child: const SelectableText( - 'doclense', - style: TextStyle( - color: Colors.white, - fontSize: 80 + return ConstrainedBox( + constraints: BoxConstraints( + minHeight: MediaQuery.of(context).size.height, + ), + child: Container( + padding: MediaQuery.of(context).size.width <= 1024 ? const EdgeInsets.symmetric(horizontal: 10) : EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.1445), + color: const Color(0xff080F35), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: const EdgeInsets.fromLTRB(0, 145, 0, 50), + child: const SelectableText( + 'doclense', + style: TextStyle( + color: Colors.white, + fontSize: 80 + ), ), ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.4, - child: RichText( - text: const TextSpan( - text: 'The', - style: TextStyle( - color: Colors.white, - fontSize: 40, - ), - children: [ - TextSpan( - text: ' Open Source ', - style: TextStyle( - color: Color(0xff1F9FFF), - fontSize: 40 - ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.4, + child: RichText( + text: const TextSpan( + text: 'The', + style: TextStyle( + color: Colors.white, + fontSize: 40, ), - TextSpan( - text: 'Document Scanner made in India for the world', - style: TextStyle( - color: Colors.white, - fontSize: 40 + children: [ + TextSpan( + text: ' Open Source ', + style: TextStyle( + color: Color(0xff1F9FFF), + fontSize: 40 + ), ), - ), - ] - ) - ), - ), - Container( - margin: const EdgeInsets.fromLTRB(0, 40, 0, 85), - child: const SelectableText( - 'Scan your documents with ease!', - style: TextStyle( - color: Colors.white, - fontSize: 28 + TextSpan( + text: 'Document Scanner made in India for the world', + style: TextStyle( + color: Colors.white, + fontSize: 40 + ), + ), + ] + ) ), ), - ), - InkWell( - child: Image.asset('assets/images/google-play-badge.png' , scale: 2,), - onTap: () async { - if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { - throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; - } - }, - ), - ], - ), - Image.asset('assets/images/logo_blue.png' ,scale: 4,) - ], - ), + Container( + margin: const EdgeInsets.fromLTRB(0, 40, 0, 85), + child: const SelectableText( + 'Scan your documents with ease!', + style: TextStyle( + color: Colors.white, + fontSize: 28 + ), + ), + ), + InkWell( + child: Image.asset('assets/images/google-play-badge.png' , scale: 2,), + onTap: () async { + if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { + throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; + } + }, + ), + ], + ), + Image.asset('assets/images/logo_blue.png' ,scale: 4,) + ], + ), - ], + ], + ), ), ); } - return Container( - height: MediaQuery.of(context).size.height, - padding: MediaQuery.of(context).size.width <= 1024 ? const EdgeInsets.fromLTRB(5, 70, 5, 10) : EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.1445), - color: const Color(0xff080F35), - child: Column( - children: [ - Image.asset('assets/images/logo_blue.png' ,scale: 5,), - Container( - margin: const EdgeInsets.fromLTRB(0, 40, 0, 10), - child: const SelectableText( - 'doclense', - style: TextStyle( - color: Colors.white, - fontSize: 60 + return ConstrainedBox( + constraints: BoxConstraints( + minHeight: MediaQuery.of(context).size.height, + ), + child: Container( + padding: MediaQuery.of(context).size.width <= 1024 ? const EdgeInsets.fromLTRB(5, 70, 5, 10) : EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.1445), + color: const Color(0xff080F35), + child: Column( + children: [ + Image.asset('assets/images/logo_blue.png' ,scale: 5,), + Container( + margin: const EdgeInsets.fromLTRB(0, 40, 0, 10), + child: const SelectableText( + 'doclense', + style: TextStyle( + color: Colors.white, + fontSize: 60 + ), ), ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.9, - child: RichText( - textAlign: TextAlign.center, - text: const TextSpan( - text: 'The', - style: TextStyle( + SizedBox( + width: MediaQuery.of(context).size.width * 0.9, + child: RichText( + textAlign: TextAlign.center, + text: const TextSpan( + text: 'The', + style: TextStyle( - color: Colors.white, - fontSize: 30, - ), - children: [ - TextSpan( - text: ' Open Source ', - style: TextStyle( - color: Color(0xff1F9FFF), - fontSize: 30 - ), + color: Colors.white, + fontSize: 30, ), - TextSpan( - text: 'Document Scanner made in India for the world', - style: TextStyle( - color: Colors.white, - fontSize: 30 + children: [ + TextSpan( + text: ' Open Source ', + style: TextStyle( + color: Color(0xff1F9FFF), + fontSize: 30 + ), ), - ), - ] - ) - ), - ), - Container( - margin: const EdgeInsets.fromLTRB(0, 40, 0, 40), - child: const SelectableText( - 'Scan your documents with ease!', - style: TextStyle( - color: Colors.white, - fontSize: 24 + TextSpan( + text: 'Document Scanner made in India for the world', + style: TextStyle( + color: Colors.white, + fontSize: 30 + ), + ), + ] + ) ), ), - ), - InkWell( - child: Image.asset('assets/images/google-play-badge.png' , scale: 2,), - onTap: () async { - if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { - throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; - } - }, - ), - ], + Container( + margin: const EdgeInsets.fromLTRB(0, 40, 0, 40), + child: const SelectableText( + 'Scan your documents with ease!', + style: TextStyle( + color: Colors.white, + fontSize: 24 + ), + ), + ), + InkWell( + child: Image.asset('assets/images/google-play-badge.png' , scale: 2,), + onTap: () async { + if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { + throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; + } + }, + ), + ], + ), ), ); } diff --git a/doclense/lib/widgets/maintainers_section.dart b/doclense/lib/widgets/maintainers_section.dart index a1cf1ca..773fcce 100644 --- a/doclense/lib/widgets/maintainers_section.dart +++ b/doclense/lib/widgets/maintainers_section.dart @@ -22,9 +22,117 @@ class _MaintainersSectionState extends State { ), builder: (context, sizingInformation){ if(sizingInformation.deviceScreenType == DeviceScreenType.desktop){ - return Container( - padding: MediaQuery.of(context).size.width <= 1024 ? const EdgeInsets.symmetric(horizontal: 10) : EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.1445), - height: MediaQuery.of(context).size.height , + return ConstrainedBox( + constraints: BoxConstraints( + minHeight: MediaQuery.of(context).size.height, + ), + child: Container( + padding: MediaQuery.of(context).size.width <= 1024 ? const EdgeInsets.symmetric(horizontal: 10) : EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.1445), + width: MediaQuery.of(context).size.width, + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [ + Color(0xffFDB36E), + Color(0xffF68080), + ], + ) + ), + child: Column( + children: [ + Container( + margin: const EdgeInsets.only(top: 40), + child: const SelectableText( + 'Get the App!', + style: TextStyle( + color: Color(0xff080F35), + fontSize: 38 + ), + ), + ), + Container( + margin: const EdgeInsets.only(top: 80), + child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + InkWell( + child: Image.asset('assets/images/google-play-badge.png' , scale: 2,), + onTap: () async { + if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { + throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; + } + }, + ), + ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(const Color(0xffFCF0D0)), + ), + onPressed: () async { + if (!await launch('https://github.com/smaranjitghose/DocLense')) throw 'Count not launch https://github.com/smaranjitghose/DocLense'; + }, + child: Container( + margin: const EdgeInsets.symmetric(vertical: 12,horizontal: 20), + child: Row( + children: [ + Image.asset('assets/images/github_logo_black.png' , scale: 4,), + const SizedBox(width: 20,), + const Text( + 'Repository', + style: TextStyle( + color: Colors.black, + fontSize: 36 + ), + ), + ], + ), + ), + ), + ], + ), + ), + const Divider( + color: Colors.white, + thickness: 3, + ), + Container( + margin: const EdgeInsets.only(top: 45), + child: const SelectableText( + 'Project Maintainers', + style: TextStyle( + color: Color(0xff080F35), + fontSize: 38 + ), + ), + ), + Container( + margin: const EdgeInsets.only(top: 40), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + ProfileCard( + image: 'assets/images/smaranjit_ghose.png', + name: 'Smaranjit Ghose', + website: 'https://smaranjitghose.com/', + linkedin: 'https://www.linkedin.com/in/smaranjitghose/', + github: 'https://github.com/smaranjitghose', + ), + ProfileCard( + image: 'assets/images/anush_bhatia.png', + name: 'Anush Bhatia', + linkedin: 'https://www.linkedin.com/in/anushbhatia/', + github: 'https://github.com/anushbhatia', + ), + ], + ), + ), + ], + ) + ), + ); + } + return ConstrainedBox( + constraints: BoxConstraints( + minHeight: MediaQuery.of(context).size.height, + ), + child: Container( width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( gradient: LinearGradient( @@ -37,72 +145,71 @@ class _MaintainersSectionState extends State { child: Column( children: [ Container( - margin: const EdgeInsets.only(top: 40), + margin: const EdgeInsets.only(top: 30), child: const SelectableText( 'Get the App!', style: TextStyle( color: Color(0xff080F35), - fontSize: 38 + fontSize: 30 + ), + ), + ), + InkWell( + child: Image.asset('assets/images/google-play-badge.png' , scale: 3,), + onTap: () async { + if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { + throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; + } + }, + ), + SizedBox( + width: 192, + child: ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(const Color(0xffFCF0D0)), + ), + onPressed: () async { + if (!await launch('https://github.com/smaranjitghose/DocLense')) throw 'Count not launch https://github.com/smaranjitghose/DocLense'; + }, + child: Container( + margin: const EdgeInsets.symmetric(vertical: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/images/github_logo_black.png' , scale: 5,), + const SizedBox(width: 10,), + const Text( + 'Repository', + style: TextStyle( + color: Colors.black, + fontSize: 20 + ), + ), + ], + ), ), ), ), Container( - margin: const EdgeInsets.only(top: 80), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - InkWell( - child: Image.asset('assets/images/google-play-badge.png' , scale: 2,), - onTap: () async { - if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { - throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; - } - }, - ), - ElevatedButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xffFCF0D0)), - ), - onPressed: () async { - if (!await launch('https://github.com/smaranjitghose/DocLense')) throw 'Count not launch https://github.com/smaranjitghose/DocLense'; - }, - child: Container( - margin: const EdgeInsets.symmetric(vertical: 12,horizontal: 20), - child: Row( - children: [ - Image.asset('assets/images/github_logo_black.png' , scale: 4,), - const SizedBox(width: 20,), - const Text( - 'Repository', - style: TextStyle( - color: Colors.black, - fontSize: 36 - ), - ), - ], - ), - ), - ), - ], + margin: const EdgeInsets.only(top: 20), + child: const Divider( + color: Colors.white, + thickness: 3, ), ), - const Divider( - color: Colors.white, - thickness: 3, - ), Container( - margin: const EdgeInsets.only(top: 45), + margin: const EdgeInsets.only(top: 25), child: const SelectableText( 'Project Maintainers', style: TextStyle( color: Color(0xff080F35), - fontSize: 38 + fontSize: 30 ), ), ), Container( - margin: const EdgeInsets.only(top: 40), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + margin: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.3, 40, MediaQuery.of(context).size.width * 0.3, 0), + child: Column( children: [ ProfileCard( image: 'assets/images/smaranjit_ghose.png', @@ -122,105 +229,7 @@ class _MaintainersSectionState extends State { ), ], ) - ); - } - return Container( - width: MediaQuery.of(context).size.width, - decoration: const BoxDecoration( - gradient: LinearGradient( - colors: [ - Color(0xffFDB36E), - Color(0xffF68080), - ], - ) - ), - child: Column( - children: [ - Container( - margin: const EdgeInsets.only(top: 30), - child: const SelectableText( - 'Get the App!', - style: TextStyle( - color: Color(0xff080F35), - fontSize: 30 - ), - ), - ), - InkWell( - child: Image.asset('assets/images/google-play-badge.png' , scale: 3,), - onTap: () async { - if (!await launch('https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1')) { - throw 'Count not launch https://play.google.com/store/apps/details?id=com.anushbhatia.doclense&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'; - } - }, - ), - SizedBox( - width: 192, - child: ElevatedButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xffFCF0D0)), - ), - onPressed: () async { - if (!await launch('https://github.com/smaranjitghose/DocLense')) throw 'Count not launch https://github.com/smaranjitghose/DocLense'; - }, - child: Container( - margin: const EdgeInsets.symmetric(vertical: 6), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset('assets/images/github_logo_black.png' , scale: 5,), - const SizedBox(width: 10,), - const Text( - 'Repository', - style: TextStyle( - color: Colors.black, - fontSize: 20 - ), - ), - ], - ), - ), - ), - ), - Container( - margin: const EdgeInsets.only(top: 20), - child: const Divider( - color: Colors.white, - thickness: 3, - ), - ), - Container( - margin: const EdgeInsets.only(top: 25), - child: const SelectableText( - 'Project Maintainers', - style: TextStyle( - color: Color(0xff080F35), - fontSize: 30 - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.3, 40, MediaQuery.of(context).size.width * 0.3, 0), - child: Column( - children: [ - ProfileCard( - image: 'assets/images/smaranjit_ghose.png', - name: 'Smaranjit Ghose', - website: 'https://smaranjitghose.com/', - linkedin: 'https://www.linkedin.com/in/smaranjitghose/', - github: 'https://github.com/smaranjitghose', - ), - ProfileCard( - image: 'assets/images/anush_bhatia.png', - name: 'Anush Bhatia', - linkedin: 'https://www.linkedin.com/in/anushbhatia/', - github: 'https://github.com/anushbhatia', - ), - ], - ), - ), - ], - ) + ), ); }, ); diff --git a/doclense/lib/widgets/section_template.dart b/doclense/lib/widgets/section_template.dart index 70e117f..d603d38 100644 --- a/doclense/lib/widgets/section_template.dart +++ b/doclense/lib/widgets/section_template.dart @@ -34,7 +34,6 @@ class SectionTemplate extends StatelessWidget { minHeight: MediaQuery.of(context).size.height, ), child: Container( - // height: MediaQuery.of(context).size.height, color: color, child: Row( children: [