[design] Update components

This commit is contained in:
Neeraj Gupta 2023-04-07 15:11:37 +05:30
parent 1e0e5c3ff5
commit 0629789a22
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
2 changed files with 94 additions and 1 deletions

View file

@ -27,6 +27,10 @@ class EnteColorScheme {
final Color strokeBase;
final Color strokeMuted;
final Color strokeFaint;
final Color strokeFainter;
final Color blurStrokeBase;
final Color blurStrokeFaint;
final Color blurStrokePressed;
// Fixed Colors
final Color primaryGreen;
@ -55,7 +59,11 @@ class EnteColorScheme {
this.fillFaintPressed,
this.strokeBase,
this.strokeMuted,
this.strokeFaint, {
this.strokeFaint,
this.strokeFainter,
this.blurStrokeBase,
this.blurStrokeFaint,
this.blurStrokePressed, {
this.primaryGreen = _primaryGreen,
this.primary700 = _primary700,
this.primary500 = _primary500,
@ -84,6 +92,10 @@ const EnteColorScheme lightScheme = EnteColorScheme(
strokeBaseLight,
strokeMutedLight,
strokeFaintLight,
strokeFainterLight,
blurStrokeBaseLight,
blurStrokeFaintLight,
blurStrokePressedLight,
);
const EnteColorScheme darkScheme = EnteColorScheme(
@ -102,6 +114,10 @@ const EnteColorScheme darkScheme = EnteColorScheme(
strokeBaseDark,
strokeMutedDark,
strokeFaintDark,
strokeFainterDark,
blurStrokeBaseDark,
blurStrokeFaintDark,
blurStrokePressedDark,
);
// Background Colors
@ -144,10 +160,18 @@ const Color fillFaintPressedDark = Color.fromRGBO(255, 255, 255, 0.06);
const Color strokeBaseLight = Color.fromRGBO(0, 0, 0, 1);
const Color strokeMutedLight = Color.fromRGBO(0, 0, 0, 0.24);
const Color strokeFaintLight = Color.fromRGBO(0, 0, 0, 0.04);
const Color strokeFainterLight = Color.fromRGBO(0, 0, 0, 0.06);
const Color blurStrokeBaseLight = Color.fromRGBO(0, 0, 0, 0.65);
const Color blurStrokeFaintLight = Color.fromRGBO(0, 0, 0, 0.08);
const Color blurStrokePressedLight = Color.fromRGBO(0, 0, 0, 0.50);
const Color strokeBaseDark = Color.fromRGBO(255, 255, 255, 1);
const Color strokeMutedDark = Color.fromRGBO(255, 255, 255, 0.24);
const Color strokeFaintDark = Color.fromRGBO(255, 255, 255, 0.16);
const Color strokeFainterDark = Color.fromRGBO(255, 255, 255, 0.08);
const Color blurStrokeBaseDark = Color.fromRGBO(255, 255, 255, 0.90);
const Color blurStrokeFaintDark = Color.fromRGBO(255, 255, 255, 0.06);
const Color blurStrokePressedDark = Color.fromRGBO(255, 255, 255, 0.50);
// Fixed Colors

View file

@ -0,0 +1,69 @@
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:flutter/material.dart';
enum DividerType {
solid,
menu,
menuNoIcon,
bottomBar,
}
class DividerWidget extends StatelessWidget {
final DividerType dividerType;
final Color bgColor;
final bool divColorHasBlur;
final EdgeInsets? padding;
const DividerWidget({
Key? key,
required this.dividerType,
this.bgColor = Colors.transparent,
this.divColorHasBlur = true,
this.padding,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final dividerColor = divColorHasBlur
? getEnteColorScheme(context).blurStrokeFaint
: getEnteColorScheme(context).strokeFaint;
if (dividerType == DividerType.solid) {
return Container(
color: getEnteColorScheme(context).strokeFaint,
width: double.infinity,
height: 1,
);
}
if (dividerType == DividerType.bottomBar) {
return Container(
color: dividerColor,
width: double.infinity,
height: 1,
);
}
return Container(
color: bgColor,
padding: padding ?? EdgeInsets.zero,
child: Row(
children: [
SizedBox(
width: dividerType == DividerType.menu
? 48
: dividerType == DividerType.menuNoIcon
? 16
: 0,
height: 1,
),
Expanded(
child: Container(
color: dividerColor,
height: 1,
width: double.infinity,
),
),
],
),
);
}
}