Skip to content

Instantly share code, notes, and snippets.

@diegoveloper
Created March 30, 2020 20:41
Show Gist options
  • Select an option

  • Save diegoveloper/c39830a2cb4999554ecfb8ca489fb9c3 to your computer and use it in GitHub Desktop.

Select an option

Save diegoveloper/c39830a2cb4999554ecfb8ca489fb9c3 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark(),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyHome(),
),
),
);
}
}
class MyHome extends StatelessWidget {
@override
Widget build(BuildContext context) {
final stackHeight = MediaQuery.of(context).size.height * 0.5;
final barHeight = 10.0;
return Scaffold(
body: Center(
child: SizedBox(
height: stackHeight,
child: Stack(
children: [
Positioned.fill(
child: Image.network(
'https://www.thedesignwork.com/wp-content/uploads/2014/01/animation-gif-2.gif',
fit: BoxFit.cover,
),
),
Positioned(
left: 0,
right: 0,
height: barHeight,
bottom: 0,
child: Container(
color: Colors.red,
),
),
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment