Skip to content

Instantly share code, notes, and snippets.

@Aldo111
Created June 23, 2021 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aldo111/01727ca3bcb6f57261fd9555b8139ff5 to your computer and use it in GitHub Desktop.
Save Aldo111/01727ca3bcb6f57261fd9555b8139ff5 to your computer and use it in GitHub Desktop.
Part 2 of my Flutter Tutorials
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
const primaryColor = Color(0xFFFDFDFD);
const secondaryColor = Color(0xFF252525);
const double iconSize = 36;
const imageUrl =
'https://upload.wikimedia.org/wikipedia/commons/a/a0/Arh-avatar.jpg';
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
appBarTheme: AppBarTheme(
backgroundColor: primaryColor,
iconTheme: IconThemeData(
color: secondaryColor,
size: iconSize,
))),
home: Scaffold(
appBar: AppBar(
leading: Padding(
padding: const EdgeInsets.only(left: 16.0),
child: Icon(
Icons.grid_view,
),
),
elevation: 0,
actions: [
IconButton(
iconSize: iconSize,
onPressed: () {},
icon: Icon(Icons.search),
),
Stack(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: ClipRRect(
child: Image.network(
imageUrl,
width: 36,
),
borderRadius: BorderRadius.circular(8),
),
),
Positioned(
top: 3,
right: 3,
child: Container(
width: 12,
height: 12,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(12))),
),
],
),
SizedBox(width: 16),
],
),
body: HomeScreen()));
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Expanded(
child: Stack(
children: [
Container(color: secondaryColor),
Container(
decoration: BoxDecoration(
color: primaryColor,
borderRadius:
BorderRadius.only(bottomLeft: Radius.circular(88)))),
],
),
),
Container(
height: 200,
child: Stack(
children: [
Container(color: primaryColor),
Container(
decoration: BoxDecoration(
color: secondaryColor,
borderRadius:
BorderRadius.only(topRight: Radius.circular(88)))),
],
),
),
],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment