From 8ed0b837c1ea1dc629d068507b690bb0ab2bd15e Mon Sep 17 00:00:00 2001 From: Moe Date: Sat, 28 May 2022 23:19:54 +0700 Subject: [PATCH] Redesign about us page --- lib/components/about_us_body.dart | 179 +++++++++++++----------------- 1 file changed, 75 insertions(+), 104 deletions(-) diff --git a/lib/components/about_us_body.dart b/lib/components/about_us_body.dart index 8468c9a..162c600 100644 --- a/lib/components/about_us_body.dart +++ b/lib/components/about_us_body.dart @@ -1,3 +1,5 @@ +import 'package:url_launcher/url_launcher.dart'; +import 'package:video_player/video_player.dart'; import 'package:flutter/material.dart'; class AboutUsBody extends StatefulWidget { @@ -8,113 +10,82 @@ class AboutUsBody extends StatefulWidget { } class _AboutUsBodyState extends State { + late VideoPlayerController _controller; + + @override + void initState() { + super.initState(); + _controller = VideoPlayerController.network( + 'https://nekoya.moe.team/img/AboutUs.mp4') + ..initialize().then((_) { + setState(() { + _controller.play(); + _controller.setLooping(true); + }); + }); + } + @override Widget build(BuildContext context) { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: const EdgeInsets.all(10), - alignment: Alignment.center, - child: Stack( - children: [ - Center( - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: Image.asset( - 'assets/images/AboutUs.gif', - ), - ), - ), - Center( - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: Container( - height: MediaQuery.of(context).size.height / 3.85, - color: - const Color.fromARGB(255, 18, 18, 19).withOpacity(0.4), - ), - ), - ), - Center( - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: SizedBox( - height: MediaQuery.of(context).size.height / 3.85, - child: Flexible( - child: Column( - children: const [ - SizedBox( - height: 15, - ), - Center( - child: Flexible( - child: Text( - 'About Us', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 30, - ), - ), - ), - ), - SizedBox( - height: 10, - ), - Center( - child: Flexible( - child: Text( - "Nekoya is your place for getting shoes for the entire family from many name brands. You'll discover styles for ladies, men and children from brands like Nike, Converse, Vans, Skechers, ASICS and many more! Nekoya is a goal for the popular footwear brands you know and love.", - style: TextStyle( - color: Colors.white, - fontSize: 10, - ), - textAlign: TextAlign.center, - ), - ), - ), - SizedBox( - height: 25, - ), - Center( - child: Flexible( - child: Text( - 'Contact Us', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 30, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - Center( - child: Flexible( - child: Text( - "moe@chocola.dev", - style: TextStyle( - color: Colors.white, - fontSize: 12.5, - ), - textAlign: TextAlign.center, - ), - ), - ), - ], - ), - ), - ), - ), - ), - ], + return Container( + margin: const EdgeInsets.all(20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(10.0)), + child: _controller.value.isInitialized + ? AspectRatio( + aspectRatio: _controller.value.aspectRatio, + child: VideoPlayer(_controller), + ) + : const Image(image: AssetImage('assets/images/about_us_thumbnail.webp'),), ), - ), - ], + Card( + color: const Color(0xff212226), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: const Padding( + padding: EdgeInsets.all(16.0), + child: Text( + 'Nekoya is your place for sneakers for the entire family from many name brands. You’ll discover styles for ladies, men and children from brands like Nike, Converse, Vans, Sperry, Madden Girl, Skechers, ASICS and then some! Nekoya is a main family footwear goal for the popular brands you know and love.', + style: TextStyle(fontSize: 20.0, color: Colors.white, height: 1.5), + textAlign: TextAlign.justify, + ), + ), + ), + Container( + margin: const EdgeInsets.only(bottom: 10.0), + child: ElevatedButton( + style: ButtonStyle( + padding: MaterialStateProperty.all(const EdgeInsets.all(15.0)), + foregroundColor: + MaterialStateProperty.all(const Color(0xff8B0000)), + backgroundColor: + MaterialStateProperty.all(const Color(0xff8B0000)), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + side: const BorderSide(color: Colors.black)))), + child: const Text( + 'Contact Us', + style: TextStyle(color: Colors.white, fontSize: 20), + ), + onPressed: () async { + if (!await launchUrl(Uri.parse('mailto:nekoya@chocola.dev'))) throw 'Could not launch'; + }, + ), + ), + GestureDetector( + onTap: () async { + if (!await launchUrl(Uri.parse('https://nekoya.moe.team'))) throw 'Could not launch'; + }, + child: const Text('© 2021-2022 Nekoya Co. Ltd.', style: TextStyle(color: Colors.white, fontSize: 15),) + ), + ], + ), ); } }