Minor fixes

This commit is contained in:
vishnukvmd 2023-03-15 18:15:10 +05:30
parent 099be22598
commit e7a2c671e1
6 changed files with 53 additions and 11 deletions

View file

@ -55,8 +55,8 @@
"incorrectPassword": "Incorrect password",
"welcomeBackTitle": "Welcome back!",
"madeWithLoveAtPrefix": "made with ❤️ at ",
"supportDevs" : "You can subscribe to ente Photos to support this project.",
"supportDiscount" : "Use coupon code \"AUTH\" to get 10% off in the first year.",
"supportDevs" : "Subscribe to <bold-green>ente Photos</bold-green> to support this project.",
"supportDiscount" : "Use coupon code \"AUTH\" to get 10% off first year",
"changeEmail": "change email",
"ok": "OK",
"cancel": "Cancel",

View file

@ -28,6 +28,7 @@ class EnteColorScheme {
final Color strokeFaint;
// Fixed Colors
final Color primaryGreen;
final Color primary700;
final Color primary500;
final Color primary400;
@ -53,6 +54,7 @@ class EnteColorScheme {
this.strokeBase,
this.strokeMuted,
this.strokeFaint, {
this.primaryGreen = _primaryGreen,
this.primary700 = _primary700,
this.primary500 = _primary500,
this.primary400 = _primary400,
@ -143,6 +145,8 @@ const Color strokeFaintDark = Color.fromRGBO(255, 255, 255, 0.16);
// Fixed Colors
const Color _primaryGreen = Color.fromRGBO(29, 185, 84, 1);
const Color _primary700 = Color.fromARGB(255, 164, 0, 182);
const Color _primary500 = Color.fromARGB(255, 204, 10, 101);
const Color _primary400 = Color.fromARGB(255, 122, 41, 193);

View file

@ -2,8 +2,11 @@ import 'dart:io';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/subscription.dart';
// ignore: import_of_legacy_library_into_null_safe
import 'package:ente_auth/services/billing_service.dart';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:flutter/material.dart';
import 'package:styled_text/styled_text.dart';
import 'package:url_launcher/url_launcher.dart';
class SupportDevWidget extends StatelessWidget {
@ -21,18 +24,38 @@ class SupportDevWidget extends StatelessWidget {
builder: (context, snapshot) {
if (snapshot.hasData) {
final subscription = snapshot.data;
if (subscription != null && subscription.productID == "free") {
if (subscription != null && subscription.productID != "free") {
return GestureDetector(
onTap: () {
launchUrl(Uri.parse("https://ente.io/download"));
launchUrl(Uri.parse("https://ente.io"));
},
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 6),
child: Text(
"${l10n.supportDevs}${Platform.isAndroid ? "\n\n${l10n.supportDiscount}" : ""}",
textAlign: TextAlign.center,
style: DefaultTextStyle.of(context).style,
child: Column(
children: [
StyledText(
text: l10n.supportDevs,
tags: {
'bold-green': StyledTextTag(
style: TextStyle(
fontWeight: FontWeight.bold,
color: getEnteColorScheme(context).primaryGreen,
),
),
},
),
const Padding(padding: EdgeInsets.all(6)),
Platform.isAndroid
? Text(
l10n.supportDiscount,
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.grey,
),
)
: const SizedBox.shrink(),
],
),
),
);

View file

@ -9,7 +9,6 @@ import 'package:ente_auth/ui/settings/account_section_widget.dart';
import 'package:ente_auth/ui/settings/app_version_widget.dart';
import 'package:ente_auth/ui/settings/danger_section_widget.dart';
import 'package:ente_auth/ui/settings/data_section_widget.dart';
import 'package:ente_auth/ui/settings/made_with_love_widget.dart';
import 'package:ente_auth/ui/settings/security_section_widget.dart';
import 'package:ente_auth/ui/settings/social_section_widget.dart';
import 'package:ente_auth/ui/settings/support_dev_widget.dart';
@ -85,7 +84,6 @@ class SettingsPage extends StatelessWidget {
sectionSpacing,
const DangerSectionWidget(),
const AppVersionWidget(),
const MadeWithLoveWidget(),
const SupportDevWidget(),
const Padding(
padding: EdgeInsets.only(bottom: 60),

View file

@ -1307,6 +1307,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
styled_text:
dependency: "direct main"
description:
name: styled_text
sha256: f72928d1ebe8cb149e3b34a689cb1ddca696b808187cf40ac3a0bd183dff379c
url: "https://pub.dev"
source: hosted
version: "7.0.0"
synchronized:
dependency: transitive
description:
@ -1515,6 +1523,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.0"
xmlstream:
dependency: transitive
description:
name: xmlstream
sha256: "2d10c69a9d5fc46f71798b80ee6db15bc0d5bf560fdbdd264776cbeee0c83631"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
yaml:
dependency: transitive
description:
@ -1525,4 +1541,4 @@ packages:
version: "3.1.1"
sdks:
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
flutter: ">=3.7.0"

View file

@ -62,6 +62,7 @@ dependencies:
shared_preferences: ^2.0.5
sqflite: ^2.1.0
step_progress_indicator: ^1.0.2
styled_text: ^7.0.0
url_launcher: ^6.1.5
uuid: ^3.0.4