fluffychat/lib/pangea/widgets/chat/message_unsubscribed_card.dart
ggurdin 9ecf4e3bd2
fix: fix dart formatting for CI (#1368)
* fix: fix dart formatting for CI

* fix: sorted imports, updated deprecated flutter functions

* fix: format files

* fix: format files

* feat: replace syncfusion flutter package with excel flutter package

* fix: don't run enable google services patch in CI

* fix: update iOS supported platforms for enable ios build script

* fix: commented out linux build in integrate CI
2025-01-07 08:32:42 -05:00

72 lines
2.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pangea/utils/bot_style.dart';
import 'package:fluffychat/pangea/widgets/chat/message_selection_overlay.dart';
import 'package:fluffychat/widgets/matrix.dart';
class MessageUnsubscribedCard extends StatelessWidget {
final MessageOverlayController controller;
const MessageUnsubscribedCard({
super.key,
required this.controller,
});
@override
Widget build(BuildContext context) {
final bool inTrialWindow =
MatrixState.pangeaController.userController.inTrialWindow();
return Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
Text(
style: BotStyle.text(context),
L10n.of(context).subscribedToUnlockTools,
textAlign: TextAlign.center,
),
if (inTrialWindow) ...[
const SizedBox(height: 10),
SizedBox(
width: double.infinity,
child: TextButton(
onPressed: () {
MatrixState.pangeaController.subscriptionController
.activateNewUserTrial();
controller.updateToolbarMode(controller.toolbarMode);
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all<Color>(
(AppConfig.primaryColor).withAlpha(25),
),
),
child: Text(L10n.of(context).activateTrial),
),
),
],
const SizedBox(height: 10),
SizedBox(
width: double.infinity,
child: TextButton(
onPressed: () {
controller.widget.chatController.clearSelectedEvents();
MatrixState.pangeaController.subscriptionController
.showPaywall(context);
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all<Color>(
(AppConfig.primaryColor).withAlpha(25),
),
),
child: Text(L10n.of(context).getAccess),
),
),
],
),
);
}
}