Created
November 14, 2020 16:27
-
-
Save imaNNeo/f6d45b06bfed127c35d9c7c428829530 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import 'dart:ui'; | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Flutter 4 Fun', | |
| home: HeroDetailsPage(), | |
| ); | |
| } | |
| } | |
| class HeroDetailsPage extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| final appBarHeight = 80.0; | |
| return Scaffold( | |
| body: Container( | |
| width: double.infinity, | |
| height: double.infinity, | |
| child: Stack( | |
| children: [ | |
| SafeArea( | |
| child: Row( | |
| crossAxisAlignment: CrossAxisAlignment.center, | |
| children: [ | |
| SizedBox( | |
| width: 18, | |
| ), | |
| IconButton( | |
| icon: Icon( | |
| Icons.arrow_back_ios, | |
| color: Colors.white, | |
| size: 20, | |
| ), | |
| onPressed: () { | |
| Navigator.of(context).pop(); | |
| }, | |
| ), | |
| Text( | |
| 'Overview', | |
| style: TextStyle( | |
| color: Colors.white, | |
| fontSize: 20, | |
| fontWeight: FontWeight.bold, | |
| ), | |
| ), | |
| Expanded( | |
| child: Container( | |
| height: appBarHeight, | |
| )), | |
| Container( | |
| width: appBarHeight, | |
| height: appBarHeight, | |
| child: Icon( | |
| Icons.menu, | |
| color: Colors.white, | |
| ), | |
| ) | |
| ], | |
| ), | |
| ), | |
| Padding( | |
| padding: EdgeInsets.only(top: appBarHeight), | |
| child: _HeroDetailsImage(), | |
| ), | |
| ], | |
| ), | |
| decoration: BoxDecoration( | |
| gradient: LinearGradient( | |
| colors: [ | |
| Color(0xFFF4E342), | |
| Color(0xFFEE3474), | |
| ], | |
| begin: Alignment(0.3, -1), | |
| end: Alignment(-0.8, 1), | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| } | |
| class _HeroDetailsImage extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Padding( | |
| padding: const EdgeInsets.all(28.0), | |
| child: AspectRatio( | |
| aspectRatio: 1, | |
| child: Container( | |
| child: Stack( | |
| children: [ | |
| Align( | |
| child: Container( | |
| margin: EdgeInsets.only( | |
| left: 16, | |
| right: 16, | |
| top: 16, | |
| ), | |
| decoration: BoxDecoration( | |
| color: Colors.white.withOpacity(0.1), | |
| borderRadius: BorderRadius.all(Radius.circular(28)), | |
| ), | |
| ), | |
| alignment: Alignment.bottomCenter, | |
| ), | |
| Align( | |
| child: Container( | |
| margin: EdgeInsets.all(8.0), | |
| decoration: BoxDecoration( | |
| color: Colors.white.withOpacity(0.1), | |
| borderRadius: BorderRadius.all(Radius.circular(28)), | |
| ), | |
| ), | |
| alignment: Alignment.bottomCenter, | |
| ), | |
| Align( | |
| child: Container( | |
| margin: EdgeInsets.only( | |
| bottom: 16, | |
| ), | |
| decoration: BoxDecoration( | |
| color: Colors.white.withOpacity(0.4), | |
| borderRadius: BorderRadius.all(Radius.circular(28)), | |
| ), | |
| ), | |
| alignment: Alignment.bottomCenter, | |
| ), | |
| ], | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment