remove rive and lottie altogether
This commit is contained in:
@@ -46,7 +46,6 @@ dependencies:
|
||||
elegant_notification: ^2.4.1
|
||||
flutter_feather_icons: ^2.0.0+1
|
||||
animated_flip_counter: ^0.3.4
|
||||
rive: ^0.12.4
|
||||
animated_background: ^2.0.0
|
||||
dropdown_button2: ^2.3.9
|
||||
home_widget: ^0.7.0+1
|
||||
|
||||
@@ -56,15 +56,15 @@ class GradeProvider with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> unseenAll() async {
|
||||
String? userId = _user.id;
|
||||
if (userId != null) {
|
||||
final userStore = _database.userStore;
|
||||
userStore.storeLastSeen(DateTime(1969),
|
||||
userId: userId, category: LastSeenCategory.surprisegrade);
|
||||
_lastSeen = DateTime(1969);
|
||||
}
|
||||
Future<void> unseenAll() async {
|
||||
String? userId = _user.id;
|
||||
if (userId != null) {
|
||||
final userStore = _database.userStore;
|
||||
await userStore.storeLastSeen(DateTime(1969),
|
||||
userId: userId, category: LastSeenCategory.surprisegrade);
|
||||
_lastSeen = DateTime(1969);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> restore() async {
|
||||
String? userId = _user.id;
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:refilc_kreta_api/providers/grade_provider.dart';
|
||||
import 'package:refilc_mobile_ui/common/widgets/grade/surprise_grade.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:rive/rive.dart';
|
||||
|
||||
import 'new_grades.i18n.dart';
|
||||
|
||||
@@ -49,8 +48,11 @@ class NewGradesSurprise extends StatelessWidget {
|
||||
blurRadius: 18.0,
|
||||
)
|
||||
]),
|
||||
child: const RiveAnimation.asset(
|
||||
"assets/animations/backpack-2.riv"),
|
||||
child: Icon(
|
||||
Icons.backpack,
|
||||
size: 36.0,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -14,7 +14,6 @@ import 'package:refilc_mobile_ui/pages/home/particle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:refilc/utils/format.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:rive/rive.dart' as rive;
|
||||
|
||||
import 'new_grades.i18n.dart';
|
||||
|
||||
@@ -33,7 +32,6 @@ class _SurpriseGradeState extends State<SurpriseGrade>
|
||||
late AnimationController _revealAnimScale;
|
||||
late AnimationController _revealAnimGrade;
|
||||
late AnimationController _revealAnimParticle;
|
||||
late rive.RiveAnimationController _controller;
|
||||
|
||||
late SettingsProvider settingsProvider;
|
||||
|
||||
@@ -59,7 +57,6 @@ class _SurpriseGradeState extends State<SurpriseGrade>
|
||||
_revealAnimParticle =
|
||||
AnimationController(vsync: this, duration: const Duration(seconds: 2));
|
||||
_revealAnimScale.animateTo(0.7, duration: Duration.zero);
|
||||
_controller = rive.SimpleAnimation('Timeline 1', autoplay: false);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_revealAnimFade.animateTo(1.0, curve: Curves.easeInOut);
|
||||
Future.delayed(const Duration(milliseconds: 200), () {
|
||||
@@ -80,7 +77,6 @@ class _SurpriseGradeState extends State<SurpriseGrade>
|
||||
_revealAnimScale.dispose();
|
||||
_revealAnimGrade.dispose();
|
||||
_revealAnimParticle.dispose();
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -112,8 +108,6 @@ class _SurpriseGradeState extends State<SurpriseGrade>
|
||||
}
|
||||
subtitle = false;
|
||||
setState(() => hold = false);
|
||||
_controller.isActive = true;
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
if (mounted) {
|
||||
_revealAnimGrade.animateTo(1.0, curve: Curves.fastLinearToSlowEaseIn);
|
||||
}
|
||||
@@ -124,336 +118,320 @@ class _SurpriseGradeState extends State<SurpriseGrade>
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
settingsProvider = Provider.of<SettingsProvider>(context);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
settingsProvider = Provider.of<SettingsProvider>(context);
|
||||
|
||||
return AnimatedBuilder(
|
||||
animation: _revealAnimFade,
|
||||
builder: (context, child) {
|
||||
return FadeTransition(
|
||||
opacity: _revealAnimFade,
|
||||
child: Material(
|
||||
color: Colors.black.withValues(alpha: .75),
|
||||
return AnimatedBuilder(
|
||||
animation: _revealAnimFade,
|
||||
builder: (context, child) {
|
||||
return FadeTransition(
|
||||
opacity: _revealAnimFade,
|
||||
child: Material(
|
||||
color: Colors.black.withOpacity(0.75),
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(0.05),
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withValues(alpha: .05),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: RadialGradient(
|
||||
colors: [Colors.transparent, Colors.black],
|
||||
radius: 1.5,
|
||||
stops: [0.2, 1.0],
|
||||
decoration: const BoxDecoration(
|
||||
gradient: RadialGradient(
|
||||
colors: [Colors.transparent, Colors.black],
|
||||
radius: 1.5,
|
||||
stops: [0.2, 1.0],
|
||||
),
|
||||
),
|
||||
child: bg.AnimatedBackground(
|
||||
vsync: this,
|
||||
behaviour: bg.RandomParticleBehaviour(
|
||||
options: bg.ParticleOptions(
|
||||
baseColor: Theme.of(context).colorScheme.secondary,
|
||||
spawnMinSpeed: 5.0,
|
||||
spawnMaxSpeed: 10.0,
|
||||
minOpacity: 0.05,
|
||||
maxOpacity: 0.08,
|
||||
spawnMinRadius: 30.0,
|
||||
spawnMaxRadius: 50.0,
|
||||
),
|
||||
),
|
||||
child: bg.AnimatedBackground(
|
||||
vsync: this,
|
||||
behaviour: bg.RandomParticleBehaviour(
|
||||
options: bg.ParticleOptions(
|
||||
baseColor: Theme.of(context).colorScheme.secondary,
|
||||
spawnMinSpeed: 5.0,
|
||||
spawnMaxSpeed: 10.0,
|
||||
minOpacity: .05,
|
||||
maxOpacity: .08,
|
||||
spawnMinRadius: 30.0,
|
||||
spawnMaxRadius: 50.0,
|
||||
particleCount: 20,
|
||||
),
|
||||
),
|
||||
child: ScaleTransition(
|
||||
scale: _revealAnimScale,
|
||||
child: child,
|
||||
),
|
||||
child: ScaleTransition(
|
||||
scale: _revealAnimScale,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: AnimatedBuilder(
|
||||
animation: _revealAnimGrade,
|
||||
builder: (context, child) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SlideTransition(
|
||||
position: _revealAnimGrade.drive(
|
||||
Tween(begin: Offset.zero, end: const Offset(0, 0.7))),
|
||||
child: AnimatedScale(
|
||||
scale: hold ? 1.1 : 1.0,
|
||||
curve: Curves.easeOutBack,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: GestureDetector(
|
||||
onLongPressDown: (_) => setState(() => hold = true),
|
||||
onLongPressEnd: (_) => reveal(),
|
||||
onLongPressCancel: reveal,
|
||||
child: ScaleTransition(
|
||||
scale: CurvedAnimation(
|
||||
curve: Curves.easeInOut,
|
||||
parent: _revealAnimGrade
|
||||
.drive(Tween(begin: 1.0, end: 0.8))),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: Icon(
|
||||
Icons.backpack,
|
||||
size: 200.0,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
SlideTransition(
|
||||
position: _revealAnimParticle.drive(Tween(
|
||||
begin: const Offset(0, 0.3),
|
||||
end: const Offset(0, 0.8))),
|
||||
child: FadeTransition(
|
||||
opacity: _revealAnimParticle,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(
|
||||
sigmaX: 32.0, sigmaY: 32.0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 32.0, vertical: 20.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.3),
|
||||
borderRadius:
|
||||
BorderRadius.circular(24.0),
|
||||
border: Border.all(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
width: 1.0),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (widget.grade.description !=
|
||||
"")
|
||||
Text(
|
||||
widget.grade.description,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 26.0,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
widget.grade.subject
|
||||
.renamedTo ??
|
||||
widget.grade.subject.name
|
||||
.capital(),
|
||||
style: TextStyle(
|
||||
color: Colors.white
|
||||
.withOpacity(0.8),
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 24.0,
|
||||
fontStyle: widget
|
||||
.grade
|
||||
.subject
|
||||
.isRenamed &&
|
||||
settingsProvider
|
||||
.renamedSubjectsItalics
|
||||
? FontStyle.italic
|
||||
: null),
|
||||
maxLines: 2,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
"${widget.grade.value.weight}%",
|
||||
style: TextStyle(
|
||||
color: Colors.white
|
||||
.withOpacity(0.7),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20.0),
|
||||
Icon(
|
||||
SubjectIcon.resolveVariant(
|
||||
subject: widget.grade.subject,
|
||||
context: context),
|
||||
color: Colors.white,
|
||||
size: 82.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 42.0),
|
||||
AnimatedOpacity(
|
||||
opacity: subtitle ? 1.0 : 0.0,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: Text(
|
||||
"open_subtitle".i18n,
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 24.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (_revealAnimGrade.value > 0)
|
||||
AnimatedBuilder(
|
||||
animation: _revealAnimParticle,
|
||||
builder: (context, child) {
|
||||
bool shouldPaint = false;
|
||||
if (_revealAnimParticle.status ==
|
||||
AnimationStatus.forward ||
|
||||
_revealAnimParticle.status ==
|
||||
AnimationStatus.reverse) {
|
||||
shouldPaint = true;
|
||||
}
|
||||
|
||||
String? rr = rarities[widget.grade.value.value.toString()];
|
||||
rr ??= '';
|
||||
|
||||
if (rr.replaceAll(' ', '') == '') {
|
||||
rr = defaultRarities[widget.grade.value.value - 1].i18n;
|
||||
}
|
||||
|
||||
return ScaleTransition(
|
||||
scale: _revealAnimGrade,
|
||||
child: FadeTransition(
|
||||
opacity: _revealAnimGrade,
|
||||
child: SlideTransition(
|
||||
position: _revealAnimGrade.drive(Tween(
|
||||
begin: Offset.zero, end: const Offset(0, -0.6))),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SlideTransition(
|
||||
position: _revealAnimGrade.drive(Tween(
|
||||
begin: Offset.zero,
|
||||
end: const Offset(0, -0.9))),
|
||||
child: Text(
|
||||
rr,
|
||||
style: TextStyle(
|
||||
fontSize: 46.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: gradeColor(
|
||||
context: context,
|
||||
value: widget.grade.value.value),
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: gradeColor(
|
||||
context: context,
|
||||
value: widget.grade.value.value)
|
||||
.withOpacity(0.5),
|
||||
blurRadius: 24.0,
|
||||
),
|
||||
Shadow(
|
||||
color: gradeColor(
|
||||
context: context,
|
||||
value: widget.grade.value.value)
|
||||
.withOpacity(0.3),
|
||||
offset: const Offset(-3, -3),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32.0),
|
||||
ScaleTransition(
|
||||
scale: CurvedAnimation(
|
||||
curve: Curves.easeInOutBack,
|
||||
parent: _revealAnimParticle
|
||||
.drive(Tween(begin: 0.6, end: 1.0))),
|
||||
child: CustomPaint(
|
||||
painter: PimpPainter(
|
||||
particle: Sprinkles(),
|
||||
controller: _revealAnimParticle,
|
||||
seed: seed + 1,
|
||||
shouldPaint: shouldPaint,
|
||||
),
|
||||
child: CustomPaint(
|
||||
painter: PimpPainter(
|
||||
particle: Sprinkles(),
|
||||
controller: _revealAnimParticle,
|
||||
seed: seed,
|
||||
shouldPaint: shouldPaint,
|
||||
),
|
||||
child: RotationTransition(
|
||||
turns: CurvedAnimation(
|
||||
curve: Curves.easeInBack,
|
||||
parent: _revealAnimGrade)
|
||||
.drive(Tween(begin: 0.95, end: 1.0)),
|
||||
child: GradeValueWidget(
|
||||
widget.grade.value,
|
||||
fill: true,
|
||||
contrast: true,
|
||||
shadow: true,
|
||||
outline: true,
|
||||
size: 100.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
child: AnimatedBuilder(
|
||||
animation: _revealAnimGrade,
|
||||
builder: (context, child) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SlideTransition(
|
||||
position: _revealAnimGrade.drive(
|
||||
Tween(begin: Offset.zero, end: const Offset(0, 0.7))),
|
||||
child: AnimatedScale(
|
||||
scale: hold ? 1.1 : 1.0,
|
||||
curve: Curves.easeOutBack,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: GestureDetector(
|
||||
onLongPressDown: (_) => setState(() => hold = true),
|
||||
onLongPressEnd: (_) => reveal(),
|
||||
onLongPressCancel: reveal,
|
||||
child: ScaleTransition(
|
||||
scale: CurvedAnimation(
|
||||
curve: Curves.easeInOut,
|
||||
parent: _revealAnimGrade
|
||||
.drive(Tween(begin: 1.0, end: 0.8))),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: rive.RiveAnimation.asset(
|
||||
"assets/animations/backpack-2.riv",
|
||||
fit: BoxFit.contain,
|
||||
controllers: [_controller],
|
||||
antialiasing: false,
|
||||
),
|
||||
),
|
||||
SlideTransition(
|
||||
position: _revealAnimParticle.drive(Tween(
|
||||
begin: const Offset(0, 0.3),
|
||||
end: const Offset(0, 0.8))),
|
||||
child: FadeTransition(
|
||||
opacity: _revealAnimParticle,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(
|
||||
sigmaX: 32.0, sigmaY: 32.0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 32.0, vertical: 20.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white
|
||||
.withValues(alpha: .3),
|
||||
borderRadius:
|
||||
BorderRadius.circular(24.0),
|
||||
border: Border.all(
|
||||
color: Colors.black
|
||||
.withValues(alpha: .3),
|
||||
width: 1.0),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize:
|
||||
MainAxisSize.min,
|
||||
children: [
|
||||
if (widget.grade
|
||||
.description !=
|
||||
"")
|
||||
Text(
|
||||
widget
|
||||
.grade.description,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 26.0,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow
|
||||
.ellipsis,
|
||||
),
|
||||
Text(
|
||||
widget.grade.subject
|
||||
.renamedTo ??
|
||||
widget.grade.subject
|
||||
.name
|
||||
.capital(),
|
||||
style: TextStyle(
|
||||
color: Colors.white
|
||||
.withValues(
|
||||
alpha: .8),
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 24.0,
|
||||
fontStyle: widget
|
||||
.grade
|
||||
.subject
|
||||
.isRenamed &&
|
||||
settingsProvider
|
||||
.renamedSubjectsItalics
|
||||
? FontStyle.italic
|
||||
: null),
|
||||
maxLines: 2,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
"${widget.grade.value.weight}%",
|
||||
style: TextStyle(
|
||||
color: Colors.white
|
||||
.withValues(
|
||||
alpha: .7),
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20.0),
|
||||
Icon(
|
||||
SubjectIcon.resolveVariant(
|
||||
subject:
|
||||
widget.grade.subject,
|
||||
context: context),
|
||||
color: Colors.white,
|
||||
size: 82.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 42.0),
|
||||
AnimatedOpacity(
|
||||
opacity: subtitle ? 1.0 : 0.0,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: Text(
|
||||
"open_subtitle".i18n,
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .8),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 24.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (_revealAnimGrade.value > 0)
|
||||
AnimatedBuilder(
|
||||
animation: _revealAnimParticle,
|
||||
builder: (context, child) {
|
||||
bool shouldPaint = false;
|
||||
if (_revealAnimParticle.status ==
|
||||
AnimationStatus.forward ||
|
||||
_revealAnimParticle.status ==
|
||||
AnimationStatus.reverse) {
|
||||
shouldPaint = true;
|
||||
}
|
||||
|
||||
String? rr =
|
||||
rarities[widget.grade.value.value.toString()];
|
||||
rr ??= '';
|
||||
|
||||
if (rr.replaceAll(' ', '') == '') {
|
||||
rr = defaultRarities[widget.grade.value.value - 1].i18n;
|
||||
}
|
||||
|
||||
return ScaleTransition(
|
||||
scale: _revealAnimGrade,
|
||||
child: FadeTransition(
|
||||
opacity: _revealAnimGrade,
|
||||
child: SlideTransition(
|
||||
position: _revealAnimGrade.drive(Tween(
|
||||
begin: Offset.zero,
|
||||
end: const Offset(0, -0.6))),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SlideTransition(
|
||||
position: _revealAnimGrade.drive(Tween(
|
||||
begin: Offset.zero,
|
||||
end: const Offset(0, -0.9))),
|
||||
child: Text(
|
||||
rr,
|
||||
style: TextStyle(
|
||||
fontSize: 46.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: gradeColor(
|
||||
context: context,
|
||||
value: widget.grade.value.value),
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: gradeColor(
|
||||
context: context,
|
||||
value:
|
||||
widget.grade.value.value)
|
||||
.withValues(alpha: .5),
|
||||
blurRadius: 24.0,
|
||||
),
|
||||
Shadow(
|
||||
color: gradeColor(
|
||||
context: context,
|
||||
value:
|
||||
widget.grade.value.value)
|
||||
.withValues(alpha: .3),
|
||||
offset: const Offset(-3, -3),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32.0),
|
||||
ScaleTransition(
|
||||
scale: CurvedAnimation(
|
||||
curve: Curves.easeInOutBack,
|
||||
parent: _revealAnimParticle
|
||||
.drive(Tween(begin: 0.6, end: 1.0))),
|
||||
child: CustomPaint(
|
||||
painter: PimpPainter(
|
||||
particle: Sprinkles(),
|
||||
controller: _revealAnimParticle,
|
||||
seed: seed + 1,
|
||||
shouldPaint: shouldPaint,
|
||||
),
|
||||
child: CustomPaint(
|
||||
painter: PimpPainter(
|
||||
particle: Sprinkles(),
|
||||
controller: _revealAnimParticle,
|
||||
seed: seed,
|
||||
shouldPaint: shouldPaint,
|
||||
),
|
||||
child: RotationTransition(
|
||||
turns: CurvedAnimation(
|
||||
curve: Curves.easeInBack,
|
||||
parent: _revealAnimGrade)
|
||||
.drive(
|
||||
Tween(begin: 0.95, end: 1.0)),
|
||||
child: GradeValueWidget(
|
||||
widget.grade.value,
|
||||
fill: true,
|
||||
contrast: true,
|
||||
shadow: true,
|
||||
outline: true,
|
||||
size: 100.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PimpPainter extends CustomPainter {
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import 'package:refilc/helpers/subject.dart';
|
||||
import 'package:refilc/theme/colors/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubjectIconGallery extends StatelessWidget {
|
||||
const SubjectIconGallery({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
leading: BackButton(color: AppColors.of(context).text),
|
||||
title: Text(
|
||||
"Subject Icon Gallery",
|
||||
style: TextStyle(color: AppColors.of(context).text),
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
children: const [
|
||||
SubjectIconItem("Matematika"),
|
||||
SubjectIconItem("Magyar Nyelv"),
|
||||
SubjectIconItem("Nyelvtan"),
|
||||
SubjectIconItem("Irodalom"),
|
||||
SubjectIconItem("Történelem"),
|
||||
SubjectIconItem("Földrajz"),
|
||||
SubjectIconItem("Rajz"),
|
||||
SubjectIconItem("Vizuális kultúra"),
|
||||
SubjectIconItem("Fizika"),
|
||||
SubjectIconItem("Ének"),
|
||||
SubjectIconItem("Testnevelés"),
|
||||
SubjectIconItem("Edzéselmélet"),
|
||||
SubjectIconItem("Kémia"),
|
||||
SubjectIconItem("Biológia"),
|
||||
SubjectIconItem("Természetismeret"),
|
||||
SubjectIconItem("Erkölcstan"),
|
||||
SubjectIconItem("Pénzügy"),
|
||||
SubjectIconItem("Informatika"),
|
||||
SubjectIconItem("Digitális kultúra"),
|
||||
SubjectIconItem("Programozás"),
|
||||
SubjectIconItem("Hálózat"),
|
||||
SubjectIconItem("Színház technika"),
|
||||
SubjectIconItem("Média"),
|
||||
SubjectIconItem("Elektronika"),
|
||||
SubjectIconItem("Gépészet"),
|
||||
SubjectIconItem("Technika"),
|
||||
SubjectIconItem("Tánc"),
|
||||
SubjectIconItem("Filozófia"),
|
||||
SubjectIconItem("Osztályfőnöki"),
|
||||
SubjectIconItem("Közösségi nevelés"),
|
||||
SubjectIconItem("Gazdaság"),
|
||||
SubjectIconItem("Szorgalom"),
|
||||
SubjectIconItem("Magatartás"),
|
||||
SubjectIconItem("Angol nyelv"),
|
||||
SubjectIconItem("Linux"),
|
||||
SubjectIconItem("Adatbázis"),
|
||||
SubjectIconItem("Asztali alkalmazások"),
|
||||
SubjectIconItem("Projekt"),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SubjectIconItem extends StatelessWidget {
|
||||
const SubjectIconItem(this.name, {super.key});
|
||||
|
||||
final String name;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
SubjectIcon.resolveVariant(subjectName: name, context: context),
|
||||
color: AppColors.of(context).text,
|
||||
),
|
||||
title: Text(
|
||||
name,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,6 @@ import 'package:provider/provider.dart';
|
||||
import 'package:shake_flutter/enums/shake_screen.dart';
|
||||
import 'package:shake_flutter/shake_flutter.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'debug/subject_icon_gallery.dart';
|
||||
import 'settings_screen.i18n.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:refilc_mobile_ui/screens/settings/user/nickname.dart';
|
||||
@@ -779,33 +778,6 @@ class SettingsScreenState extends State<SettingsScreen>
|
||||
),
|
||||
),
|
||||
|
||||
// // icon gallery (debug mode)
|
||||
if (kDebugMode)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 16.0, left: 24.0, right: 24.0),
|
||||
child: Panel(
|
||||
title: const Text("Debug"),
|
||||
child: Column(
|
||||
children: [
|
||||
PanelButton(
|
||||
title: const Text("Subject Icon Gallery"),
|
||||
leading:
|
||||
const Icon(CupertinoIcons.rectangle_3_offgrid_fill),
|
||||
trailing: const Icon(Icons.arrow_forward),
|
||||
onPressed: () {
|
||||
Navigator.of(context, rootNavigator: true).push(
|
||||
CupertinoPageRoute(
|
||||
builder: (context) =>
|
||||
const SubjectIconGallery()),
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// other secion
|
||||
SplittedPanel(
|
||||
title: Text("other".i18n),
|
||||
|
||||
@@ -127,10 +127,6 @@ extension SettingsLocalization on String {
|
||||
"feedback": "Feedback",
|
||||
"other": "Other",
|
||||
"stickermap": "Sticker Map",
|
||||
"qr_scanner": "QR Scanner",
|
||||
"camera_perm_error":
|
||||
"Camera permission is required to scan QR codes.",
|
||||
"invalid_qr_code": "Invalid QR code!",
|
||||
"success": "Success!",
|
||||
"versiontext": "v%s, modified by the Firka team",
|
||||
"packagetext": "reFilc, modified by the Firka team",
|
||||
@@ -259,10 +255,6 @@ extension SettingsLocalization on String {
|
||||
"feedback": "Visszajelzés",
|
||||
"other": "Egyéb",
|
||||
"stickermap": "Matrica térkép",
|
||||
"qr_scanner": "QR Kódolvasó",
|
||||
"camera_perm_error":
|
||||
"A kamera engedély szükséges a QR kódok beolvasásához.",
|
||||
"invalid_qr_code": "Érvénytelen QR kód!",
|
||||
"success": "Siker!",
|
||||
"versiontext": "v%s, módosítva a Firka csapat által",
|
||||
"packagetext": "reFilc, módosítva a Firka csapat által",
|
||||
@@ -391,10 +383,6 @@ extension SettingsLocalization on String {
|
||||
"feedback": "Feedback",
|
||||
"other": "Sonstiges",
|
||||
"stickermap": "Sticker Map",
|
||||
"qr_scanner": "QR-Scanner",
|
||||
"camera_perm_error":
|
||||
"Kameraberechtigung ist erforderlich, um QR-Codes zu scannen.",
|
||||
"invalid_qr_code": "Ungültiger QR-Code!",
|
||||
"success": "Erfolg!",
|
||||
"versiontext": "v%s, geändert vom Firka",
|
||||
"packagetext": "reFilc, geändert vom Firka",
|
||||
|
||||
@@ -33,8 +33,6 @@ dependencies:
|
||||
confetti: ^0.8.0
|
||||
# live_activities: ^1.9.1+1
|
||||
animated_flip_counter: ^0.3.4
|
||||
lottie: ^3.3.1
|
||||
rive: ^0.12.4
|
||||
animated_background: ^2.0.0
|
||||
home_widget: ^0.7.0+1
|
||||
dropdown_button2: ^2.3.9
|
||||
@@ -68,7 +66,6 @@ dependencies:
|
||||
webview_flutter: ^4.10.0
|
||||
file_picker: ^8.3.7
|
||||
shake_flutter: ^17.1.0
|
||||
qr_code_scanner_plus: ^2.0.10+1
|
||||
wakelock_plus: ^1.2.10
|
||||
|
||||
dependency_overrides:
|
||||
|
||||
Reference in New Issue
Block a user