forked from firka/student-legacy
added check everywhere to shadow effect
This commit is contained in:
parent
906de6dd45
commit
205d90523c
@ -214,19 +214,21 @@ Widget filterItemBuilder(
|
|||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor.withOpacity(
|
offset: const Offset(0, 21),
|
||||||
Theme.of(context).shadowColor.opacity *
|
blurRadius: 23.0,
|
||||||
CurvedAnimation(
|
color: Theme.of(context).shadowColor.withOpacity(
|
||||||
parent: CurvedAnimation(
|
Theme.of(context).shadowColor.opacity *
|
||||||
parent: animation,
|
CurvedAnimation(
|
||||||
curve: Curves.easeInOutCubic),
|
parent: CurvedAnimation(
|
||||||
curve: const Interval(2 / 3, 1.0),
|
parent: animation,
|
||||||
).value,
|
curve: Curves.easeInOutCubic),
|
||||||
),
|
curve: const Interval(2 / 3, 1.0),
|
||||||
),
|
).value,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: child,
|
child: child,
|
||||||
|
@ -34,8 +34,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
|
|
||||||
GradeCalculatorProvider calculatorProvider =
|
GradeCalculatorProvider calculatorProvider =
|
||||||
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
||||||
SettingsProvider settingsProvider =
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
Provider.of<SettingsProvider>(context);
|
|
||||||
// Test order:
|
// Test order:
|
||||||
// description
|
// description
|
||||||
// mode
|
// mode
|
||||||
@ -50,7 +49,8 @@ class GradeTile extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
title = subjectName;
|
title = subjectName;
|
||||||
isTitleItalic = grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
isTitleItalic =
|
||||||
|
grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test order:
|
// Test order:
|
||||||
@ -62,7 +62,9 @@ class GradeTile extends StatelessWidget {
|
|||||||
? modeDescription
|
? modeDescription
|
||||||
: ""
|
: ""
|
||||||
: subjectName;
|
: subjectName;
|
||||||
isSubtitleItalic = isSubjectView ? false : grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
isSubtitleItalic = isSubjectView
|
||||||
|
? false
|
||||||
|
: grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
} else {
|
} else {
|
||||||
subtitle = grade.value.valueName.split("(")[0];
|
subtitle = grade.value.valueName.split("(")[0];
|
||||||
}
|
}
|
||||||
@ -127,9 +129,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontStyle: isTitleItalic
|
fontStyle: isTitleItalic ? FontStyle.italic : null),
|
||||||
? FontStyle.italic
|
|
||||||
: null),
|
|
||||||
),
|
),
|
||||||
subtitle: subtitle != ""
|
subtitle: subtitle != ""
|
||||||
? censored
|
? censored
|
||||||
@ -149,7 +149,10 @@ class GradeTile extends StatelessWidget {
|
|||||||
subtitle,
|
subtitle,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w500, fontStyle: isSubtitleItalic ? FontStyle.italic : null),
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontStyle:
|
||||||
|
isSubtitleItalic ? FontStyle.italic : null),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
trailing: isSubjectView
|
trailing: isSubjectView
|
||||||
@ -210,8 +213,8 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
GradeValue value = this.value;
|
GradeValue value = this.value;
|
||||||
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
||||||
|
|
||||||
Color color =
|
Color color = this.color ??
|
||||||
this.color ?? gradeColor(context: context, value: value.value, nocolor: nocolor);
|
gradeColor(context: context, value: value.value, nocolor: nocolor);
|
||||||
Widget valueText;
|
Widget valueText;
|
||||||
final percentage = value.percentage;
|
final percentage = value.percentage;
|
||||||
|
|
||||||
@ -283,7 +286,9 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
color: color.withOpacity(contrast ? 1.0 : .25),
|
color: color.withOpacity(contrast ? 1.0 : .25),
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
if (shadow)
|
if (shadow &&
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false)
|
||||||
|
.shadowEffect)
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: color,
|
color: color,
|
||||||
blurRadius: 62.0,
|
blurRadius: 62.0,
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class Panel extends StatelessWidget {
|
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? child;
|
||||||
final Widget? title;
|
final Widget? title;
|
||||||
@ -25,7 +29,7 @@ class Panel extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(16.0),
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
if (hasShadow)
|
if (hasShadow && Provider.of<SettingsProvider>(context, listen: false).shadowEffect)
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
offset: const Offset(0, 21),
|
offset: const Offset(0, 21),
|
||||||
blurRadius: 23.0,
|
blurRadius: 23.0,
|
||||||
@ -51,7 +55,9 @@ class PanelTitle extends StatelessWidget {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 14.0, bottom: 8.0),
|
padding: const EdgeInsets.only(left: 14.0, bottom: 8.0),
|
||||||
child: DefaultTextStyle(
|
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,
|
child: title,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -69,7 +75,8 @@ class PanelHeader extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
decoration: BoxDecoration(
|
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,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@ -120,7 +127,9 @@ class PanelFooter extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
decoration: BoxDecoration(
|
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,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class EmptyCard extends StatefulWidget {
|
class EmptyCard extends StatefulWidget {
|
||||||
const EmptyCard({
|
const EmptyCard({
|
||||||
@ -39,12 +41,14 @@ class _EmptyCardState extends State<EmptyCard> {
|
|||||||
color: const Color(0x280008FF),
|
color: const Color(0x280008FF),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
color: Colors.black.withOpacity(0.08),
|
.shadowEffect)
|
||||||
offset: const Offset(0, 5),
|
BoxShadow(
|
||||||
blurRadius: 20,
|
color: Colors.black.withOpacity(0.08),
|
||||||
spreadRadius: 10,
|
offset: const Offset(0, 5),
|
||||||
),
|
blurRadius: 20,
|
||||||
|
spreadRadius: 10,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: DottedBorder(
|
child: DottedBorder(
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import 'package:auto_size_text/auto_size_text.dart';
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/ui/widgets/grade/grade_tile.dart';
|
import 'package:filcnaplo/ui/widgets/grade/grade_tile.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:i18n_extension/i18n_widget.dart';
|
import 'package:i18n_extension/i18n_widget.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class StatisticsTile extends StatelessWidget {
|
class StatisticsTile extends StatelessWidget {
|
||||||
const StatisticsTile({
|
const StatisticsTile({
|
||||||
@ -31,7 +33,9 @@ class StatisticsTile extends StatelessWidget {
|
|||||||
} else {
|
} else {
|
||||||
valueText = value.toStringAsFixed(0);
|
valueText = value.toStringAsFixed(0);
|
||||||
}
|
}
|
||||||
if (I18n.of(context).locale.languageCode != "en") valueText = valueText.replaceAll(".", ",");
|
if (I18n.of(context).locale.languageCode != "en") {
|
||||||
|
valueText = valueText.replaceAll(".", ",");
|
||||||
|
}
|
||||||
|
|
||||||
if (value.isNaN) {
|
if (value.isNaN) {
|
||||||
valueText = "?";
|
valueText = "?";
|
||||||
@ -44,11 +48,13 @@ class StatisticsTile extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
@ -68,12 +74,18 @@ class StatisticsTile extends StatelessWidget {
|
|||||||
if (title != null) const SizedBox(height: 4.0),
|
if (title != null) const SizedBox(height: 4.0),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(top: 4.0),
|
margin: const EdgeInsets.only(top: 4.0),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0),
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: fill ? (color ?? gradeColor(context: context, value: value)).withOpacity(.2) : null,
|
color: fill
|
||||||
|
? (color ?? gradeColor(context: context, value: value))
|
||||||
|
.withOpacity(.2)
|
||||||
|
: null,
|
||||||
border: outline || fill
|
border: outline || fill
|
||||||
? Border.all(
|
? Border.all(
|
||||||
color: (color ?? gradeColor(context: context, value: value)).withOpacity(outline ? 1.0 : 0.0),
|
color:
|
||||||
|
(color ?? gradeColor(context: context, value: value))
|
||||||
|
.withOpacity(outline ? 1.0 : 0.0),
|
||||||
width: fill ? 2.0 : 5.0,
|
width: fill ? 2.0 : 5.0,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/progress_bar.dart';
|
import 'package:filcnaplo_mobile_ui/common/progress_bar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'live_card.i18n.dart';
|
import 'live_card.i18n.dart';
|
||||||
|
|
||||||
enum ProgressAccuracy { minutes, seconds }
|
enum ProgressAccuracy { minutes, seconds }
|
||||||
@ -67,11 +69,13 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
borderRadius: BorderRadius.circular(16.0),
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -180,12 +184,12 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets
|
margin: const EdgeInsets
|
||||||
.only(
|
.only(
|
||||||
left: 6.0,
|
left: 6.0,
|
||||||
bottom: 3.0),
|
bottom: 3.0),
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets
|
const EdgeInsets
|
||||||
.symmetric(
|
.symmetric(
|
||||||
horizontal: 4.0,
|
horizontal: 4.0,
|
||||||
vertical: 2.0),
|
vertical: 2.0),
|
||||||
decoration:
|
decoration:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user