From 7c47f0a62865ff173c45a13493e4231bcea0ebbf Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 6 Apr 2021 16:35:14 +0800 Subject: [PATCH] remove codes again --- lib/pages/home/home_page.dart | 45 --- lib/pages/home/widget/home_swiper.dart | 94 ------ lib/pages/life_pay/life_pay_record_page.dart | 1 + lib/pages/personal/look_logistics_page.dart | 309 ------------------ .../things_page/widget/things_app_bar.dart | 68 ---- lib/widget/bottom_button.dart | 53 --- lib/widget/cached_image_wrapper.dart | 84 ----- lib/widget/circle_trend.dart | 112 ------- lib/widget/common_input.dart | 1 + lib/widget/common_upload_image.dart | 44 --- lib/widget/custom_action_sheet.dart | 132 -------- lib/widget/expandable_text.dart | 84 ----- lib/widget/gallery_photo_view_wrapper.dart | 170 ---------- lib/widget/goods_card_skeleton.dart | 97 ------ lib/widget/round_check_box.dart | 55 ---- lib/widget/search_bar_delegate.dart | 81 ----- lib/widget/single_ad_space.dart | 40 --- 17 files changed, 2 insertions(+), 1468 deletions(-) delete mode 100644 lib/pages/home/widget/home_swiper.dart delete mode 100644 lib/pages/personal/look_logistics_page.dart delete mode 100644 lib/pages/things_page/widget/things_app_bar.dart delete mode 100644 lib/widget/bottom_button.dart delete mode 100644 lib/widget/cached_image_wrapper.dart delete mode 100644 lib/widget/circle_trend.dart delete mode 100644 lib/widget/common_upload_image.dart delete mode 100644 lib/widget/custom_action_sheet.dart delete mode 100644 lib/widget/expandable_text.dart delete mode 100644 lib/widget/gallery_photo_view_wrapper.dart delete mode 100644 lib/widget/goods_card_skeleton.dart delete mode 100644 lib/widget/round_check_box.dart delete mode 100644 lib/widget/search_bar_delegate.dart delete mode 100644 lib/widget/single_ad_space.dart diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 0844116f..65c80497 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -104,45 +104,9 @@ class _HomePageState extends State // HomeSwiper(), // SizedBox(height: 100.w), ApplicationBox(child: ApplicationView()), - // SingleAdSpace( - // imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG, - // ), - // Column( - // children: [ - // HomeTagBar( - // title: '社区团购', - // tag: '团购', - // isShowImage: false, - // ), - // HomeCard( - // isActivity: false, - // title: '新疆库尔阿勒4.5斤,仙人蕉 香甜可口', - // subtitleOne: '中国新疆', - // subtitleTwo: '2020年07月03日', - // imagePath: - // 'http://news.eastday.com/d/file/tga/2013-02-17/c2e7bd7fca1ed2ecf5d50dc9fb30275d.jpg', - // ), - // HomeCard( - // isActivity: false, - // title: '刚果柠檬大果4盒 鲜果新鲜采摘15斤', - // subtitleOne: '非洲刚果', - // subtitleTwo: '2020年08月09日', - // imagePath: - // 'http://5b0988e595225.cdn.sohucs.com/images/20180203/328e145f84c54dd08d1b11b890109862.jpeg', - // ), - // ], - // ), - // SizedBox(height: 30.w), - // HomeTagBar( - // title: '社区商城', - // tag: '团购', - // isShowImage: false, - // isShowTitle: true, - // ), ], ), ), - SliverToBoxAdapter( child: Column( children: [ @@ -165,15 +129,6 @@ class _HomePageState extends State .margin(EdgeInsets.symmetric(horizontal: 32.w)) .make(), ), - // SliverPadding( - // padding: EdgeInsets.only( - // top: 30.w, - // left: 32.w, - // right: 32.w, - // ), - // sliver: _shopList.length == 0 - // ? SliverToBoxAdapter(child: GoodsCardSkeleton()) - // : SliverGoodsCard(shoplist: _shopList)), ], ), ), diff --git a/lib/pages/home/widget/home_swiper.dart b/lib/pages/home/widget/home_swiper.dart deleted file mode 100644 index c8b31eb8..00000000 --- a/lib/pages/home/widget/home_swiper.dart +++ /dev/null @@ -1,94 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/cached_image_wrapper.dart'; - -// import 'package:flutter_swiper/flutter_swiper.dart'; - - -//TODO CLEAN BOTTOM CODES. -@Deprecated("sh*t home_swiper need to be cleaned.") -class HomeSwiper extends StatefulWidget { - HomeSwiper({Key key}) : super(key: key); - - @override - _HomeSwiperState createState() => _HomeSwiperState(); -} - -class _HomeSwiperState extends State { - List imageList = [ - 'https://img.zcool.cn/community/0105a75f7298a211013e45848411c8.jpg', - 'https://img.zcool.cn/community/018c135f73e06711013e4584f1f2fd.jpg', - 'https://img.zcool.cn/community/01e08257de03a10000018c1b55623d.jpg@1280w_1l_2o_100sh.jpg' - ]; - @override - Widget build(BuildContext context) { - return Stack( - overflow: Overflow.visible, - children: [ - Container( - height: 181.w, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [Color(0xffffd000), Color(0xffffbd00)], - ), - ), - ), - // Positioned( - // top: 17.w, - // left: 0, - // right: 0, - // bottom: -76.w, - // child: Swiper( - // itemBuilder: (BuildContext context, int index) { - // return Container( - // decoration: BoxDecoration( - // color: Colors.white, - // boxShadow: [ - // BoxShadow( - // color: Colors.grey.withOpacity(0.2), - // offset: Offset(1.1, 1.1), - // blurRadius: 10.0), - // ], - // ), - // child: CachedImageWrapper( - // url: imageList[index], - // height: 240.w, - // width: 686.w, - // ), - // ); - // }, - // itemCount: 3, - // scrollDirection: Axis.horizontal, - // viewportFraction: 0.8, - // scale: 0.9, - // autoplay: true, - // duration: 600, - // onTap: (index) { - // debugPrint("点击了第:$index个"); - // }, - // controller: SwiperController(), - // pagination: SwiperPagination( - // // 分页指示器 - // alignment: - // Alignment.bottomCenter, // 位置 Alignment.bottomCenter 底部中间 - // margin: const EdgeInsets.fromLTRB(0, 0, 0, 5), // 距离调整 - // builder: DotSwiperPaginationBuilder( - // activeColor: Color(0xffFEC200), - // color: Colors.white, - // size: 15.w, - // activeSize: 20.w, - // space: 10.w, - // ), - // ), - // autoplayDelay: 5000, - // autoplayDisableOnInteraction: true, - // ), - // ), - ], - ); - } -} diff --git a/lib/pages/life_pay/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page.dart index 5aabe669..a2346f52 100644 --- a/lib/pages/life_pay/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page.dart @@ -9,6 +9,7 @@ import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/model/manager/life_pay_record_model.dart'; import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart'; +import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; class LifePayRecordPage extends StatefulWidget { diff --git a/lib/pages/personal/look_logistics_page.dart b/lib/pages/personal/look_logistics_page.dart deleted file mode 100644 index 00d11034..00000000 --- a/lib/pages/personal/look_logistics_page.dart +++ /dev/null @@ -1,309 +0,0 @@ -import 'dart:ui'; - -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter_icons/flutter_icons.dart'; -import 'package:get/get.dart'; - -import 'package:akuCommunity/base/base_style.dart'; -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/cached_image_wrapper.dart'; - -// import 'package:sliding_up_panel/sliding_up_panel.dart'; - - -class LookLogisticsPage extends StatefulWidget { - LookLogisticsPage({Key key}) : super(key: key); - - @override - _LookLogisticsPageState createState() => _LookLogisticsPageState(); -} - -class _LookLogisticsPageState extends State { - double _panelHeightOpen; - double _panelHeightClosed = 95.0; - @override - Widget build(BuildContext context) { - _panelHeightOpen = MediaQuery.of(context).size.height * .85; - double _statusHeight = MediaQuery.of(context).padding.top; - return Scaffold( - body: Stack( - alignment: Alignment.topCenter, - children: [ - _body(), - // SlidingUpPanel( - // margin: EdgeInsets.symmetric(horizontal: 32.w), - // maxHeight: _panelHeightOpen, - // minHeight: _panelHeightClosed, - // parallaxEnabled: true, - // parallaxOffset: .5, - // // body: _body(), - // panelBuilder: (sc) => _panel(sc), - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(8.0), - // topRight: Radius.circular(8.0), - // ), - // ), - Positioned( - top: 32.w + _statusHeight, - child: Container( - width: 686.w, - padding: EdgeInsets.symmetric(horizontal: 32.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(6), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: IconButton( - padding: EdgeInsets.all(0), - alignment: Alignment.centerLeft, - icon: Icon(AntDesign.left, size: 40.sp), - onPressed: () { - Get.back(); - }, - ), - ), - Container( - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(8)), - child: CachedImageWrapper( - url: - 'https://ns-strategy.cdn.bcebos.com/ns-strategy/upload/fc_big_pic/part-00412-2241.jpg', - width: 72.w, - height: 72.w, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 20.w), - child: Text( - '已签收', - style: TextStyle( - fontSize: BaseStyle.fontSize28, - color: ktextPrimary), - ), - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 1.w, - height: 50.w, - child: DecoratedBox( - decoration: - BoxDecoration(color: BaseStyle.color999999), - ), - ), - InkWell( - onTap: () {}, - child: Container( - margin: EdgeInsets.only(left: 20.w), - child: Column( - children: [ - Icon( - Feather.alert_circle, - color: ktextPrimary, - size: BaseStyle.fontSize28, - ), - Container( - margin: EdgeInsets.only(top: 8.w), - child: Text( - '物流投诉', - style: TextStyle( - fontSize: BaseStyle.fontSize22, - color: ktextPrimary), - ), - ) - ], - ), - ), - ), - ], - ), - ], - ), - ), - ), - ], - ), - ); - } - - Widget _panel(ScrollController sc) { - return MediaQuery.removePadding( - context: context, - removeTop: true, - child: ListView( - controller: sc, - children: [ - Container( - height: 40.w, - alignment: Alignment.centerLeft, - decoration: BoxDecoration( - color: Color(0xfff0f0f0), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8.0), - topRight: Radius.circular(8.0), - ), - ), - child: Text( - '中通快递 3072035702394120', - style: TextStyle( - fontSize: BaseStyle.fontSize22, color: ktextPrimary), - ), - ), - SizedBox( - height: 18.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - "Explore Pittsburgh", - style: TextStyle( - fontWeight: FontWeight.normal, - fontSize: 24.0, - ), - ), - ], - ), - SizedBox( - height: 36.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - _button("Popular", Icons.favorite, Colors.blue), - _button("Food", Icons.restaurant, Colors.red), - _button("Events", Icons.event, Colors.amber), - _button("More", Icons.more_horiz, Colors.green), - ], - ), - SizedBox( - height: 36.0, - ), - Container( - padding: const EdgeInsets.only(left: 24.0, right: 24.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("Images", - style: TextStyle( - fontWeight: FontWeight.w600, - )), - SizedBox( - height: 12.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CachedNetworkImage( - imageUrl: - "https://images.fineartamerica.com/images-medium-large-5/new-pittsburgh-emmanuel-panagiotakis.jpg", - height: 120.0, - width: (MediaQuery.of(context).size.width - 48) / 2 - 2, - fit: BoxFit.cover, - ), - CachedNetworkImage( - imageUrl: - "https://cdn.pixabay.com/photo/2016/08/11/23/48/pnc-park-1587285_1280.jpg", - width: (MediaQuery.of(context).size.width - 48) / 2 - 2, - height: 120.0, - fit: BoxFit.cover, - ), - ], - ), - ], - ), - ), - SizedBox( - height: 36.0, - ), - Container( - padding: const EdgeInsets.only(left: 24.0, right: 24.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("About", - style: TextStyle( - fontWeight: FontWeight.w600, - )), - SizedBox( - height: 12.0, - ), - Text( - """Pittsburgh is a city in the state of Pennsylvania in the United States, and is the county seat of Allegheny County. A population of about 302,407 (2018) residents live within the city limits, making it the 66th-largest city in the U.S. The metropolitan population of 2,324,743 is the largest in both the Ohio Valley and Appalachia, the second-largest in Pennsylvania (behind Philadelphia), and the 27th-largest in the U.S.\n\nPittsburgh is located in the southwest of the state, at the confluence of the Allegheny, Monongahela, and Ohio rivers. Pittsburgh is known both as "the Steel City" for its more than 300 steel-related businesses and as the "City of Bridges" for its 446 bridges. The city features 30 skyscrapers, two inclined railways, a pre-revolutionary fortification and the Point State Park at the confluence of the rivers. The city developed as a vital link of the Atlantic coast and Midwest, as the mineral-rich Allegheny Mountains made the area coveted by the French and British empires, Virginians, Whiskey Rebels, and Civil War raiders.\n\nAside from steel, Pittsburgh has led in manufacturing of aluminum, glass, shipbuilding, petroleum, foods, sports, transportation, computing, autos, and electronics. For part of the 20th century, Pittsburgh was behind only New York City and Chicago in corporate headquarters employment; it had the most U.S. stockholders per capita. Deindustrialization in the 1970s and 80s laid off area blue-collar workers as steel and other heavy industries declined, and thousands of downtown white-collar workers also lost jobs when several Pittsburgh-based companies moved out. The population dropped from a peak of 675,000 in 1950 to 370,000 in 1990. However, this rich industrial history left the area with renowned museums, medical centers, parks, research centers, and a diverse cultural district.\n\nAfter the deindustrialization of the mid-20th century, Pittsburgh has transformed into a hub for the health care, education, and technology industries. Pittsburgh is a leader in the health care sector as the home to large medical providers such as University of Pittsburgh Medical Center (UPMC). The area is home to 68 colleges and universities, including research and development leaders Carnegie Mellon University and the University of Pittsburgh. Google, Apple Inc., Bosch, Facebook, Uber, Nokia, Autodesk, Amazon, Microsoft and IBM are among 1,600 technology firms generating \$20.7 billion in annual Pittsburgh payrolls. The area has served as the long-time federal agency headquarters for cyber defense, software engineering, robotics, energy research and the nuclear navy. The nation's eighth-largest bank, eight Fortune 500 companies, and six of the top 300 U.S. law firms make their global headquarters in the area, while RAND Corporation (RAND), BNY Mellon, Nova, FedEx, Bayer, and the National Institute for Occupational Safety and Health (NIOSH) have regional bases that helped Pittsburgh become the sixth-best area for U.S. job growth. - """, - softWrap: true, - ), - ], - ), - ), - SizedBox( - height: 24, - ), - ], - )); - } - - Widget _button(String label, IconData icon, Color color) { - return Column( - children: [ - Container( - padding: const EdgeInsets.all(16.0), - child: Icon( - icon, - color: Colors.white, - ), - decoration: - BoxDecoration(color: color, shape: BoxShape.circle, boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.15), - blurRadius: 8.0, - ) - ]), - ), - SizedBox( - height: 12.0, - ), - Text(label), - ], - ); - } - - Widget _body() { - return SizedBox(); - // return FlutterMap( - // options: MapOptions( - // center: LatLng(22.3817, 114.05), - // zoom: 13, - // maxZoom: 15, - // ), - // layers: [ - // TileLayerOptions( - // urlTemplate: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"), - // MarkerLayerOptions(markers: [ - // Marker( - // point: LatLng(22.3817, 114.05), - // builder: (ctx) => Icon( - // Icons.location_on, - // color: Colors.blue, - // size: 48.0, - // ), - // height: 60), - // ]), - // ], - // ); - } -} diff --git a/lib/pages/things_page/widget/things_app_bar.dart b/lib/pages/things_page/widget/things_app_bar.dart deleted file mode 100644 index f75a2042..00000000 --- a/lib/pages/things_page/widget/things_app_bar.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:flutter_icons/flutter_icons.dart'; -import 'package:get/get.dart'; - -import 'package:akuCommunity/utils/headers.dart'; - -//TODO CLEAN BOTTOM CODES. -@Deprecated("sh*t app bar need to be cleaned.") -class ThingsAppBar extends StatelessWidget { - final String title, subtitle; - final List> treeList; - final TabController tabController; - const ThingsAppBar({ - Key key, - @required this.title, - this.subtitle, - this.treeList, - this.tabController, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - child: AppBar( - elevation: 0, - backgroundColor: Colors.white, - leading: InkWell( - onTap: () => Get.back(), - child: Icon( - AntDesign.left, - size: 45.sp, - color: Color(0xff333333), - ), - ), - centerTitle: true, - title: Text( - title, - style: TextStyle( - color: Color(0xff333333), - fontSize: 32.sp, - fontWeight: FontWeight.w600, - ), - ), - bottom: TabBar( - unselectedLabelStyle: TextStyle( - fontSize: 28.sp, - ), - labelStyle: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 28.sp, - ), - labelPadding: EdgeInsets.symmetric(horizontal: 131.5.w), - indicatorColor: Color(0xffffc40c), - indicatorSize: TabBarIndicatorSize.label, - indicatorPadding: EdgeInsets.symmetric(horizontal: 21.w), - isScrollable: true, - controller: tabController, - tabs: List.generate( - treeList.length, - (index) => Tab(text: treeList[index]['name']), - ), - ), - ), - ); - } -} diff --git a/lib/widget/bottom_button.dart b/lib/widget/bottom_button.dart deleted file mode 100644 index 09da4349..00000000 --- a/lib/widget/bottom_button.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/base/base_style.dart'; -import 'package:akuCommunity/utils/headers.dart'; - -///TODO CLEAN BOTTOM CODES. -/// -///THIS IS SHIT BUTTON -/// -///use `widget/buttons/bottom_button` instead of this widget. -/// -///try import `'package:akuCommunity/widget/buttons/bottom_button.dart'` -@Deprecated("sh*t bottom_button need to be cleaned.") -class BottomButton extends StatefulWidget { - final String title; - final Function fun; - BottomButton({Key key, this.title, this.fun}) : super(key: key); - - @override - _BottomButtonState createState() => _BottomButtonState(); -} - -class _BottomButtonState extends State { - @override - Widget build(BuildContext context) { - return Container( - alignment: Alignment.center, - height: 98.w, - width: MediaQuery.of(context).size.width, - child: InkWell( - onTap: widget.fun, - child: Container( - alignment: Alignment.center, - color: widget.fun == null - ? BaseStyle.color999999 - : BaseStyle.colorffc40c, - padding: EdgeInsets.symmetric( - vertical: 26.5.w, - ), - child: Text( - widget.title, - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: BaseStyle.fontSize32, - color: ktextPrimary, - ), - ), - ), - ), - ); - } -} diff --git a/lib/widget/cached_image_wrapper.dart b/lib/widget/cached_image_wrapper.dart deleted file mode 100644 index 944acc76..00000000 --- a/lib/widget/cached_image_wrapper.dart +++ /dev/null @@ -1,84 +0,0 @@ -import 'dart:math'; - -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:cached_network_image/cached_network_image.dart'; - -enum ImageType { - normal, - // random, //随机 - assets, //资源目录 -} - -@Deprecated("cached_image_wrapper need to be cleaned.") -class CachedImageWrapper extends StatelessWidget { - final String url; - final double width; - final double height; - final BoxFit fit; - final ImageType imageType; - final bool isSigned; - - CachedImageWrapper( - {@required this.url, - @required this.width, - @required this.height, - this.isSigned = true, - this.imageType: ImageType.normal, - this.fit: BoxFit.cover}); - - @override - Widget build(BuildContext context) { - return imageType == ImageType.normal - ? CachedNetworkImage( - key: Key(url), - imageBuilder: (context, imageProvider) { - return Container( - width: width, - height: height, - decoration: BoxDecoration( - color: isSigned - ? Colors.transparent - : Colors.grey.withOpacity(0.6), - image: isSigned - ? DecorationImage( - image: imageProvider, fit: BoxFit.cover, scale: 1) - : null, - ), - ); - }, - imageUrl: imageUrl, - placeholder: (_, __) => SizedBox( - width: width, - height: height, - child: - CupertinoActivityIndicator(radius: min(10.0, width / 3))), - errorWidget: (_, __, ___) => SizedBox( - width: width, - height: height, - child: Icon( - Icons.error_outline, - ), - ), - ) - : SizedBox( - width: width, - height: height, - child: Image.asset(imageUrl), - ); - } - - String get imageUrl { - switch (imageType) { - // case ImageType.random: - // return ImageHelper.randomUrl( - // key: url, width: width.toInt(), height: height.toInt()); - case ImageType.assets: - return "assets/images/" + url; - case ImageType.normal: - return url; - } - return url; - } -} diff --git a/lib/widget/circle_trend.dart b/lib/widget/circle_trend.dart deleted file mode 100644 index ac5c5bc6..00000000 --- a/lib/widget/circle_trend.dart +++ /dev/null @@ -1,112 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/cached_image_wrapper.dart'; - -class CircleTrend extends StatefulWidget { - final String title; - final List> contentList; - final Function fun; - CircleTrend({Key key, this.title, this.contentList, this.fun}) - : super(key: key); - - @override - _CircleTrendState createState() => _CircleTrendState(); -} - -class _CircleTrendState extends State { - TextStyle _textStyleTitle() { - return TextStyle( - fontWeight: FontWeight.w600, fontSize: 52.sp, color: Color(0xff333333)); - } - - TextStyle _textStyleSubtitle() { - return TextStyle(fontSize: 32.sp, color: Color(0xff333333)); - } - - TextStyle _textStyleTag() { - return TextStyle(fontSize: 30.sp, color: Color(0xff444444)); - } - - InkWell _contentDetails(String subtitle, imagePath, Function fun) { - return InkWell( - onTap: () { - fun(subtitle, imagePath); - }, - child: Container( - margin: EdgeInsets.only(bottom: 8.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CachedImageWrapper( - url: imagePath, - width: 152.w, - height: 152.w, - ), - SizedBox(width: 10.w), - Container( - width: 384.w, - child: Text( - subtitle, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: _textStyleSubtitle(), - ), - ), - ], - ), - ), - ); - } - - Container _statusCard( - String title, List> contentList, Function fun) { - return Container( - margin: EdgeInsets.only( - left: 32.w, - right: 32.w, - bottom: 40.w, - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title.substring(0, 2), - style: _textStyleTitle(), - ), - title.substring(2) != null - ? Text( - title.substring(2), - style: _textStyleTag(), - ) - : SizedBox(), - Container( - margin: EdgeInsets.only(left: 30.w), - child: Column( - children: contentList - .map((item) => _contentDetails( - item['subtitle'], - item['imagePath'], - fun, - )) - .toList(), - ), - ), - ], - ), - ); - } - - @override - Widget build(BuildContext context) { - return Container( - child: _statusCard( - widget.title, - widget.contentList, - widget.fun, - ), - ); - } -} diff --git a/lib/widget/common_input.dart b/lib/widget/common_input.dart index 102226a3..2f6e67a6 100644 --- a/lib/widget/common_input.dart +++ b/lib/widget/common_input.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/utils/headers.dart'; +@Deprecated("DO NOT USE THIS WIDGET") class CommonInput extends StatefulWidget { final TextEditingController inputController; final String hintText; diff --git a/lib/widget/common_upload_image.dart b/lib/widget/common_upload_image.dart deleted file mode 100644 index 0ff14fa8..00000000 --- a/lib/widget/common_upload_image.dart +++ /dev/null @@ -1,44 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/base/base_style.dart'; -import 'package:akuCommunity/utils/headers.dart'; - -class CommonUploadImage extends StatefulWidget { - final String imagePath, title; - CommonUploadImage({Key key, this.imagePath, this.title}) : super(key: key); - - @override - _CommonUploadImageState createState() => _CommonUploadImageState(); -} - -class _CommonUploadImageState extends State { - @override - Widget build(BuildContext context) { - return Container( - child: InkWell( - onTap: () {}, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(6)), - child: Image.asset( - widget.imagePath, - width: 328.w, - height: 180.w, - ), - ), - SizedBox(height: 16.w), - Text( - widget.title, - style: TextStyle( - fontSize: BaseStyle.fontSize24, color: BaseStyle.color999999), - ), - ], - ), - ), - ); - } -} diff --git a/lib/widget/custom_action_sheet.dart b/lib/widget/custom_action_sheet.dart deleted file mode 100644 index 6f6e5205..00000000 --- a/lib/widget/custom_action_sheet.dart +++ /dev/null @@ -1,132 +0,0 @@ -import 'package:flutter/material.dart'; - -// 弹出底部sheet -Future showCustomBottomSheet({ - @required BuildContext context, - double radiusSize = 5.0, // 默认圆角为5 - double paddingSize = 10.0, // 默认左右间距为10 - String title = '', // 标题 - double titleFontSize = 14, // 标题字体大小 - Color titleColor = Colors.red, // 标题默认颜色 - String cancelTitle = '取消', - double cancelHeight = 45, - double cancelFontSize = 15, - Color cancelTextColor = Colors.black, - List children = const [], -}) { - assert(context != null); - return showModalBottomSheet( - context: context, - backgroundColor: Color(0x00ffffff), // 背景色设置为无色 - elevation: 0, // 透明度 - builder: (BuildContext context) { - return GestureDetector( - onTap: () { - Navigator.pop(context, -1); - }, - child: Container( - color: Color(0x00ffffff), // 设置颜色后点击事件才有效 - alignment: Alignment.bottomCenter, - padding: EdgeInsets.fromLTRB(paddingSize, 0, paddingSize, - MediaQuery.of(context).padding.bottom), - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - GestureDetector( - onTap: () {}, - child: Container( - padding: EdgeInsets.symmetric(vertical: 5, horizontal: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: (children.length == 0) - ? BorderRadius.all(Radius.circular(radiusSize)) - : BorderRadius.only( - topLeft: Radius.circular(radiusSize), - topRight: Radius.circular(radiusSize))), - alignment: Alignment.center, - constraints: BoxConstraints( - minHeight: 45, - ), - child: Text( - title, - textAlign: TextAlign.center, - style: - TextStyle(color: titleColor, fontSize: titleFontSize), - ), - ), - ), - Column(children: children), - Container( - height: 10, - ), - GestureDetector( - onTap: () { - Navigator.pop(context, 0); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.all(Radius.circular(radiusSize))), - alignment: Alignment.center, - height: cancelHeight, - child: Text( - cancelTitle, - style: TextStyle( - color: cancelTextColor, fontSize: cancelFontSize), - ), - ), - ), - ], - )), - ); - }, - ); -} - -/// 添加时候的item -Widget actionItem({ - @required BuildContext context, - @required int index, - @required String title, - Color color = Colors.black, - Color backgroundColor = Colors.white, - double radiusSize = 5.0, // 默认圆角为5 - bool isLastOne = false, // 是否为最后一个,最后一个如果有圆角的话需要增加底部圆角 - double height = 45, - double fontSize = 15, - VoidCallback onTap, -}) { - assert(context != null); - assert(title != null); - assert(index > 0); - return GestureDetector( - onTap: () { - onTap(); - Navigator.pop(context, index); - }, - child: Column( - children: [ - /// 分割线 - Divider( - height: 0.5, - color: Color(0xffeeeeee), - ), - Container( - decoration: BoxDecoration( - color: backgroundColor, - borderRadius: isLastOne - ? BorderRadius.only( - bottomLeft: Radius.circular(radiusSize), - bottomRight: Radius.circular(radiusSize)) - : BorderRadius.all(Radius.circular(0))), - alignment: Alignment.center, - height: height, - child: Text( - title, - style: TextStyle(color: color, fontSize: fontSize), - ), - ) - ], - )); -} diff --git a/lib/widget/expandable_text.dart b/lib/widget/expandable_text.dart deleted file mode 100644 index 236c65fe..00000000 --- a/lib/widget/expandable_text.dart +++ /dev/null @@ -1,84 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -//TODO Please remove those sh*t code. -class ExpandableText extends StatefulWidget { - final String text; - final int maxLines; - final TextStyle style; - bool expand; - - ExpandableText({Key key, this.text, this.maxLines, this.style, this.expand}) - : super(key: key); - - @override - _ExpandableTextState createState() => _ExpandableTextState(); -} - -class _ExpandableTextState extends State { - @override - void initState() { - super.initState(); - if (widget.expand == null) { - setState(() { - widget.expand = false; - }); - } - } - - @override - Widget build(BuildContext context) { - return Container( - child: LayoutBuilder( - builder: (BuildContext context, size) { - final span = TextSpan(text: widget.text ?? '', style: widget.style); - final tp = TextPainter( - text: span, - maxLines: widget.maxLines, - textDirection: TextDirection.ltr, - ); - tp.layout(maxWidth: size.maxWidth); - if (tp.didExceedMaxLines) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - widget.expand - ? Text( - widget.text ?? '', - style: widget.style, - ) - : Text( - widget.text ?? '', - maxLines: widget.maxLines, - overflow: TextOverflow.ellipsis, - style: widget.style, - ), - GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - setState(() { - widget.expand = !widget.expand; - }); - }, - child: Container( - padding: EdgeInsets.only(top: 2), - child: Text( - widget.expand ? '收起' : '全文', - style: TextStyle( - fontSize: widget.style != null - ? widget.style.fontSize - : null, - color: Color(0xffffc40c)), - ), - ), - ) - ], - ); - } else { - return Text(widget.text ?? '', style: widget.style); - } - }, - ), - ); - } -} diff --git a/lib/widget/gallery_photo_view_wrapper.dart b/lib/widget/gallery_photo_view_wrapper.dart deleted file mode 100644 index a0e72b9e..00000000 --- a/lib/widget/gallery_photo_view_wrapper.dart +++ /dev/null @@ -1,170 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:get/get.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:photo_view/photo_view.dart'; -import 'package:photo_view/photo_view_gallery.dart'; - -import 'cached_image_wrapper.dart'; - -// import 'package:image_gallery_saver/image_gallery_saver.dart'; - -class GalleryPhotoViewWrapper extends StatefulWidget { - GalleryPhotoViewWrapper({ - this.loadingBuilder, - this.backgroundDecoration, - this.minScale, - this.maxScale, - this.initialIndex, - @required this.galleryItems, - this.scrollDirection = Axis.horizontal, - }) : pageController = PageController(initialPage: initialIndex); - - final LoadingBuilder loadingBuilder; - final Decoration backgroundDecoration; - final dynamic minScale; - final dynamic maxScale; - final int initialIndex; - final PageController pageController; - final List galleryItems; - final Axis scrollDirection; - - @override - State createState() { - return _GalleryPhotoViewWrapperState(); - } -} - -class _GalleryPhotoViewWrapperState extends State { - int currentIndex; - - @override - void initState() { - currentIndex = widget.initialIndex; - super.initState(); - } - - void onPageChanged(int index) { - setState(() { - currentIndex = index; - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - body: Container( - decoration: widget.backgroundDecoration, - constraints: BoxConstraints.expand( - height: MediaQuery.of(context).size.height, - ), - child: Stack( - alignment: Alignment.bottomRight, - children: [ - PhotoViewGallery.builder( - scrollPhysics: const BouncingScrollPhysics(), - builder: _buildItem, - itemCount: widget.galleryItems.length, - loadingBuilder: widget.loadingBuilder, - backgroundDecoration: widget.backgroundDecoration, - pageController: widget.pageController, - onPageChanged: onPageChanged, - scrollDirection: widget.scrollDirection, - ), - Positioned( - //图片index显示 - top: MediaQuery.of(context).padding.top + 15, - width: MediaQuery.of(context).size.width, - child: Center( - child: Text("${currentIndex + 1}/${widget.galleryItems.length}", - style: TextStyle(color: Colors.white, fontSize: 16)), - ), - ), - Positioned( - //右上角关闭按钮 - right: 10, - top: MediaQuery.of(context).padding.top, - child: IconButton( - icon: Icon( - Icons.close, - size: 30, - color: Colors.white, - ), - onPressed: () { - Get.back(); - }, - ), - ), - ], - ), - ), - ); - } - -//动态申请权限,ios 要在info.plist 上面添加 - Future requestPermission() async { - var status = await Permission.photos.status; - if (status.isDenied) { - await [Permission.photos].request(); - } - return status.isGranted; - } - - PhotoViewGalleryPageOptions _buildItem(BuildContext context, int index) { - final GalleryExampleItem item = widget.galleryItems[index]; - return PhotoViewGalleryPageOptions( - onTapUp: (BuildContext context, TapUpDetails details, - PhotoViewControllerValue controllerValue) { - Get.back(); - }, - imageProvider: NetworkImage(item.resource), -// initialScale: PhotoViewComputedScale.contained, -// minScale: PhotoViewComputedScale.contained * (0.5 + index / 10), -// maxScale: PhotoViewComputedScale.covered * 1.1, - - heroAttributes: PhotoViewHeroAttributes(tag: item.id), - ); - } -} - -//Hero 动画组件 -// ignore: must_be_immutable -class GalleryExampleItemThumbnail extends StatelessWidget { - GalleryExampleItemThumbnail({Key key, this.galleryExampleItem, this.onTap}) - : super(key: key); - - final GalleryExampleItem galleryExampleItem; - - final GestureTapCallback onTap; - UniqueKey uniqueKey = UniqueKey(); - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - ), - child: GestureDetector( - onTap: onTap, - child: Hero( - tag: uniqueKey, - child: CachedImageWrapper( - url: galleryExampleItem.resource, - height: 15, - width: 15, - fit: BoxFit.cover, - ), - ), - ), - ); - } -} - -//model -class GalleryExampleItem { - GalleryExampleItem({this.id, this.resource, this.isSvg = false}); - //hero的id 不能重复 - String id; - String resource; - bool isSvg; -} diff --git a/lib/widget/goods_card_skeleton.dart b/lib/widget/goods_card_skeleton.dart deleted file mode 100644 index f0458474..00000000 --- a/lib/widget/goods_card_skeleton.dart +++ /dev/null @@ -1,97 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:shimmer/shimmer.dart'; - -import 'package:akuCommunity/utils/headers.dart'; - -class GoodsCardSkeleton extends StatelessWidget { - const GoodsCardSkeleton({Key key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - child: GridView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: 6, - itemBuilder: (BuildContext context, int index) { - return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - ), - child: Shimmer.fromColors( - baseColor: Colors.grey[300], - highlightColor: Colors.grey[100], - enabled: true, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - offset: Offset(1.1, 1.1), - blurRadius: 10.0), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - color: Colors.white, - width: 333.w, - height: 344.w, - ), - Padding( - padding: EdgeInsets.only( - left: 12.w, - right: 12.w, - top: 22.w, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4), - ), - margin: EdgeInsets.only(bottom: 6.w), - height: 30.w, - width: double.infinity, - ), - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4), - ), - margin: EdgeInsets.only(bottom: 20.w), - height: 30.w, - width: double.infinity, - ), - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(4), - ), - height: 32.w, - width: 61.w, - ), - ], - ), - ), - ], - ), - ), - ), - ); - }, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - mainAxisSpacing: 20.w, - crossAxisSpacing: 20.w, - childAspectRatio: 333.w / 509.w), - ), - ); - } -} diff --git a/lib/widget/round_check_box.dart b/lib/widget/round_check_box.dart deleted file mode 100644 index 990b92fd..00000000 --- a/lib/widget/round_check_box.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:akuCommunity/utils/headers.dart'; - -//TODO one day we need to remove those.😕 -//TODO CLEAN BOTTOM CODES. -@Deprecated("sh*t round_check_box need to be cleaned.") -class RoundCheckBox extends StatefulWidget { - var value = false; - - Function onChanged; - - String title; - - RoundCheckBox({Key key, @required this.value, this.onChanged, this.title}) - : super(key: key); - - @override - _RoundCheckBoxState createState() => _RoundCheckBoxState(); -} - -class _RoundCheckBoxState extends State { - @override - Widget build(BuildContext context) { - return Container( - child: InkWell( - onTap: widget.onChanged, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - widget.value - ? Icon( - Icons.check_circle, - size: 30.sp, - color: Color(0xffffc40c), - ) - : Icon( - Icons.panorama_fish_eye, - size: 30.sp, - color: Color(0xff979797), - ), - SizedBox(width: 10.w), - Text( - widget.title, - style: TextStyle( - fontSize: 26.sp, - color: Color(0xff333333), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/widget/search_bar_delegate.dart b/lib/widget/search_bar_delegate.dart deleted file mode 100644 index a5746ed3..00000000 --- a/lib/widget/search_bar_delegate.dart +++ /dev/null @@ -1,81 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'asset.dart'; -import 'bee_scaffold.dart'; - -class SearchBarDemo extends StatefulWidget { - _SearchBarDemoState createState() => _SearchBarDemoState(); -} - -class _SearchBarDemoState extends State { - @override - Widget build(BuildContext context) { - return BeeScaffold( - title: 'SearchBarDemo', - actions: [ - IconButton( - icon: Icon(Icons.search), - onPressed: () { - showSearch(context: context, delegate: SearchBarDelegate()); - } - // showSearch(context:context,delegate: searchBarDelegate()), - ), - ], - ); - } -} - -class SearchBarDelegate extends SearchDelegate { - @override - List buildActions(BuildContext context) { - return [ - IconButton( - icon: Icon(Icons.clear), - onPressed: () => query = "", - ) - ]; - } - - @override - Widget buildLeading(BuildContext context) { - return IconButton( - icon: AnimatedIcon( - icon: AnimatedIcons.menu_arrow, progress: transitionAnimation), - onPressed: () => close(context, null)); - } - - @override - Widget buildResults(BuildContext context) { - return Container( - width: 100.0, - height: 100.0, - child: Card( - color: Colors.redAccent, - child: Center( - child: Text(query), - ), - ), - ); - } - - @override - Widget buildSuggestions(BuildContext context) { - final suggestionList = query.isEmpty - ? recentSuggest - : searchList.where((input) => input.startsWith(query)).toList(); - return ListView.builder( - itemCount: suggestionList.length, - itemBuilder: (context, index) => ListTile( - title: RichText( - text: TextSpan( - text: suggestionList[index].substring(0, query.length), - style: TextStyle( - color: Colors.black, fontWeight: FontWeight.bold), - children: [ - TextSpan( - text: suggestionList[index].substring(query.length), - style: TextStyle(color: Colors.grey)) - ])), - )); - } -} diff --git a/lib/widget/single_ad_space.dart b/lib/widget/single_ad_space.dart deleted file mode 100644 index cfb583b6..00000000 --- a/lib/widget/single_ad_space.dart +++ /dev/null @@ -1,40 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:flutter_screenutil/flutter_screenutil.dart'; - -class SingleAdSpace extends StatelessWidget { - final String imagePath; - final double radius; - SingleAdSpace({Key key, this.imagePath, this.radius = 0}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - height: 160.w, - margin: EdgeInsets.symmetric( - horizontal: 32.w, - vertical: 17.w, - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(radius)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.6), - offset: Offset(1.1, 1.1), - blurRadius: 10.0), - ], - ), - child: InkWell( - onTap: () {}, - child: Container( - child: Image.asset( - imagePath, - height: 160.w, - fit: BoxFit.fill, - ), - ), - ), - ); - } -}