import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/pages/chat_page.dart'; import 'package:dating_touchme_app/pages/index_page.dart'; import 'package:dating_touchme_app/pages/live_page.dart'; import 'package:dating_touchme_app/pages/my_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class HomePage extends StatefulWidget { const HomePage({super.key}); @override State createState() => _HomePageState(); } class _HomePageState extends State { int active = 1; @override Widget build(BuildContext context) { return Scaffold( body: Column( children: [ Expanded( child: SingleChildScrollView( child: active == 1 ? IndexPage() : active == 2 ? LivePage() : active == 3 ? ChatPage() : active == 4 ? MyPage() : Container(), ), ), ], ), bottomNavigationBar: Container( padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), child: SizedBox( height: ScreenUtil().setWidth(100), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: InkWell( onTap: (){ active = 1; setState(() { }); }, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( "assets/${active == 1 ? "index_active" : "index"}.png", width: 65.w, height: 65.w, ), Text( "动我", style: TextStyle( fontSize: 16.w, color: const Color.fromRGBO(51, 51, 51, 1) ), ) ], ), ), ), Expanded( child: InkWell( onTap: (){ active = 2; setState(() { }); }, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( "assets/${active == 2 ? "friend_active" : "friend"}.png", width: 65.w, height: 65.w, ), Text( "找朋友", style: TextStyle( fontSize: 16.w, color: const Color.fromRGBO(51, 51, 51, 1) ), ) ], ), ), ), Expanded( child: InkWell( onTap: (){ active = 3; setState(() { }); }, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( "assets/${active == 3 ? "chat_active" : "chat"}.png", width: 65.w, height: 65.w, ), Text( "消息", style: TextStyle( fontSize: 16.w, color: const Color.fromRGBO(51, 51, 51, 1) ), ) ], ), ), ), Expanded( child: InkWell( onTap: (){ active = 4; setState(() { }); }, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( "assets/${active == 4 ? "my_active" : "my"}.png", width: 65.w, height: 65.w, ), Text( "我的", style: TextStyle( fontSize: 16.w, color: const Color.fromRGBO(51, 51, 51, 1) ), ) ], ), ), ), ], ), ), ), ); } }