fixed weird plus things and it's working really well :3

This commit is contained in:
Kima
2024-04-09 21:59:54 +02:00
parent a51d65f7cc
commit abc595357f
3 changed files with 58 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
// ignore_for_file: use_build_context_synchronously
import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc_mobile_ui/plus/plus_screen.i18n.dart';
import 'package:refilc_mobile_ui/plus/components/plan_card.dart';
@@ -308,6 +310,58 @@ class PlusScreenState extends State<PlusScreen> {
title: Text('show_lifetime'.i18n),
),
),
// reactivate plus
const SizedBox(
height: 18.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0),
border: Border.all(
color: AppColors.of(context).text.withOpacity(0.2),
),
),
child: ListTile(
contentPadding:
const EdgeInsets.only(left: 15.0, right: 10.0),
onTap: () async {
final result = await context
.read<PlusProvider>()
.auth
.refreshAuth(reactivate: true);
if (mounted) {
if (result) {
ScaffoldMessenger.of(context)
.showSnackBar(const SnackBar(
content: Text(
"Sikeres aktiválás!",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold),
),
backgroundColor: Colors.green,
));
Future.delayed(const Duration(seconds: 2),
() => Navigator.of(context).pop());
} else {
ScaffoldMessenger.of(context)
.showSnackBar(const SnackBar(
content: Text(
"Sikertelen aktiválás. Kérlek próbáld újra később!",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold),
),
backgroundColor: Colors.red,
));
}
}
},
title: Text('reactivate'.i18n),
),
),
// faq section
const SizedBox(
height: 30.0,