add border new memory cover widget in dark mode
This commit is contained in:
parent
ef206bd3b8
commit
81493927b3
2 changed files with 26 additions and 16 deletions
|
@ -64,7 +64,7 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
|
|||
final collatedMemories = _collateMemories(memories);
|
||||
|
||||
return SizedBox(
|
||||
height: 125 + MemoryCoverWidgetNew.centerStrokeWidth * 2,
|
||||
height: 125,
|
||||
child: ListView.builder(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
scrollDirection: Axis.horizontal,
|
||||
|
|
|
@ -10,7 +10,7 @@ class MemoryCoverWidgetNew extends StatefulWidget {
|
|||
final List<Memory> memories;
|
||||
final ScrollController controller;
|
||||
final double offsetOfItem;
|
||||
static const centerStrokeWidth = 0.5;
|
||||
static const centerStrokeWidth = 1.0;
|
||||
|
||||
const MemoryCoverWidgetNew({
|
||||
required this.memories,
|
||||
|
@ -37,6 +37,7 @@ class _MemoryCoverWidgetNewState extends State<MemoryCoverWidgetNew> {
|
|||
final title = _getTitle(widget.memories[index]);
|
||||
final memory = widget.memories[index];
|
||||
final isSeen = memory.isSeen();
|
||||
final currentTheme = MediaQuery.platformBrightnessOf(context);
|
||||
|
||||
return AnimatedBuilder(
|
||||
animation: widget.controller,
|
||||
|
@ -71,9 +72,12 @@ class _MemoryCoverWidgetNewState extends State<MemoryCoverWidgetNew> {
|
|||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: isSeen
|
||||
? Colors.transparent
|
||||
? currentTheme == Brightness.dark
|
||||
? const Color.fromRGBO(104, 104, 104, 0.32)
|
||||
: Colors.transparent
|
||||
: const Color.fromRGBO(1, 222, 77, 0.11),
|
||||
spreadRadius: MemoryCoverWidgetNew.centerStrokeWidth,
|
||||
spreadRadius:
|
||||
MemoryCoverWidgetNew.centerStrokeWidth / 2,
|
||||
blurRadius: 0,
|
||||
),
|
||||
const BoxShadow(
|
||||
|
@ -91,18 +95,24 @@ class _MemoryCoverWidgetNewState extends State<MemoryCoverWidgetNew> {
|
|||
alignment: Alignment.bottomCenter,
|
||||
children: [
|
||||
child!,
|
||||
isSeen
|
||||
? const SizedBox.shrink()
|
||||
: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color:
|
||||
const Color.fromRGBO(1, 222, 77, 0.11),
|
||||
width:
|
||||
MemoryCoverWidgetNew.centerStrokeWidth,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: isSeen
|
||||
? currentTheme == Brightness.dark
|
||||
? const Color.fromRGBO(
|
||||
104,
|
||||
104,
|
||||
104,
|
||||
0.32,
|
||||
)
|
||||
: Colors.transparent
|
||||
: const Color.fromRGBO(1, 222, 77, 0.11),
|
||||
width: MemoryCoverWidgetNew.centerStrokeWidth / 2,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
|
|
Loading…
Add table
Reference in a new issue