-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating the TopSection for Web and Putting the Project in English
- Loading branch information
Showing
5 changed files
with
105 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: (){}, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}, | ||
); | ||
} | ||
} |