From 2088396cb489c3148c37f375d1b73c476a7bb147 Mon Sep 17 00:00:00 2001 From: Mike Zamayias <29067825+mzamayias@users.noreply.github.com> Date: Sun, 23 Jan 2022 21:29:50 +0200 Subject: [PATCH] addde home page view --- lib/pages/home/home_page_view.dart | 47 ++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/lib/pages/home/home_page_view.dart b/lib/pages/home/home_page_view.dart index 0274b4b..5b818b2 100644 --- a/lib/pages/home/home_page_view.dart +++ b/lib/pages/home/home_page_view.dart @@ -1,15 +1,52 @@ +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ecommerce_website_demo/providers/page_key_provider.dart'; +import 'package:provider/provider.dart'; +import 'package:responsive_builder/responsive_builder.dart'; class HomePageView extends StatelessWidget { const HomePageView({Key? key}) : super(key: key); @override Widget build(BuildContext context) { - return Center( - child: Text( - 'Home Page', - style: Theme.of(context).textTheme.headline4, - ), + return ResponsiveBuilder( + builder: ( + BuildContext context, + SizingInformation sizingInformation, + ) { + return AnimatedContainer( + constraints: sizingInformation.isDesktop + ? const BoxConstraints(maxWidth: 1200) + : BoxConstraints( + maxWidth: sizingInformation.screenSize.width, + ), + duration: const Duration(milliseconds: 60), + padding: sizingInformation.isDesktop + ? const EdgeInsets.symmetric(horizontal: 90) + : const EdgeInsets.symmetric(horizontal: 30), + child: Center( + child: RichText( + text: TextSpan( + text: 'Don\'t have a phone?\n', + style: Theme.of(context).textTheme.headline2, + children: [ + TextSpan( + text: 'Start shopping', + style: Theme.of(context).textTheme.headline4!.copyWith( + color: Theme.of(context).primaryColor, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + Provider.of(context, listen: false) + .key = '/phones'; + }, + ), + ], + ), + ), + ), + ); + }, ); } }