Skip to content

Commit

Permalink
addde home page view
Browse files Browse the repository at this point in the history
  • Loading branch information
mikezamayias committed Jan 23, 2022
1 parent a348e3f commit 2088396
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions lib/pages/home/home_page_view.dart
Original file line number Diff line number Diff line change
@@ -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<PageKeyProvider>(context, listen: false)
.key = '/phones';
},
),
],
),
),
),
);
},
);
}
}

0 comments on commit 2088396

Please sign in to comment.