Skip to content

Commit

Permalink
Creating the TopSection for Web and Putting the Project in English
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecastrosales authored Feb 12, 2021
2 parents 8352254 + ef154dd commit 8c72721
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lib/pages/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import '../../breakpoints.dart';
import 'widgets/appbar/mobile_app_bar.dart';
import 'widgets/appbar/web_app_bar.dart';
import 'widgets/sections/top_section.dart';

class HomePage extends StatelessWidget {
@override
Expand All @@ -25,7 +26,9 @@ class HomePage extends StatelessWidget {
maxWidth: 1200,
),
child: ListView(

children: [
TopSection(),
],
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/home/widgets/appbar/web_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class WebAppBar extends StatelessWidget {
textColor: Colors.white,
borderSide: BorderSide(color: Colors.white, width: 1.5),
child: Text(
' Fazer login ',
' Log in ',
style: TextStyle(fontWeight: FontWeight.w600),
),
),
Expand All @@ -43,7 +43,7 @@ class WebAppBar extends StatelessWidget {
color: Colors.white,
textColor: Colors.black,
child: Text(
' Cadastre-se ',
' Sign up ',
style: TextStyle(fontWeight: FontWeight.w800),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class WebAppBarResponsiveContent extends StatelessWidget {
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: ' Pesquise um curso aqui ',
hintText: ' Search for anything... ',
isCollapsed: true,
),
),
Expand All @@ -42,7 +42,7 @@ class WebAppBarResponsiveContent extends StatelessWidget {
FlatButton(
onPressed: () {},
child: Text(
'Aprender',
'Learn',
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.grey[100],
Expand Down
27 changes: 27 additions & 0 deletions lib/pages/home/widgets/sections/custom_search_field.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:flutter/material.dart';

class CustomSearchField extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TextField(
cursorColor: Colors.blue,
style: TextStyle(color: Colors.grey[50]),
decoration: InputDecoration(
isDense: true,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey[50]),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey[50]),
),
hintStyle: TextStyle(color: Colors.grey[50]),
hintText: 'Type some search here',
suffixIcon: IconButton(
icon: Icon(Icons.search),
color: Colors.grey[50],
onPressed: (){},
),
),
);
}
}
70 changes: 70 additions & 0 deletions lib/pages/home/widgets/sections/top_section.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import 'package:flutter/material.dart';

import 'custom_search_field.dart';

class TopSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
final maxWidth = constraints.maxWidth;
if (maxWidth >= 1100) {
return AspectRatio(
aspectRatio: 3.2,
child: Stack(
children: [
AspectRatio(
aspectRatio: 3.4,
child: Image.network(
'https://images.pexels.com/photos/892757/pexels-photo-892757.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',
fit: BoxFit.cover,
),
),
Positioned(
left: 50,
top: 64,
child: Card(
color: Colors.black,
elevation: 16,
child: Container(
padding: EdgeInsets.all(24),
width: 450,
child: Column(
children: [
Text(
'Learn Flutter with this course',
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize: 32,
color: Colors.grey[50],
letterSpacing: 1.25,
height: 0.85
),
),
const SizedBox(height: 16),
Text(
'Let\'s Learn Flutter! '
'Create amazing things with a single code',
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize: 16,
color: Colors.grey[100],
letterSpacing: 1.1,
),
),
const SizedBox(height: 16),
CustomSearchField(),
],
),
),
),
),
],
),
);
}
return Container();
},
);
}
}

0 comments on commit 8c72721

Please sign in to comment.