selfprivacy.org.app/lib/ui/components/brand_card/brand_card.dart

73 lines
1.9 KiB
Dart
Raw Normal View History

2020-11-30 12:03:55 +02:00
import 'package:flutter/material.dart';
import 'package:selfprivacy/config/brand_colors.dart';
2020-12-30 16:13:25 +02:00
import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
2020-11-30 12:03:55 +02:00
import 'package:selfprivacy/utils/extensions/elevation_extension.dart';
class BrandCard extends StatelessWidget {
2020-12-30 16:13:25 +02:00
const BrandCard({
Key key,
this.child,
this.isBlocked = false,
}) : super(key: key);
2020-11-30 12:03:55 +02:00
final Widget child;
2020-12-30 16:13:25 +02:00
final bool isBlocked;
2020-11-30 12:03:55 +02:00
@override
Widget build(BuildContext context) {
2020-12-30 16:13:25 +02:00
Widget res = Container(
2020-11-30 12:03:55 +02:00
margin: EdgeInsets.only(bottom: 30),
decoration: BoxDecoration(
2020-12-08 21:26:51 +02:00
color: Theme.of(context).brightness == Brightness.dark
? BrandColors.black
: BrandColors.white,
2020-11-30 12:03:55 +02:00
borderRadius: BorderRadius.circular(20),
).ev8,
padding: EdgeInsets.symmetric(
horizontal: 20,
vertical: 15,
),
child: child,
);
2020-12-30 16:13:25 +02:00
if (!isBlocked) {
return res;
}
return IgnorePointer(
child: Stack(
children: [
ColorFiltered(
colorFilter: ColorFilter.mode(
Colors.white,
BlendMode.saturation,
),
child: res,
),
Positioned(
top: 0,
left: 0,
right: 0,
bottom: 0,
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white.withOpacity(0.8),
),
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
BrandText.h3('Blocked'),
BrandText.h4('finish initializing first')
],
),
),
)
],
),
);
2020-11-30 12:03:55 +02:00
}
}