Update: 2026-08-08 12:58:16
This commit is contained in:
@@ -26,14 +26,29 @@ import 'widgets/financial_summary_card.dart';
|
||||
import 'widgets/promo_gamification_card.dart';
|
||||
import 'widgets/transaction_preview_item.dart';
|
||||
|
||||
class WalletCaptainRefactored extends StatelessWidget {
|
||||
WalletCaptainRefactored({super.key});
|
||||
class WalletCaptainRefactored extends StatefulWidget {
|
||||
const WalletCaptainRefactored({super.key});
|
||||
|
||||
@override
|
||||
State<WalletCaptainRefactored> createState() =>
|
||||
_WalletCaptainRefactoredState();
|
||||
}
|
||||
|
||||
class _WalletCaptainRefactoredState extends State<WalletCaptainRefactored> {
|
||||
final CaptainWalletController controller = Get.put(CaptainWalletController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void initState() {
|
||||
super.initState();
|
||||
// كان التحديث يُنادى داخل build. وbuild يعمل عشرات المرات — عند كل
|
||||
// إعادة رسم، وكل تغيّر حالة، وكل دوران للشاشة — فكان كل واحدة منها
|
||||
// تُطلق نداءات شبكية. مكانه هنا: مرة واحدة عند فتح الشاشة، والباقي
|
||||
// بالسحب للتحديث أو بزر التحديث.
|
||||
controller.refreshCaptainWallet();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: FinanceDesignSystem.backgroundColor,
|
||||
appBar: AppBar(
|
||||
|
||||
Reference in New Issue
Block a user