[auth] Revert Notification banner (#4806)
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 55 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 104 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 93 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,181 +0,0 @@
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:ente_auth/theme/ente_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rive/rive.dart' as rive;
|
||||
import 'package:styled_text/tags/styled_text_tag.dart';
|
||||
import 'package:styled_text/widgets/styled_text.dart';
|
||||
|
||||
enum BannerType {
|
||||
review,
|
||||
supportEnte,
|
||||
freeStorage,
|
||||
discount,
|
||||
}
|
||||
|
||||
class BannerWidget extends StatelessWidget {
|
||||
final String text;
|
||||
final String? subText;
|
||||
final BannerType type;
|
||||
final TextStyle? mainTextStyle;
|
||||
|
||||
const BannerWidget({
|
||||
super.key,
|
||||
required this.text,
|
||||
required this.type,
|
||||
this.subText,
|
||||
this.mainTextStyle,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool isLightMode =
|
||||
MediaQuery.of(context).platformBrightness == Brightness.light;
|
||||
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
Color dashColor;
|
||||
List<BoxShadow>? boxShadow;
|
||||
String rivePath;
|
||||
|
||||
switch (type) {
|
||||
case BannerType.review:
|
||||
rivePath = "assets/rate_us.riv";
|
||||
dashColor = const Color.fromRGBO(255, 191, 12, 1);
|
||||
boxShadow = [
|
||||
BoxShadow(
|
||||
color: const Color(0xFFFDB816).withOpacity(0.1),
|
||||
blurRadius: 50,
|
||||
spreadRadius: 80,
|
||||
),
|
||||
BoxShadow(
|
||||
color: const Color(0xFFFDB816).withOpacity(0.2),
|
||||
blurRadius: 25,
|
||||
),
|
||||
];
|
||||
break;
|
||||
case BannerType.supportEnte:
|
||||
rivePath = "assets/star_us.riv";
|
||||
dashColor = const Color.fromRGBO(233, 233, 233, 1);
|
||||
boxShadow = [
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(78, 78, 78, 1).withOpacity(0.2),
|
||||
blurRadius: 50,
|
||||
spreadRadius: 100,
|
||||
),
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(23, 22, 22, 0.30).withOpacity(0.1),
|
||||
blurRadius: 25,
|
||||
),
|
||||
];
|
||||
|
||||
case BannerType.freeStorage:
|
||||
rivePath = "assets/ente_5gb.riv";
|
||||
dashColor = const Color.fromRGBO(29, 185, 84, 1);
|
||||
boxShadow = [
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(38, 203, 95, 1).withOpacity(0.08),
|
||||
blurRadius: 50,
|
||||
spreadRadius: 100,
|
||||
),
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.50).withOpacity(0.08),
|
||||
blurRadius: 25,
|
||||
),
|
||||
];
|
||||
case BannerType.discount:
|
||||
dashColor = const Color.fromRGBO(29, 185, 84, 1);
|
||||
rivePath = "assets/discount.riv";
|
||||
boxShadow = [
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(38, 203, 95, 1).withOpacity(0.08),
|
||||
blurRadius: 50,
|
||||
spreadRadius: 100,
|
||||
),
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.50).withOpacity(0.08),
|
||||
blurRadius: 25,
|
||||
),
|
||||
];
|
||||
}
|
||||
return ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(50)),
|
||||
child: DottedBorder(
|
||||
borderType: BorderType.RRect,
|
||||
radius: const Radius.circular(50),
|
||||
dashPattern: const <double>[3, 3],
|
||||
color: dashColor,
|
||||
child: Stack(
|
||||
children: [
|
||||
if (BannerType.supportEnte == type)
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(50)),
|
||||
child: isLightMode
|
||||
? Image.asset("assets/calender_banner_light.png")
|
||||
: Image.asset("assets/calender_banner_dark.png"),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
if (!isLightMode)
|
||||
Container(
|
||||
height: 80,
|
||||
width: 80,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: boxShadow,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: rive.RiveAnimation.asset(
|
||||
rivePath,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
StyledText(
|
||||
text: text,
|
||||
style: getEnteTextTheme(context).large,
|
||||
textAlign: TextAlign.left,
|
||||
tags: {
|
||||
'bold-green': StyledTextTag(
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: colorScheme.primaryGreen,
|
||||
),
|
||||
),
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
subText ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1302,22 +1302,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
rive:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: rive
|
||||
sha256: "2551a44fa766a7ed3f52aa2b94feda6d18d00edc25dee5f66e72e9b365bb6d6c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.13.20"
|
||||
rive_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: rive_common
|
||||
sha256: "2ba42f80d37a4efd0696fb715787c4785f8a13361e8aea9227c50f1e78cf763a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.15"
|
||||
screen_retriever:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -84,8 +84,7 @@ dependencies:
|
||||
privacy_screen: ^0.0.6
|
||||
protobuf: ^3.0.0
|
||||
qr_code_scanner: ^1.0.1
|
||||
qr_flutter: ^4.1.0
|
||||
rive: ^0.13.20
|
||||
qr_flutter: ^4.1.0
|
||||
sentry: ^8.7.0
|
||||
sentry_flutter: ^8.7.0
|
||||
share_plus: ^10.0.2
|
||||
|
||||
Reference in New Issue
Block a user