重写首页应用卡片背景,移除首页滚动

hmxc
小赖 4 years ago
parent eede4db6ff
commit 5179ae3bba

@ -27,7 +27,7 @@ import 'package:akuCommunity/ui/home/home_notification.dart';
import 'package:akuCommunity/ui/home/home_title.dart'; import 'package:akuCommunity/ui/home/home_title.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/buttons/column_action_button.dart'; import 'package:akuCommunity/widget/buttons/column_action_button.dart';
import 'package:akuCommunity/widget/container_comment.dart'; import 'package:akuCommunity/widget/views/application_box.dart';
import 'package:akuCommunity/widget/views/application_view.dart'; import 'package:akuCommunity/widget/views/application_view.dart';
import 'widget/home_search.dart'; import 'widget/home_search.dart';
import 'widget/home_swiper.dart'; import 'widget/home_swiper.dart';
@ -59,29 +59,9 @@ class _HomePageState extends State<HomePage>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Future<String> loadString =
DefaultAssetBundle.of(context).loadString("assets/json/shop.json");
loadString.then((String value) {
//
akuShop(value);
});
// akuShop(page);
_scrollController = ScrollController(); _scrollController = ScrollController();
} }
Future<void> akuShop(String response) async {
Map<String, dynamic> result = json.decode(response.toString());
BaseModel model = BaseModel.fromJson(result);
model.result.forEach((item) {
item["count"] = 1;
item["isCheck"] = false;
AkuShopModel list = AkuShopModel.fromJson(item);
setState(() {
_shopList.add(list);
});
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
@ -116,12 +96,9 @@ class _HomePageState extends State<HomePage>
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
HomeSearch(), HomeSearch(),
HomeSwiper(), // HomeSwiper(),
SizedBox(height: 100.w), // SizedBox(height: 100.w),
ContainerComment( ApplicationBox(child: ApplicationView()),
radius: 8,
customWidget: ApplicationView(),
),
// SingleAdSpace( // SingleAdSpace(
// imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG, // imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG,
// ), // ),

@ -9,6 +9,8 @@ import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart'; import 'package:akuCommunity/widget/cached_image_wrapper.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t home_swiper need to be cleaned.")
class HomeSwiper extends StatefulWidget { class HomeSwiper extends StatefulWidget {
HomeSwiper({Key key}) : super(key: key); HomeSwiper({Key key}) : super(key: key);

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/widget/views/application_box.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,7 +15,6 @@ import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/utils/network/base_list_model.dart'; import 'package:akuCommunity/utils/network/base_list_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart'; import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/container_comment.dart';
import 'package:akuCommunity/widget/views/application_view.dart'; import 'package:akuCommunity/widget/views/application_view.dart';
import 'widget/property_card.dart'; import 'widget/property_card.dart';
@ -80,9 +80,8 @@ class _PropertyIndexState extends State<PropertyIndex>
child: CustomScrollView( child: CustomScrollView(
slivers: [ slivers: [
SliverToBoxAdapter( SliverToBoxAdapter(
child: ContainerComment( child: ApplicationBox(
radius: 8, child: ApplicationView.custom(items: smartManagerApp),
customWidget: ApplicationView.custom(items: smartManagerApp),
), ),
), ),
SliverToBoxAdapter( SliverToBoxAdapter(

@ -1,42 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t container_comment need to be cleaned.")
class ContainerComment extends StatelessWidget {
final Widget customWidget;
final double radius;
ContainerComment({Key key, this.customWidget, this.radius = 0})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(
horizontal: 32.w,
vertical: 17.w,
),
padding: EdgeInsets.symmetric(
horizontal: 24.w,
vertical: 16.w,
),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(radius)),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.2),
offset: Offset(1.1, 1.1),
blurRadius: 10.0,
),
],
),
child: customWidget,
);
}
}

@ -0,0 +1,30 @@
// Flutter imports:
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ApplicationBox extends StatelessWidget {
final Widget child;
ApplicationBox({Key key, this.child}) : super(key: key);
@override
Widget build(BuildContext context) {
return VxBox(child: child)
.margin(EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w))
.padding(EdgeInsets.all(24.w))
.color(Colors.white)
.withRounded(value: 8.w)
.withShadow([
BoxShadow(
color: Colors.grey.withOpacity(0.2),
offset: Offset(1.1, 1.1),
blurRadius: 10.0,
)
])
.make()
.centered();
}
}
Loading…
Cancel
Save