新增:应用图标,更改应用名称

This commit is contained in:
ivan 2026-03-10 15:32:39 +08:00
parent f3a163c958
commit 35fb50040a
54 changed files with 5850 additions and 515 deletions

1
.gitignore vendored
View File

@ -29,6 +29,7 @@ migrate_working_dir/
pubspec.lock
# Android
**/android/key.properties
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/

View File

@ -1,4 +1,4 @@
# MagiEvery AI - Flutter 应用
# PetsHero - Flutter 应用
基于 `design/MagiEveryAI-AB` 设计图实现的 AI 图像/视频生成应用。

View File

@ -12,6 +12,12 @@ if (localPropertiesFile.exists()) {
}
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
@ -48,13 +54,22 @@ android {
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
debug {
// HTTP
manifestPlaceholders = [usesCleartextTraffic: "true"]
}
release {
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
manifestPlaceholders = [usesCleartextTraffic: "false"]
}
}
@ -63,6 +78,7 @@ android {
dependencies {
implementation 'com.google.android.gms:play-services-ads-identifier:18.1.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'androidx.appcompat:appcompat:1.7.0'
}
flutter {

View File

@ -4,9 +4,9 @@
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<application
android:usesCleartextTraffic="${usesCleartextTraffic}"
android:label="AI创作"
android:label="PetsHero"
android:name="${applicationName}"
android:icon="@android:drawable/ic_menu_gallery">
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,140 @@
{
"images" : [
{
"filename" : "Icon-App-20x20@1x.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "Icon-App-20x20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-App-20x20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "Icon-App-29x29@1x.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "Icon-App-29x29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-App-29x29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "Icon-App-40x40@1x.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "Icon-App-40x40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-App-40x40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "Icon-App-60x60@1x.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "60x60"
},
{
"filename" : "Icon-App-60x60@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "Icon-App-60x60@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "Icon-App-20x20@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "Icon-App-20x20@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-App-29x29@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "Icon-App-29x29@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-App-40x40@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "Icon-App-40x40@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-App-76x76@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "Icon-App-76x76@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "Icon-App-83.5x83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "Icon-App-1024x1024@1x.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>MagiEvery AI</string>
<string>PetsHero</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photos to use as reference for AI image generation.</string>
<key>NSPhotoLibraryAddUsageDescription</key>

View File

@ -5,8 +5,8 @@ abstract final class ApiConfig {
/// AES
static const String aesKey = 'liyP4LkMfP68XvCt';
/// ID
static const String appId = 'com.petsheroai.app';
/// (sentinel)
static const String appId = 'HAndroid';
///
static const String packageName = 'com.petsheroai.app';

View File

@ -1,13 +1,14 @@
import '../api_client.dart';
import '../api_config.dart';
import '../proxy_client.dart';
/// API
abstract final class PaymentApi {
static final _client = ApiClient.instance.proxy;
/// Google
/// Google Android
static Future<ApiResponse> getGooglePayActivities({
required String sentinel,
String? sentinel,
String? shield,
String? vambrace,
String? portal,
@ -16,17 +17,17 @@ abstract final class PaymentApi {
path: '/v1/payment/getGooglePayActivities',
method: 'GET',
queryParams: {
'sentinel': sentinel,
'sentinel': sentinel ?? ApiConfig.appId,
'portal': portal ?? ApiConfig.packageName,
if (shield != null) 'shield': shield,
if (vambrace != null) 'vambrace': vambrace,
if (portal != null) 'portal': portal,
},
);
}
/// Apple
/// Apple iOS
static Future<ApiResponse> getApplePayActivities({
required String sentinel,
String? sentinel,
String? shield,
String? vambrace,
String? portal,
@ -35,10 +36,10 @@ abstract final class PaymentApi {
path: '/v1/payment/getApplePayActivities',
method: 'GET',
queryParams: {
'sentinel': sentinel,
'sentinel': sentinel ?? 'HAndroid',
'portal': portal ?? ApiConfig.packageName,
if (shield != null) 'shield': shield,
if (vambrace != null) 'vambrace': vambrace,
if (portal != null) 'portal': portal,
},
);
}

View File

@ -126,6 +126,10 @@ class AuthService {
if (name != null && name.isNotEmpty) {
UserState.setUserName(name);
}
final countryCode = data?['navigate'] as String?;
if (countryCode != null) {
UserState.setNavigate(countryCode);
}
} else {
_log('init: 登录失败');
}

View File

@ -8,6 +8,8 @@ class UserState {
static final ValueNotifier<String?> userId = ValueNotifier<String?>(null);
static final ValueNotifier<String?> avatar = ValueNotifier<String?>(null);
static final ValueNotifier<String?> userName = ValueNotifier<String?>(null);
/// (navigate / countryCode)
static final ValueNotifier<String?> navigate = ValueNotifier<String?>(null);
static void setCredits(int? value) {
credits.value = value;
@ -25,6 +27,10 @@ class UserState {
userName.value = value;
}
static void setNavigate(String? value) {
navigate.value = value;
}
static String formatCredits(int? value) {
if (value == null) return '--';
return value.toString().replaceAllMapped(

View File

@ -0,0 +1,69 @@
/// /V2 - getGooglePayActivities / getApplePayActivities
class ActivityItem {
const ActivityItem({
required this.code,
required this.title,
required this.credits,
required this.actualAmount,
this.originAmount,
this.discountOff,
this.bonus = 0,
this.activityId,
this.currency,
});
final String code; // helm
final String title; // glossary
final int credits; // greaves
final String actualAmount; // guardian
final String? originAmount; // curriculum
final String? discountOff; // lead
final int bonus; // forge
final String? activityId; // warrior ID
final String? currency; // familiar
factory ActivityItem.fromJson(Map<String, dynamic> json) {
return ActivityItem(
code: json['helm']?.toString() ?? '',
title: json['glossary']?.toString() ?? '',
credits: (json['greaves'] as num?)?.toInt() ?? 0,
actualAmount: json['guardian']?.toString() ?? '',
originAmount: json['curriculum']?.toString(),
discountOff: json['lead']?.toString(),
bonus: (json['forge'] as num?)?.toInt() ?? 0,
activityId: json['warrior']?.toString(),
currency: json['familiar']?.toString(),
);
}
/// "100 Credits"
String get creditsDisplay =>
credits > 0 ? '${credits.toString().replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (m) => '${m[1]},')} Credits' : title;
/// "¥6" "¥25 Save ¥5"
String get priceDisplay {
if (actualAmount.isEmpty) return '';
if (discountOff != null && discountOff!.isNotEmpty) {
return '$actualAmount $discountOff';
}
if (originAmount != null &&
originAmount!.isNotEmpty &&
originAmount != actualAmount) {
final diff = _diffAmount(originAmount!, actualAmount);
return diff.isNotEmpty ? '$actualAmount Save $diff' : actualAmount;
}
return actualAmount;
}
String _diffAmount(String origin, String actual) {
try {
final o = double.tryParse(origin.replaceAll(RegExp(r'[^\d.]'), '')) ?? 0;
final a = double.tryParse(actual.replaceAll(RegExp(r'[^\d.]'), '')) ?? 0;
final d = (o - a).toStringAsFixed(0);
final currencySymbol = RegExp(r'^[^\d]+').stringMatch(actual) ?? '';
return '$currencySymbol$d';
} catch (_) {
return '';
}
}
}

View File

@ -1,16 +1,88 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_lucide/flutter_lucide.dart';
import '../../core/api/services/payment_api.dart';
import '../../core/auth/auth_service.dart';
import '../../core/theme/app_colors.dart';
import '../../core/user/user_state.dart';
import '../../core/theme/app_spacing.dart';
import '../../core/theme/app_typography.dart';
import '../../shared/widgets/top_nav_bar.dart';
import 'models/activity_item.dart';
/// Recharge screen - matches Pencil tPjdN
class RechargeScreen extends StatelessWidget {
/// Tier cards (DC6NS, YRaOG, QlNz6) getGooglePayActivities / getApplePayActivities
class RechargeScreen extends StatefulWidget {
const RechargeScreen({super.key});
@override
State<RechargeScreen> createState() => _RechargeScreenState();
}
class _RechargeScreenState extends State<RechargeScreen> {
List<ActivityItem> _activities = [];
bool _loadingTiers = true;
String? _tierError;
@override
void initState() {
super.initState();
_fetchActivities();
}
Future<void> _fetchActivities() async {
setState(() {
_loadingTiers = true;
_tierError = null;
});
try {
await AuthService.loginComplete;
final country = UserState.navigate.value ?? '';
final res = defaultTargetPlatform == TargetPlatform.iOS
? await PaymentApi.getApplePayActivities(
vambrace: country.isEmpty ? null : country,
)
: await PaymentApi.getGooglePayActivities(
vambrace: country.isEmpty ? null : country,
);
if (!mounted) return;
if (res.isSuccess && res.data != null) {
final data = res.data as Map<String, dynamic>?;
final summon = data?['summon'] as List<dynamic>? ?? [];
final list = summon
.whereType<Map<String, dynamic>>()
.map((e) => ActivityItem.fromJson(e))
.where((e) => e.code.isNotEmpty)
.toList();
setState(() {
_activities = list;
_loadingTiers = false;
});
} else {
setState(() {
_activities = [];
_loadingTiers = false;
_tierError = res.msg.isNotEmpty ? res.msg : 'Failed to load';
});
}
} catch (e) {
if (mounted) {
setState(() {
_activities = [];
_loadingTiers = false;
_tierError = e.toString();
});
}
}
}
void _onBuy(ActivityItem item) {
// TODO:
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -46,23 +118,70 @@ class RechargeScreen extends StatelessWidget {
),
),
),
_TierCard(
credits: '100 Credits',
price: '¥6',
onBuy: () {},
),
const SizedBox(height: AppSpacing.xl),
_TierCardRecommended(
credits: '500 Credits',
price: '¥25 Save ¥5',
onBuy: () {},
),
const SizedBox(height: AppSpacing.xl),
_TierCardPopular(
credits: '1,000 Credits',
price: '¥45 Save ¥15',
onBuy: () {},
),
if (_loadingTiers)
const Padding(
padding: EdgeInsets.all(AppSpacing.xxl),
child: Center(
child: SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(strokeWidth: 2),
),
),
)
else if (_tierError != null)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.screenPadding),
child: Column(
children: [
Text(
_tierError!,
style: AppTypography.bodyRegular.copyWith(
color: AppColors.textSecondary,
),
),
const SizedBox(height: AppSpacing.md),
TextButton(
onPressed: _fetchActivities,
child: const Text('Retry'),
),
],
),
)
else if (_activities.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.screenPadding),
child: Text(
'No packages available',
style: AppTypography.bodyRegular.copyWith(
color: AppColors.textSecondary,
),
),
)
else
...List.generate(_activities.length, (i) {
final item = _activities[i];
final isRecommended = i == 1;
final isPopular = i == 2;
return Padding(
padding: EdgeInsets.only(
bottom: i < _activities.length - 1
? AppSpacing.xl
: 0,
),
child: _TierCardFromActivity(
item: item,
badge: isRecommended
? _TierBadge.recommended
: isPopular
? _TierBadge.popular
: _TierBadge.none,
onBuy: () => _onBuy(item),
),
);
}),
],
),
),
@ -70,6 +189,108 @@ class RechargeScreen extends StatelessWidget {
}
}
enum _TierBadge { none, recommended, popular }
class _TierCardFromActivity extends StatelessWidget {
const _TierCardFromActivity({
required this.item,
required this.badge,
required this.onBuy,
});
final ActivityItem item;
final _TierBadge badge;
final VoidCallback onBuy;
@override
Widget build(BuildContext context) {
final content = Container(
margin: const EdgeInsets.symmetric(horizontal: AppSpacing.screenPadding),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.xxl,
vertical: AppSpacing.xl,
),
decoration: BoxDecoration(
color: AppColors.surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: AppColors.border),
boxShadow: [
BoxShadow(
color: AppColors.shadowLight,
blurRadius: 6,
offset: const Offset(0, 2),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.creditsDisplay,
style: AppTypography.bodyLarge.copyWith(
color: AppColors.textPrimary,
),
),
SizedBox(height: badge == _TierBadge.none ? AppSpacing.xs : AppSpacing.sm),
Text(
item.priceDisplay,
style: AppTypography.bodyRegular.copyWith(
color: AppColors.textSecondary,
),
),
],
),
_BuyButton(onTap: onBuy),
],
),
);
if (badge == _TierBadge.none) {
return content;
}
return Stack(
clipBehavior: Clip.none,
children: [
content,
Positioned(
top: 0,
right: AppSpacing.screenPadding,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.md,
vertical: AppSpacing.xs,
),
decoration: BoxDecoration(
color: badge == _TierBadge.recommended
? AppColors.primaryLight
: AppColors.accentOrangeLight,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(16),
bottomLeft: Radius.circular(16),
),
),
child: Text(
badge == _TierBadge.recommended
? 'Recommended'
: 'Most Popular',
style: AppTypography.label.copyWith(
color: badge == _TierBadge.recommended
? AppColors.primary
: AppColors.accentOrange,
fontWeight: FontWeight.w600,
),
),
),
),
],
);
}
}
class _CreditsSection extends StatelessWidget {
const _CreditsSection({required this.currentCredits});
@ -122,243 +343,6 @@ class _CreditsSection extends StatelessWidget {
}
}
class _TierCard extends StatelessWidget {
const _TierCard({
required this.credits,
required this.price,
required this.onBuy,
});
final String credits;
final String price;
final VoidCallback onBuy;
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: AppSpacing.screenPadding),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.xxl,
vertical: AppSpacing.xl,
),
decoration: BoxDecoration(
color: AppColors.surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: AppColors.border),
boxShadow: [
BoxShadow(
color: AppColors.shadowLight,
blurRadius: 6,
offset: const Offset(0, 2),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
credits,
style: AppTypography.bodyLarge.copyWith(
color: AppColors.textPrimary,
),
),
const SizedBox(height: AppSpacing.xs),
Text(
price,
style: AppTypography.bodyRegular.copyWith(
color: AppColors.textSecondary,
),
),
],
),
_BuyButton(onTap: onBuy),
],
),
);
}
}
class _TierCardRecommended extends StatelessWidget {
const _TierCardRecommended({
required this.credits,
required this.price,
required this.onBuy,
});
final String credits;
final String price;
final VoidCallback onBuy;
@override
Widget build(BuildContext context) {
return Stack(
clipBehavior: Clip.none,
children: [
Container(
margin:
const EdgeInsets.symmetric(horizontal: AppSpacing.screenPadding),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.xxl,
vertical: AppSpacing.xl,
),
decoration: BoxDecoration(
color: AppColors.surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: AppColors.border),
boxShadow: [
BoxShadow(
color: AppColors.shadowLight,
blurRadius: 6,
offset: const Offset(0, 2),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
credits,
style: AppTypography.bodyLarge.copyWith(
color: AppColors.textPrimary,
),
),
const SizedBox(height: AppSpacing.sm),
Text(
price,
style: AppTypography.bodyRegular.copyWith(
color: AppColors.textSecondary,
),
),
],
),
_BuyButton(onTap: onBuy),
],
),
),
Positioned(
top: 0,
right: AppSpacing.screenPadding,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.md,
vertical: AppSpacing.xs,
),
decoration: BoxDecoration(
color: AppColors.primaryLight,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(16),
bottomLeft: Radius.circular(16),
),
),
child: Text(
'Recommended',
style: AppTypography.label.copyWith(
color: AppColors.primary,
fontWeight: FontWeight.w600,
),
),
),
),
],
);
}
}
class _TierCardPopular extends StatelessWidget {
const _TierCardPopular({
required this.credits,
required this.price,
required this.onBuy,
});
final String credits;
final String price;
final VoidCallback onBuy;
@override
Widget build(BuildContext context) {
return Stack(
clipBehavior: Clip.none,
children: [
Container(
margin:
const EdgeInsets.symmetric(horizontal: AppSpacing.screenPadding),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.xxl,
vertical: AppSpacing.xl,
),
decoration: BoxDecoration(
color: AppColors.surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: AppColors.border),
boxShadow: [
BoxShadow(
color: AppColors.shadowLight,
blurRadius: 6,
offset: const Offset(0, 2),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
credits,
style: AppTypography.bodyLarge.copyWith(
color: AppColors.textPrimary,
),
),
const SizedBox(height: AppSpacing.sm),
Text(
price,
style: AppTypography.bodyRegular.copyWith(
color: AppColors.textSecondary,
),
),
],
),
_BuyButton(onTap: onBuy),
],
),
),
Positioned(
top: 0,
right: AppSpacing.screenPadding,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.md,
vertical: AppSpacing.xs,
),
decoration: BoxDecoration(
color: AppColors.accentOrangeLight,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(16),
bottomLeft: Radius.circular(16),
),
),
child: Text(
'Most Popular',
style: AppTypography.label.copyWith(
color: AppColors.accentOrange,
fontWeight: FontWeight.w600,
),
),
),
),
],
);
}
}
class _BuyButton extends StatelessWidget {
const _BuyButton({required this.onTap});

View File

@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
adjust_sdk: ^5.5.0
adjust_sdk: ^5.5.1
cupertino_icons: ^1.0.6
play_install_referrer: ^0.5.0
flutter_lucide: ^1.8.2
@ -30,6 +30,13 @@ dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.0
flutter_launcher_icons: ^0.14.4
flutter_launcher_icons:
android: true
ios: true
image_path: "design/images/generated-1773069485332.png"
remove_alpha_ios: true
flutter:
uses-material-design: true