Files
moving_hole/lib/main.dart
2021-01-14 12:17:27 +03:00

75 lines
1.9 KiB
Dart

import 'dart:math';
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Transform.rotate(
angle: 0,
child: Scaffold(
appBar: AppBar(
title: Text('Hello, again'),
),
body: Stack(
// fit: StackFit.expand,
children: [
Container(
height: 800,
width: 800,
child: Image.network(
'https://wallpaperplay.com/walls/full/e/5/3/13586.jpg',
fit: BoxFit.cover,
)),
_getOverlay()
])));
}
Widget _getOverlay() {
return ColorFiltered(
colorFilter: ColorFilter.mode(Colors.black54, BlendMode.srcOut),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Align(
alignment: Alignment(-0.3, -0.8),
child: Container(
margin: const EdgeInsets.only(right: 4, bottom: 4),
height: 80,
width: 160,
decoration: BoxDecoration(
color: Colors.black, // Color does not matter but should not be transparent
borderRadius: BorderRadius.circular(40),
),
),
),
),
],
),
);
}
}