Fixed Scroll problems in About Us

This commit is contained in:
Hansedison02 2022-05-30 11:56:52 +07:00
parent 423e252006
commit 96b9a2e353

View file

@ -15,74 +15,90 @@ class _AboutUsBodyState extends State<AboutUsBody> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_controller = VideoPlayerController.network( _controller =
'https://nekoya.moe.team/img/AboutUs.mp4') VideoPlayerController.network('https://nekoya.moe.team/img/AboutUs.mp4')
..initialize().then((_) { ..initialize().then((_) {
setState(() { setState(() {
_controller.play(); _controller.play();
_controller.setLooping(true); _controller.setLooping(true);
}); });
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: const EdgeInsets.all(20.0), margin: const EdgeInsets.all(20.0),
child: Column( child: ListView(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, scrollDirection: Axis.vertical,
crossAxisAlignment: CrossAxisAlignment.center, shrinkWrap: true,
children: [ children: [
ClipRRect( Column(
borderRadius: const BorderRadius.all(Radius.circular(10.0)), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
child: _controller.value.isInitialized crossAxisAlignment: CrossAxisAlignment.center,
? AspectRatio( children: [
aspectRatio: _controller.value.aspectRatio, ClipRRect(
child: VideoPlayer(_controller), borderRadius: const BorderRadius.all(Radius.circular(10.0)),
) child: _controller.value.isInitialized
: const Image(image: AssetImage('assets/images/about_us_thumbnail.webp'),), ? AspectRatio(
), aspectRatio: _controller.value.aspectRatio,
Card( child: VideoPlayer(_controller),
color: const Color(0xff212226), )
shape: RoundedRectangleBorder( : const Image(
borderRadius: BorderRadius.circular(10), image:
), AssetImage('assets/images/about_us_thumbnail.webp'),
child: const Padding( ),
padding: EdgeInsets.all(16.0),
child: Text(
'Nekoya is your place for sneakers for the entire family from many name brands. Youll 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,
), ),
), Card(
), color: const Color(0xff212226),
Container( shape: RoundedRectangleBorder(
margin: const EdgeInsets.only(bottom: 10.0), borderRadius: BorderRadius.circular(10),
child: ElevatedButton( ),
style: ButtonStyle( child: const Padding(
padding: MaterialStateProperty.all(const EdgeInsets.all(15.0)), padding: EdgeInsets.all(16.0),
foregroundColor: child: Text(
MaterialStateProperty.all(const Color(0xff8B0000)), 'Nekoya is your place for sneakers for the entire family from many name brands. Youll 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.',
backgroundColor: style: TextStyle(
MaterialStateProperty.all(const Color(0xff8B0000)), fontSize: 20.0, color: Colors.white, height: 1.5),
shape: MaterialStateProperty.all<RoundedRectangleBorder>( textAlign: TextAlign.justify,
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 { Container(
if (!await launchUrl(Uri.parse('mailto:nekoya@chocola.dev'))) throw 'Could not launch'; margin: const EdgeInsets.only(bottom: 10.0),
}, child: ElevatedButton(
), style: ButtonStyle(
), padding:
GestureDetector( MaterialStateProperty.all(const EdgeInsets.all(15.0)),
onTap: () async { foregroundColor:
if (!await launchUrl(Uri.parse('https://nekoya.moe.team'))) throw 'Could not launch'; MaterialStateProperty.all(const Color(0xff8B0000)),
}, backgroundColor:
child: const Text('© 2021-2022 Nekoya Co. Ltd.', style: TextStyle(color: Colors.white, fontSize: 15),) MaterialStateProperty.all(const Color(0xff8B0000)),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
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),
)),
],
), ),
], ],
), ),