|
|
@@ -12,8 +12,10 @@ import 'package:location/module/main/view.dart';
|
|
|
import 'package:location/resource/assets.gen.dart';
|
|
|
import 'package:location/resource/colors.gen.dart';
|
|
|
import 'package:location/resource/string.gen.dart';
|
|
|
+import 'package:location/utils/atmob_log.dart';
|
|
|
import 'package:location/utils/common_expand.dart';
|
|
|
import 'package:sliding_sheet2/sliding_sheet2.dart';
|
|
|
+import 'package:visibility_detector/visibility_detector.dart';
|
|
|
import '../../data/consts/constants.dart';
|
|
|
import '../../router/app_pages.dart';
|
|
|
import '../../utils/common_style.dart';
|
|
|
@@ -45,12 +47,18 @@ class MainPage extends BasePage<MainController> {
|
|
|
onPopInvokedWithResult: (bool didPop, dynamic result) {
|
|
|
controller.onAppBack();
|
|
|
},
|
|
|
- child: Stack(
|
|
|
+ child: Column(
|
|
|
children: [
|
|
|
- buildMapView(),
|
|
|
- buildMapFunView(),
|
|
|
- buildMainBottomView(),
|
|
|
- buildFriendListView(),
|
|
|
+ Expanded(
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ buildMapView(),
|
|
|
+ buildMapFunView(),
|
|
|
+ buildMainBottomView(),
|
|
|
+ buildFriendListView(),
|
|
|
+ ],
|
|
|
+ )),
|
|
|
+ buildTabContainer()
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
@@ -75,94 +83,109 @@ class MainPage extends BasePage<MainController> {
|
|
|
shadowColor: Colors.black.withOpacity(0.1),
|
|
|
cornerRadius: 18.w,
|
|
|
snapSpec: SnapSpec(
|
|
|
- initialSnap: SnapSpec.headerFooterSnap,
|
|
|
+ initialSnap: SnapSpec.headerSnap,
|
|
|
// Enable snapping. This is true by default.
|
|
|
snap: true,
|
|
|
// Set custom snapping points.
|
|
|
- snappings: [SnapSpec.headerFooterSnap, SnapSpec.expanded],
|
|
|
+ snappings: [SnapSpec.headerSnap, SnapSpec.expanded],
|
|
|
// Define to what the snappings relate to. In this case,
|
|
|
// the total available space that the sheet can expand to.
|
|
|
positioning: SnapPositioning.relativeToAvailableSpace,
|
|
|
),
|
|
|
- footerBuilder: buildFooterBuilder,
|
|
|
headerBuilder: buildHeaderBuilder,
|
|
|
builder: buildTrackEntranceBuilder,
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget buildTrackEntranceBuilder(BuildContext context, SheetState state) {
|
|
|
- return Container(
|
|
|
- margin: EdgeInsets.only(left: 12.w, right: 12.w, bottom: 12.w),
|
|
|
- padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 12.w, bottom: 9.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white, borderRadius: BorderRadius.circular(20.r)),
|
|
|
- child: AspectRatio(
|
|
|
- aspectRatio: 336 / 134,
|
|
|
- child: Column(
|
|
|
+ return VisibilityDetector(
|
|
|
+ key: Key('main_today_track'),
|
|
|
+ onVisibilityChanged: (VisibilityInfo info) {
|
|
|
+ final visibleFraction = info.visibleFraction;
|
|
|
+ controller.onFriendVisibleFraction(visibleFraction);
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(left: 12.w, right: 12.w, bottom: 12.w),
|
|
|
+ padding:
|
|
|
+ EdgeInsets.only(left: 12.w, right: 12.w, top: 12.w, bottom: 9.w),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white, borderRadius: BorderRadius.circular(20.r)),
|
|
|
+ child: AspectRatio(
|
|
|
+ aspectRatio: 336 / 134,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(StringName.todaySimpleTrack,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 13.sp,
|
|
|
+ color: '#333333'.color,
|
|
|
+ fontWeight: FontWeight.bold)),
|
|
|
+ Spacer(),
|
|
|
+ Assets.images.iconMainTrackArrow
|
|
|
+ .image(width: 10.w, height: 10.w),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ SizedBox(height: 7.w),
|
|
|
+ buildSelectedFriendTodayTrackDetailView(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildSelectedFriendTodayTrackDetailView() {
|
|
|
+ return Expanded(child: Obx(() {
|
|
|
+ if (controller.todayTrackRequesting) {
|
|
|
+ return Center(child: Text('加载中...'));
|
|
|
+ } else {
|
|
|
+ return Row(
|
|
|
children: [
|
|
|
- Row(
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(bottom: 3.w, top: 3.w),
|
|
|
+ child: AspectRatio(
|
|
|
+ aspectRatio: 1,
|
|
|
+ child: Assets.images.imgTrackExample.image(),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ SizedBox(width: 10.w),
|
|
|
+ Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: [
|
|
|
- Text(StringName.todaySimpleTrack,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 13.sp,
|
|
|
- color: '#333333'.color,
|
|
|
- fontWeight: FontWeight.bold)),
|
|
|
- Spacer(),
|
|
|
- Assets.images.iconMainTrackArrow
|
|
|
- .image(width: 10.w, height: 10.w),
|
|
|
+ SizedBox(height: 6.w),
|
|
|
+ getMainTrackDot('#15CBA1'.color),
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.symmetric(vertical: 4.w),
|
|
|
+ width: 1.w,
|
|
|
+ height: double.infinity,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: '#F0F0F0'.color,
|
|
|
+ borderRadius: BorderRadius.circular(100.r),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ getMainTrackDot('#E94949'.color),
|
|
|
+ SizedBox(height: 6.w),
|
|
|
],
|
|
|
),
|
|
|
- SizedBox(height: 7.w),
|
|
|
+ SizedBox(width: 8.w),
|
|
|
Expanded(
|
|
|
- child: Row(
|
|
|
+ child: Column(
|
|
|
children: [
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(bottom: 3.w, top: 3.w),
|
|
|
- child: AspectRatio(
|
|
|
- aspectRatio: 1,
|
|
|
- child: Assets.images.imgTrackExample.image(),
|
|
|
- ),
|
|
|
- ),
|
|
|
- SizedBox(width: 10.w),
|
|
|
- Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- SizedBox(height: 6.w),
|
|
|
- getMainTrackDot('#15CBA1'.color),
|
|
|
- Expanded(
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.symmetric(vertical: 4.w),
|
|
|
- width: 1.w,
|
|
|
- height: double.infinity,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: '#F0F0F0'.color,
|
|
|
- borderRadius: BorderRadius.circular(100.r),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- getMainTrackDot('#E94949'.color),
|
|
|
- SizedBox(height: 6.w),
|
|
|
- ],
|
|
|
- ),
|
|
|
- SizedBox(width: 8.w),
|
|
|
- Expanded(
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- buildTrackPoint(MainTrackType.startPoint,
|
|
|
- '广东省广州市天河区高唐路235号靠近C栋2楼时代E-PARK'),
|
|
|
- Spacer(),
|
|
|
- buildTrackPoint(
|
|
|
- MainTrackType.errorPoint, '广东省广州市海珠区滨江东路驾驶花园C栋601'),
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
+ buildTrackPoint(MainTrackType.startPoint,
|
|
|
+ '广东省广州市天河区高唐路235号靠近C栋2楼时代E-PARK'),
|
|
|
+ Spacer(),
|
|
|
+ buildTrackPoint(
|
|
|
+ MainTrackType.errorPoint, '广东省广州市海珠区滨江东路驾驶花园C栋601'),
|
|
|
],
|
|
|
),
|
|
|
- ),
|
|
|
+ )
|
|
|
],
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }));
|
|
|
}
|
|
|
|
|
|
Widget buildFriendListView() {
|
|
|
@@ -190,7 +213,7 @@ class MainPage extends BasePage<MainController> {
|
|
|
Widget buildMapFunView() {
|
|
|
return Positioned(
|
|
|
right: 0.w,
|
|
|
- bottom: 230.w,
|
|
|
+ bottom: 140.w,
|
|
|
child: Column(
|
|
|
children: [
|
|
|
GestureDetector(
|