Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating the TopSection for Web and Putting the Project in English #2

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
},
);
}
}