added check everywhere to shadow effect
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import 'package:filcnaplo/models/settings.dart';
|
||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class Panel extends StatelessWidget {
|
||||
const Panel({Key? key, this.child, this.title, this.padding, this.hasShadow = true}) : super(key: key);
|
||||
const Panel(
|
||||
{Key? key, this.child, this.title, this.padding, this.hasShadow = true})
|
||||
: super(key: key);
|
||||
|
||||
final Widget? child;
|
||||
final Widget? title;
|
||||
@@ -25,7 +29,7 @@ class Panel extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
boxShadow: [
|
||||
if (hasShadow)
|
||||
if (hasShadow && Provider.of<SettingsProvider>(context, listen: false).shadowEffect)
|
||||
BoxShadow(
|
||||
offset: const Offset(0, 21),
|
||||
blurRadius: 23.0,
|
||||
@@ -51,7 +55,9 @@ class PanelTitle extends StatelessWidget {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 14.0, bottom: 8.0),
|
||||
child: DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w600, color: AppColors.of(context).text.withOpacity(0.65)),
|
||||
style: Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.of(context).text.withOpacity(0.65)),
|
||||
child: title,
|
||||
),
|
||||
);
|
||||
@@ -69,7 +75,8 @@ class PanelHeader extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
padding: padding,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -120,7 +127,9 @@ class PanelFooter extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
padding: padding,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(16.0), bottomRight: Radius.circular(16.0)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(16.0),
|
||||
bottomRight: Radius.circular(16.0)),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
|
||||
Reference in New Issue
Block a user