111
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
@@ -25,34 +25,32 @@ void main() async {
|
||||
// 确保 Flutter 绑定初始化
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// 全局错误处理
|
||||
// 全局错误处理 - Flutter 框架错误
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
FlutterError.presentError(details);
|
||||
debugPrint('Flutter Error: ${details.exception}');
|
||||
debugPrint('Stack trace: ${details.stack}');
|
||||
};
|
||||
|
||||
// 捕获异步错误
|
||||
runZonedGuarded<Future<void>>(
|
||||
() async {
|
||||
Provider.debugCheckInvalidValueType = null;
|
||||
// 全局错误处理 - 异步未捕获错误
|
||||
PlatformDispatcher.instance.onError = (error, stack) {
|
||||
debugPrint('Uncaught error: $error');
|
||||
debugPrint('Stack: $stack');
|
||||
return true;
|
||||
};
|
||||
|
||||
try {
|
||||
await SharedPreferences.getInstance();
|
||||
await LocalStorage.init();
|
||||
debugPrint('App initialized successfully');
|
||||
} catch (e, stack) {
|
||||
debugPrint('Initialization error: $e');
|
||||
debugPrint('Stack: $stack');
|
||||
}
|
||||
Provider.debugCheckInvalidValueType = null;
|
||||
|
||||
runApp(const MyApp());
|
||||
},
|
||||
(error, stack) {
|
||||
debugPrint('Uncaught error: $error');
|
||||
debugPrint('Stack: $stack');
|
||||
},
|
||||
);
|
||||
try {
|
||||
await SharedPreferences.getInstance();
|
||||
await LocalStorage.init();
|
||||
debugPrint('App initialized successfully');
|
||||
} catch (e, stack) {
|
||||
debugPrint('Initialization error: $e');
|
||||
debugPrint('Stack: $stack');
|
||||
}
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
||||
@@ -211,19 +211,6 @@ class _ActionButtons extends StatelessWidget {
|
||||
onTap: () => _showTransferDialog(context),
|
||||
),
|
||||
),
|
||||
SizedBox(width: AppSpacing.sm),
|
||||
Expanded(
|
||||
child: _ActionButton(
|
||||
icon: LucideIcons.coins,
|
||||
label: '赚币',
|
||||
onTap: () {
|
||||
// TODO: 赚币功能
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('赚币功能开发中')),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -290,7 +277,7 @@ class _AssetComposition extends StatelessWidget {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final fund = provider.fundAccount;
|
||||
final overview = provider.overview;
|
||||
|
||||
|
||||
final fundBalance = fund?.balance ?? overview?.fundBalance ?? '0.00';
|
||||
final tradeBalance = overview?.tradeBalance ?? '0';
|
||||
|
||||
@@ -325,19 +312,6 @@ class _AssetComposition extends StatelessWidget {
|
||||
onTap: () {},
|
||||
),
|
||||
),
|
||||
SizedBox(width: AppSpacing.sm),
|
||||
Expanded(
|
||||
child: _AssetCard(
|
||||
icon: LucideIcons.coins,
|
||||
title: '赚币',
|
||||
amount: '0 USDT',
|
||||
onTap: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('赚币功能开发中')),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user