import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/components/sphere_cloud.dart'; import 'package:dating_touchme_app/controller/home/real_home_controller.dart'; import 'package:dating_touchme_app/generated/assets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; class RealHomePage extends StatefulWidget { const RealHomePage({super.key}); @override State createState() => _RealHomePageState(); } class _RealHomePageState extends State with AutomaticKeepAliveClientMixin { @override Widget build(BuildContext context) { super.build(context); return GetBuilder( init: RealHomeController(), builder: (controller){ return Stack( children: [ Image.asset( Assets.imagesStarSkyBg, width: 375.w, fit: BoxFit.cover, alignment: AlignmentGeometry.topCenter, ), Scaffold( backgroundColor: Colors.transparent, appBar: PageAppbar(title: "快乐星球", color: Colors.white, backgroundColor: Colors.transparent,), body: Container( width: 375.w, padding: EdgeInsets.symmetric(horizontal: 15.w), child: SingleChildScrollView( child: Column( children: [ SizedBox( width: 345.w, height: 345.w, child: SphereCloud( itemSize: 36.w, items: [ ...controller.recommendFeed.map((e){ return SizedBox( width: 36.w, child: Column( children: [ Text( e.nickName, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 12.w, color: Colors.white, fontWeight: FontWeight.w400 ), ), Image.network( e.profilePhoto, width: 18.w, height: 18.w, fit: BoxFit.cover, ) ], ), ); }), ] ), ), Container( width: 92.w, height: 21.w, margin: EdgeInsets.symmetric(vertical: 20.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(21.w)), color: const Color.fromRGBO(255, 255, 255, .1) ), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( Icons.autorenew, size: 18.w, color: Colors.white, ), SizedBox(width: 4.w,), Text( "换一批", style: TextStyle( fontSize: 12.w, color: Colors.white ), ) ], ), ), Row( children: [ Text( "趣味测试", style: TextStyle( fontSize: 16.w, color: Colors.white ), ) ], ), SizedBox(height: 7.w,), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Image.asset( Assets.imagesTest1, width: 170.w, ), Image.asset( Assets.imagesTest2, width: 170.w, ), ], ), SizedBox(height: 15.w,), Row( children: [ Text( "热门帖子", style: TextStyle( fontSize: 16.w, color: Colors.white ), ) ], ), SizedBox(height: 7.w,), ], ), ), ), ) ], ); }, ); } @override bool get wantKeepAlive => true; }