67 lines
2.0 KiB
Dart
67 lines
2.0 KiB
Dart
import 'package:circle_app/app/minefragment/view.dart';
|
|
import 'package:circle_app/util/util.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../router/app_routers.dart';
|
|
import 'logic.dart';
|
|
|
|
class HomePage extends StatelessWidget {
|
|
HomePage({Key? key}) : super(key: key);
|
|
|
|
final logic = Get.lazyPut(() => HomeLogic());
|
|
final state = Get.find<HomeLogic>().state;
|
|
|
|
final List _tabs = [
|
|
Container(),
|
|
Container(),
|
|
MinefragmentPage(),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetBuilder(builder: (HomeLogic controller) {
|
|
return GestureDetector(
|
|
onTap: () {
|
|
// Get.toNamed(AppRoutes.Complete_materialPage);
|
|
},
|
|
child: Scaffold(
|
|
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
|
bottomNavigationBar: Container(
|
|
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
|
width: Get.width,
|
|
// color: Colors.red,
|
|
padding: EdgeInsets.only(left: 50.sp,right: 50.sp,top: 8.sp),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
|
funcItem(1, 'circle', 1 == controller.currentIndex, controller),
|
|
funcItem(2, 'mine', 2 == controller.currentIndex, controller),
|
|
],
|
|
),
|
|
),
|
|
body:_tabs[controller.currentIndex]
|
|
),
|
|
);
|
|
});
|
|
}
|
|
|
|
funcItem(int index,String image,bool isSelected,HomeLogic controller) {
|
|
return GestureDetector(
|
|
onTap: () {
|
|
if (!isSelected) {
|
|
controller.updateIndex(index);
|
|
}
|
|
},
|
|
child: Container(
|
|
child: Image.asset(isSelected ? getTabbarImage(image + '_selected') : getTabbarImage(image + '_normal'),width: 34.sp,height: 34.sp,),
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|
|
|