Last active
September 3, 2021 00:13
-
-
Save imaNNeo/eee68a4f329d16b170b1363beca083ab to your computer and use it in GitHub Desktop.
Flutter4Fun.com - UI Challenge 6
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 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData( | |
brightness: Brightness.light | |
), | |
debugShowCheckedModeBanner: false, | |
home: MyHomePage(), | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("flutter4fun.com"), | |
), | |
body: Center( | |
child: Padding( | |
padding: const EdgeInsets.all(20.0), | |
child: JuiceWidget(), | |
), | |
), | |
); | |
} | |
} | |
class JuiceWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return AspectRatio( | |
aspectRatio: 1.25, | |
child: Stack( | |
children: [ | |
Container( | |
decoration: BoxDecoration(color: Color(0xFFDC691F), borderRadius: BorderRadius.circular(24)), | |
), | |
Row( | |
children: [ | |
Expanded(child: Placeholder()), | |
SizedBox( | |
width: 120, | |
child: Image.network( | |
"https://flutter4fun.com/wp-content/uploads/2021/09/juice2.png", | |
), | |
) | |
], | |
) | |
], | |
), | |
); | |
} | |
} |
Author
imaNNeo
commented
Sep 2, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment