├── ios ├── ._Podfile ├── ._Runner.xcodeproj ├── ._Runner.xcworkspace ├── Flutter │ ├── ._Flutter.framework │ ├── Debug.xcconfig │ ├── Release.xcconfig │ ├── flutter_export_environment.sh │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── main.m │ ├── AppDelegate.m │ ├── Info.plist │ └── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Podfile.lock └── Podfile ├── fonts ├── iconfont.ttf ├── iconfont2.ttf └── MyFlutterApp.ttf ├── images └── 3.0x │ ├── logo.png │ ├── about.png │ ├── ad_bar.png │ ├── baobao.png │ ├── clear.png │ ├── guide.png │ ├── huazp.png │ ├── income.png │ ├── reward.png │ ├── banner_1.png │ ├── check_in.png │ ├── complaint.png │ ├── customer.png │ ├── flame_ico.png │ ├── footprint.png │ ├── lottery.png │ ├── my_fans.png │ ├── new_store.png │ ├── problem.png │ ├── referrer.png │ ├── sign_out.png │ ├── card_coupon.png │ ├── discount_bg.png │ ├── head_menu_1.png │ ├── head_menu_2.png │ ├── head_menu_3.png │ ├── head_menu_4.png │ ├── head_menu_5.png │ ├── head_menu_6.png │ ├── head_menu_7.png │ ├── head_menu_8.png │ ├── information.png │ ├── new_talent.png │ ├── order_form.png │ ├── personal_ad.png │ ├── wallet_red.png │ ├── call_hotline.png │ ├── check_in_text.png │ ├── default_avatar.png │ ├── exchange_btn.png │ ├── headline_icon.png │ ├── invite_friends.png │ ├── new_shop_text.png │ ├── newcomer_text.png │ ├── poster_content.png │ ├── scrollmenu_1.png │ ├── scrollmenu_2.png │ ├── scrollmenu_3.png │ ├── see_more_text1.png │ ├── see_more_text2.png │ ├── wallet_yellow.png │ ├── contact_merchant.png │ ├── home_near_store.png │ ├── store_list_label.png │ ├── points_lottery_text.png │ └── details_description.jpeg ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── flutter_yjh │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── lib ├── dao │ ├── config.dart │ ├── findings_dao.dart │ ├── home_dao.dart │ └── order_form_dao.dart ├── view │ ├── flutter_icon_data.dart │ ├── arc_bg.dart │ ├── flutter_iconfont.dart │ ├── customize_appbar.dart │ ├── my_icons.dart.dart │ ├── theme_ui.dart │ ├── ratingbar.dart │ └── app_topbar.dart ├── models │ ├── home_entity.dart │ ├── entity_factory.dart │ ├── goods_entity.dart │ ├── order_form_entity.dart │ └── store_entity.dart ├── utils │ ├── app_size.dart │ └── constants.dart ├── page │ ├── secondary │ │ ├── new_shop.dart │ │ ├── my_fans.dart │ │ ├── shop_Information.dart │ │ ├── favorite_page.dart │ │ ├── points_lottery.dart │ │ ├── shop_reward.dart │ │ ├── super_discount.dart │ │ ├── card_voucher.dart │ │ ├── edit_profile.dart │ │ ├── income_record.dart │ │ ├── store_live.dart │ │ ├── female_channel.dart │ │ ├── invite_friends.dart │ │ ├── follow_page.dart │ │ ├── my_scores.dart │ │ ├── points_mall.dart │ │ ├── nearby_business.dart │ │ ├── good_shop.dart │ │ ├── famous_brand.dart │ │ └── shop_referrer.dart │ ├── index_page.dart │ ├── orderform_page.dart │ ├── login_page.dart │ ├── findings_page.dart │ └── registered_page.dart ├── main.dart └── routes │ └── routes.dart ├── .metadata ├── .gitignore ├── .flutter-plugins-dependencies ├── README.md ├── pubspec.yaml ├── pubspec.lock └── LICENSE /ios/._Podfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/._Podfile -------------------------------------------------------------------------------- /fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/fonts/iconfont.ttf -------------------------------------------------------------------------------- /fonts/iconfont2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/fonts/iconfont2.ttf -------------------------------------------------------------------------------- /images/3.0x/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/logo.png -------------------------------------------------------------------------------- /fonts/MyFlutterApp.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/fonts/MyFlutterApp.ttf -------------------------------------------------------------------------------- /images/3.0x/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/about.png -------------------------------------------------------------------------------- /images/3.0x/ad_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/ad_bar.png -------------------------------------------------------------------------------- /images/3.0x/baobao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/baobao.png -------------------------------------------------------------------------------- /images/3.0x/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/clear.png -------------------------------------------------------------------------------- /images/3.0x/guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/guide.png -------------------------------------------------------------------------------- /images/3.0x/huazp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/huazp.png -------------------------------------------------------------------------------- /images/3.0x/income.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/income.png -------------------------------------------------------------------------------- /images/3.0x/reward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/reward.png -------------------------------------------------------------------------------- /ios/._Runner.xcodeproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/._Runner.xcodeproj -------------------------------------------------------------------------------- /images/3.0x/banner_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/banner_1.png -------------------------------------------------------------------------------- /images/3.0x/check_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/check_in.png -------------------------------------------------------------------------------- /images/3.0x/complaint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/complaint.png -------------------------------------------------------------------------------- /images/3.0x/customer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/customer.png -------------------------------------------------------------------------------- /images/3.0x/flame_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/flame_ico.png -------------------------------------------------------------------------------- /images/3.0x/footprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/footprint.png -------------------------------------------------------------------------------- /images/3.0x/lottery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/lottery.png -------------------------------------------------------------------------------- /images/3.0x/my_fans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/my_fans.png -------------------------------------------------------------------------------- /images/3.0x/new_store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/new_store.png -------------------------------------------------------------------------------- /images/3.0x/problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/problem.png -------------------------------------------------------------------------------- /images/3.0x/referrer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/referrer.png -------------------------------------------------------------------------------- /images/3.0x/sign_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/sign_out.png -------------------------------------------------------------------------------- /ios/._Runner.xcworkspace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/._Runner.xcworkspace -------------------------------------------------------------------------------- /images/3.0x/card_coupon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/card_coupon.png -------------------------------------------------------------------------------- /images/3.0x/discount_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/discount_bg.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_1.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_2.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_3.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_4.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_5.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_6.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_7.png -------------------------------------------------------------------------------- /images/3.0x/head_menu_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/head_menu_8.png -------------------------------------------------------------------------------- /images/3.0x/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/information.png -------------------------------------------------------------------------------- /images/3.0x/new_talent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/new_talent.png -------------------------------------------------------------------------------- /images/3.0x/order_form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/order_form.png -------------------------------------------------------------------------------- /images/3.0x/personal_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/personal_ad.png -------------------------------------------------------------------------------- /images/3.0x/wallet_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/wallet_red.png -------------------------------------------------------------------------------- /images/3.0x/call_hotline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/call_hotline.png -------------------------------------------------------------------------------- /images/3.0x/check_in_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/check_in_text.png -------------------------------------------------------------------------------- /images/3.0x/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/default_avatar.png -------------------------------------------------------------------------------- /images/3.0x/exchange_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/exchange_btn.png -------------------------------------------------------------------------------- /images/3.0x/headline_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/headline_icon.png -------------------------------------------------------------------------------- /images/3.0x/invite_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/invite_friends.png -------------------------------------------------------------------------------- /images/3.0x/new_shop_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/new_shop_text.png -------------------------------------------------------------------------------- /images/3.0x/newcomer_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/newcomer_text.png -------------------------------------------------------------------------------- /images/3.0x/poster_content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/poster_content.png -------------------------------------------------------------------------------- /images/3.0x/scrollmenu_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/scrollmenu_1.png -------------------------------------------------------------------------------- /images/3.0x/scrollmenu_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/scrollmenu_2.png -------------------------------------------------------------------------------- /images/3.0x/scrollmenu_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/scrollmenu_3.png -------------------------------------------------------------------------------- /images/3.0x/see_more_text1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/see_more_text1.png -------------------------------------------------------------------------------- /images/3.0x/see_more_text2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/see_more_text2.png -------------------------------------------------------------------------------- /images/3.0x/wallet_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/wallet_yellow.png -------------------------------------------------------------------------------- /images/3.0x/contact_merchant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/contact_merchant.png -------------------------------------------------------------------------------- /images/3.0x/home_near_store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/home_near_store.png -------------------------------------------------------------------------------- /images/3.0x/store_list_label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/store_list_label.png -------------------------------------------------------------------------------- /ios/Flutter/._Flutter.framework: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Flutter/._Flutter.framework -------------------------------------------------------------------------------- /images/3.0x/points_lottery_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/points_lottery_text.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true -------------------------------------------------------------------------------- /images/3.0x/details_description.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/images/3.0x/details_description.jpeg -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lib/dao/config.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | const ServerHost = 'http://localhost:8081'; 4 | 5 | const FindingUrl = '$ServerHost/api/goods'; 6 | 7 | const HomeUrl = '$ServerHost/api/store'; 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arcticfox1919/flutter_new_retail/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /android/app/src/main/java/com/flutter_yjh/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.flutter_yjh; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | 6 | 7 | public class MainActivity extends FlutterActivity { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 19 21:55:16 CST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip 7 | -------------------------------------------------------------------------------- /lib/view/flutter_icon_data.dart: -------------------------------------------------------------------------------- 1 | library flutter_iconfont; 2 | 3 | import 'package:flutter/widgets.dart' show IconData; 4 | 5 | class IconDataEx extends IconData { 6 | const IconDataEx(int codePoint) 7 | : super( 8 | codePoint, 9 | fontFamily: 'IconFont', 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /lib/models/home_entity.dart: -------------------------------------------------------------------------------- 1 | 2 | abstract class HomeListItem {} 3 | 4 | // banner与头菜单项 5 | class HeadMenuItem extends HomeListItem {} 6 | 7 | // 滚动菜单项 8 | class ScrollMenuItem extends HomeListItem {} 9 | 10 | // 网格菜单项 11 | class GridMenuItem extends HomeListItem {} 12 | 13 | // 广告栏 14 | class AdBarItem extends HomeListItem {} 15 | 16 | // 特惠信息项 17 | class OfferItem extends HomeListItem {} 18 | 19 | // 附近商家 20 | class StoreItem extends HomeListItem {} -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /lib/models/entity_factory.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter_yjh/models/store_entity.dart'; 3 | 4 | import 'goods_entity.dart'; 5 | 6 | class EntityFactory { 7 | static T generateOBJ(json) { 8 | if (1 == 0) { 9 | return null; 10 | } else if (T.toString() == "StoreEntity") { 11 | return StoreEntity.fromJson(json) as T; 12 | } else if (T.toString() == "GoodsEntity"){ 13 | return GoodsEntity.fromJson(json) as T; 14 | }else { 15 | return null; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /lib/utils/app_size.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | 5 | class AppSize{ 6 | 7 | static init(BuildContext context){ 8 | ScreenUtil.init(context); 9 | } 10 | 11 | static height(value){ 12 | return ScreenUtil().setHeight(value.toDouble()); 13 | } 14 | 15 | static width(value){ 16 | return ScreenUtil().setWidth(value.toDouble()); 17 | } 18 | 19 | static sp(value){ 20 | return ScreenUtil().setSp(value.toDouble()); 21 | } 22 | 23 | static instance() => ScreenUtil; 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /lib/dao/findings_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_yjh/models/entity_factory.dart'; 3 | import 'dart:async'; 4 | 5 | import 'package:flutter_yjh/models/goods_entity.dart'; 6 | 7 | import 'config.dart'; 8 | 9 | 10 | 11 | class FindingsDao{ 12 | 13 | static Future fetch() async{ 14 | try { 15 | Response response = await Dio().get(FindingUrl); 16 | 17 | if(response.statusCode == 200){ 18 | return EntityFactory.generateOBJ(response.data); 19 | }else{ 20 | throw Exception("StatusCode: ${response.statusCode}"); 21 | } 22 | } catch (e) { 23 | print(e); 24 | return null; 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /lib/dao/home_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_yjh/models/entity_factory.dart'; 3 | import 'dart:async'; 4 | 5 | import 'package:flutter_yjh/models/store_entity.dart'; 6 | 7 | import 'config.dart'; 8 | 9 | 10 | class HomeDao{ 11 | 12 | static Future fetch() async{ 13 | try { 14 | Response response = await Dio().get(HomeUrl); 15 | 16 | if(response.statusCode == 200){ 17 | return EntityFactory.generateOBJ(response.data); 18 | }else{ 19 | throw Exception("StatusCode: ${response.statusCode}"); 20 | } 21 | } catch (e) { 22 | print(e); 23 | return null; 24 | } 25 | } 26 | 27 | } 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=D:\develop\flutter" 4 | export "FLUTTER_APPLICATION_PATH=J:\Repository\git_code\flutter\flutter_new_retail" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "OTHER_LDFLAGS=$(inherited) -framework Flutter" 9 | export "FLUTTER_FRAMEWORK_DIR=D:\develop\flutter\bin\cache\artifacts\engine\ios" 10 | export "FLUTTER_BUILD_NAME=1.0.1" 11 | export "FLUTTER_BUILD_NUMBER=1" 12 | export "DART_OBFUSCATION=false" 13 | export "TRACK_WIDGET_CREATION=false" 14 | export "TREE_SHAKE_ICONS=false" 15 | export "PACKAGE_CONFIG=.packages" 16 | -------------------------------------------------------------------------------- /lib/page/secondary/new_shop.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | 6 | 7 | /// 8 | /// 新增店铺页 9 | /// 10 | class NewShop extends StatefulWidget { 11 | 12 | @override 13 | _NewShopState createState() => _NewShopState(); 14 | } 15 | 16 | class _NewShopState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "新增店铺", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/page/secondary/my_fans.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | 6 | 7 | /// 8 | /// 我的粉丝页 9 | /// 10 | class MyFansPage extends StatefulWidget { 11 | 12 | @override 13 | _MyFansPageState createState() => _MyFansPageState(); 14 | } 15 | 16 | class _MyFansPageState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "我的粉丝", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/page/secondary/shop_Information.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/utils/app_size.dart'; 4 | import 'package:flutter_yjh/view/app_topbar.dart'; 5 | import 'package:flutter_yjh/view/customize_appbar.dart'; 6 | 7 | /// 8 | /// 店铺信息页 9 | /// 10 | class ShopInfo extends StatefulWidget { 11 | 12 | @override 13 | _ShopInfoState createState() => _ShopInfoState(); 14 | } 15 | 16 | class _ShopInfoState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "店铺信息", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/page/secondary/favorite_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | 6 | 7 | /// 8 | /// 我的收藏页 9 | /// 10 | class FavoritePage extends StatefulWidget { 11 | 12 | @override 13 | _FavoritePageState createState() => _FavoritePageState(); 14 | } 15 | 16 | class _FavoritePageState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "我的收藏", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/page/secondary/points_lottery.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/utils/app_size.dart'; 4 | import 'package:flutter_yjh/view/app_topbar.dart'; 5 | import 'package:flutter_yjh/view/customize_appbar.dart'; 6 | 7 | /// 8 | /// 积分抽奖页 9 | /// 10 | class PointsLottery extends StatefulWidget { 11 | 12 | @override 13 | _PointsLotteryState createState() => _PointsLotteryState(); 14 | } 15 | 16 | class _PointsLotteryState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "积分抽奖", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/page/secondary/shop_reward.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | 6 | 7 | /// 8 | /// 门店奖励页 9 | /// 10 | class ShopRewardPage extends StatefulWidget { 11 | 12 | @override 13 | _ShopRewardPageState createState() => _ShopRewardPageState(); 14 | } 15 | 16 | class _ShopRewardPageState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "门店奖励", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/page/secondary/super_discount.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/utils/app_size.dart'; 4 | import 'package:flutter_yjh/view/app_topbar.dart'; 5 | import 'package:flutter_yjh/view/customize_appbar.dart'; 6 | 7 | 8 | /// 9 | /// 超值特惠页 10 | /// 11 | class SuperDiscount extends StatefulWidget { 12 | 13 | @override 14 | _SuperDiscountState createState() => _SuperDiscountState(); 15 | } 16 | 17 | class _SuperDiscountState extends State { 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: MyAppBar( 22 | height: AppSize.height(160), 23 | child: CommonBackTopBar(title: "超值特惠", 24 | onBack:()=>Navigator.pop(context)) 25 | ), 26 | body: Container() 27 | ); 28 | } 29 | } -------------------------------------------------------------------------------- /lib/page/secondary/card_voucher.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | 6 | 7 | /// 8 | /// 我的卡券页 9 | /// 10 | class CardVoucherPage extends StatefulWidget { 11 | 12 | @override 13 | _CardVoucherPageState createState() => _CardVoucherPageState(); 14 | } 15 | 16 | class _CardVoucherPageState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "我的卡券", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/page/secondary/edit_profile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | 6 | 7 | /// 8 | /// 完善资料页 9 | /// 10 | class EditProfilePage extends StatefulWidget { 11 | 12 | @override 13 | _EditProfilePageState createState() => _EditProfilePageState(); 14 | } 15 | 16 | class _EditProfilePageState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "完善资料", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/page/secondary/income_record.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | 6 | 7 | /// 8 | /// 收益记录页 9 | /// 10 | class IncomeRecordPage extends StatefulWidget { 11 | 12 | @override 13 | _IncomeRecordPageState createState() => _IncomeRecordPageState(); 14 | } 15 | 16 | class _IncomeRecordPageState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: MyAppBar( 21 | height: AppSize.height(160), 22 | child: CommonBackTopBar(title: "收益记录", 23 | onBack:()=>Navigator.pop(context)) 24 | ), 25 | body: Container() 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/utils/constants.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:flutter_yjh/routes/routes.dart'; 5 | 6 | const HEAD_NAV_TEXT = const [ 7 | "积分商城", 8 | "知名品牌", 9 | "附近商圈", 10 | "女性课堂", 11 | "商家直播", 12 | "邀请好友", 13 | "星选好店", 14 | "医学美容" 15 | ]; 16 | 17 | const HEAD_NAV_PATH = const [ 18 | Routes.points_mall, 19 | Routes.famous_brand, 20 | Routes.nearby_business, 21 | Routes.female_channel, 22 | Routes.store_live, 23 | Routes.invite_friends, 24 | Routes.good_shop, 25 | "" 26 | ]; 27 | 28 | 29 | class Screen{ 30 | static double get width { 31 | return ScreenUtil.screenWidthDp; 32 | } 33 | 34 | /// 35 | /// 状态栏高度 36 | /// 37 | static double get statusH{ 38 | return ScreenUtil.statusBarHeight; 39 | } 40 | 41 | } 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /lib/page/secondary/store_live.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/utils/app_size.dart'; 4 | import 'package:flutter_yjh/utils/constants.dart'; 5 | import 'package:flutter_yjh/view/app_topbar.dart'; 6 | import 'package:flutter_yjh/view/customize_appbar.dart'; 7 | 8 | 9 | /// 10 | /// 商家直播页 11 | /// 12 | class StoreLive extends StatefulWidget { 13 | 14 | @override 15 | _StoreLiveState createState() => _StoreLiveState(); 16 | } 17 | 18 | class _StoreLiveState extends State { 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: MyAppBar( 23 | height: AppSize.height(160), 24 | child: CommonBackTopBar(title: "商家直播", 25 | onBack:()=>Navigator.pop(context)) 26 | ), 27 | body: Container() 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart'; 6 | import 'package:flutter_yjh/page/index_page.dart'; 7 | 8 | void main() { 9 | runApp(YjhApp()); 10 | if (Platform.isAndroid) { 11 | SystemChrome.setSystemUIOverlayStyle( 12 | SystemUiOverlayStyle(statusBarColor: Colors.transparent)); 13 | } 14 | 15 | FlutterStatusbarcolor.setStatusBarWhiteForeground(false); 16 | } 17 | 18 | class YjhApp extends StatelessWidget { 19 | @override 20 | Widget build(BuildContext context) { 21 | return Container( 22 | child: MaterialApp( 23 | debugShowCheckedModeBanner: false, 24 | home: IndexPage(), 25 | theme: ThemeData( 26 | primarySwatch: Colors.pink 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/page/secondary/female_channel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/utils/constants.dart'; 4 | import 'package:flutter_yjh/view/app_topbar.dart'; 5 | import 'package:flutter_yjh/view/customize_appbar.dart'; 6 | 7 | 8 | /// 9 | /// 女性课堂页 10 | /// 11 | class FemaleClassroom extends StatefulWidget { 12 | 13 | @override 14 | _FemaleClassroomState createState() => _FemaleClassroomState(); 15 | } 16 | 17 | class _FemaleClassroomState extends State { 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: MyAppBar( 22 | height: AppSize.height(160), 23 | child: CommonBackTopBar(title: "女性课堂", 24 | onBack:()=>Navigator.pop(context)) 25 | ), 26 | body: Container() 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/view/arc_bg.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_yjh/view/theme_ui.dart'; 5 | 6 | class ArcBackground extends CustomPaint{ 7 | ArcBackground(double w,double h):super(painter:new ArcBackgroundView(w,h)); 8 | } 9 | 10 | 11 | 12 | class ArcBackgroundView extends CustomPainter{ 13 | static const PI = 3.1415926; 14 | 15 | final double width; 16 | final double height; 17 | 18 | ArcBackgroundView(this.width,this.height); 19 | 20 | @override 21 | void paint(Canvas canvas, Size size) { 22 | var paint = new Paint() 23 | ..color = ThemeColor.appBarTopBg 24 | ..strokeCap = StrokeCap.round 25 | ..isAntiAlias = true; 26 | 27 | Rect rect = Rect.fromLTWH(0.0,0.0,width,height/2); 28 | canvas.drawRect(rect, paint); 29 | 30 | Rect rect2 = Rect.fromLTWH(-50,0.0,width+100,height); 31 | canvas.drawArc(rect2, 0, PI, true, paint); 32 | } 33 | 34 | @override 35 | bool shouldRepaint(CustomPainter oldDelegate) { 36 | return false; 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /lib/view/flutter_iconfont.dart: -------------------------------------------------------------------------------- 1 | library flutter_iconfont; 2 | 3 | import 'package:flutter/widgets.dart' show IconData; 4 | import 'package:flutter_yjh/view/flutter_icon_data.dart'; 5 | 6 | /// 7 | /// This is an automatically generated code 8 | ///author: arcticfox1919 9 | ///github: https://github.com/arcticfox1919/flutter_iconfont 10 | /// 11 | class IconFonts{ 12 | IconFonts._(); 13 | 14 | static const IconData triangle_down = const IconDataEx(0xe6b4); 15 | static const IconData eye = const IconDataEx(0xe616); 16 | static const IconData scan_code = const IconDataEx(0xe640); 17 | static const IconData triangle_right = const IconDataEx(0xe615); 18 | static const IconData arrow_down = const IconDataEx(0xe62a); 19 | static const IconData arrow_left = const IconDataEx(0xe62c); 20 | static const IconData shopping_cart = const IconDataEx(0xe614); 21 | static const IconData ellipsis = const IconDataEx(0xe727); 22 | static const IconData location = const IconDataEx(0xe612); 23 | static const IconData arrow_right = const IconDataEx(0xe620); 24 | static const IconData eye_close = const IconDataEx(0xe50e); 25 | } 26 | -------------------------------------------------------------------------------- /lib/view/customize_appbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/constants.dart'; 3 | 4 | /// 5 | /// 自定义AppBar 6 | /// 7 | class MyAppBar extends StatelessWidget implements PreferredSizeWidget { 8 | final Widget child; 9 | 10 | @override 11 | final Size preferredSize; 12 | 13 | MyAppBar({ 14 | Key key, 15 | @required this.child, 16 | @required double height, 17 | }) : preferredSize = Size.fromHeight(height), 18 | super(key: key); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | double _statusHeight = Screen.statusH; 23 | 24 | return Container( 25 | padding: EdgeInsets.only(left: 6, right: 6,top: _statusHeight), 26 | decoration: BoxDecoration( 27 | gradient: LinearGradient( 28 | colors: [Color(0xFFEA3D87), Color(0xFFFF7095)], 29 | begin: Alignment.topCenter, 30 | end: Alignment.bottomCenter), 31 | ), 32 | height: preferredSize.height+_statusHeight, 33 | // color: Theme.of(context).primaryColor, 34 | child: this.child, 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/view/my_icons.dart.dart: -------------------------------------------------------------------------------- 1 | /// Flutter icons MyFlutterApp 2 | /// Copyright (C) 2019 by original authors @ fluttericon.com, fontello.com 3 | /// This font was generated by FlutterIcon.com, which is derived from Fontello. 4 | /// 5 | /// To use this font, place it in your fonts/ directory and include the 6 | /// following in your pubspec.yaml 7 | /// 8 | /// flutter: 9 | /// fonts: 10 | /// - family: MyFlutterApp 11 | /// fonts: 12 | /// - asset: fonts/MyFlutterApp.ttf 13 | /// 14 | /// 15 | /// 16 | import 'package:flutter/widgets.dart'; 17 | 18 | class MyIcons { 19 | MyIcons._(); 20 | 21 | static const _kFontFam = 'MyIcons'; 22 | 23 | static const IconData orderForm = const IconData(0xe800, fontFamily: _kFontFam); 24 | static const IconData findings = const IconData(0xe801, fontFamily: _kFontFam); 25 | static const IconData home = const IconData(0xe802, fontFamily: _kFontFam); 26 | static const IconData personal = const IconData(0xe803, fontFamily: _kFontFam); 27 | static const IconData location = const IconData(0xe615, fontFamily: 'MyIcons2'); 28 | static const IconData placeholder = const IconData(0xe627, fontFamily: 'MyIcons2'); 29 | } 30 | -------------------------------------------------------------------------------- /lib/models/goods_entity.dart: -------------------------------------------------------------------------------- 1 | class GoodsEntity { 2 | List goods; 3 | 4 | GoodsEntity({this.goods}); 5 | 6 | GoodsEntity.fromJson(Map json) { 7 | if (json['goods'] != null) { 8 | goods = new List();(json['goods'] as List).forEach((v) { goods.add(new GoodsModel.fromJson(v)); }); 9 | } 10 | } 11 | 12 | Map toJson() { 13 | final Map data = new Map(); 14 | if (this.goods != null) { 15 | data['goods'] = this.goods.map((v) => v.toJson()).toList(); 16 | } 17 | return data; 18 | } 19 | } 20 | 21 | class GoodsModel { 22 | String price; 23 | String name; 24 | String photo; 25 | int id; 26 | 27 | GoodsModel({this.price, this.name, this.photo, this.id}); 28 | 29 | GoodsModel.fromJson(Map json) { 30 | price = json['price']; 31 | name = json['name']; 32 | photo = json['photo']; 33 | id = json['id']; 34 | } 35 | 36 | Map toJson() { 37 | final Map data = new Map(); 38 | data['price'] = this.price; 39 | data['name'] = this.name; 40 | data['photo'] = this.photo; 41 | data['id'] = this.id; 42 | return data; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/dao/order_form_dao.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter_yjh/models/order_form_entity.dart'; 3 | 4 | class OrderFormDao{ 5 | 6 | static Future fetch() async{ 7 | Future result = Future((){ 8 | var itemList = List.generate(12, (i){ 9 | OrderFormListItem item = AllItem()..id = i; 10 | switch(i % 4){ 11 | case 0: 12 | item..status='等待支付' 13 | ..type = OrderForm.payment; 14 | break; 15 | case 1: 16 | item..status='订单已支付' 17 | ..type = OrderForm.pending; 18 | break; 19 | case 2: 20 | item..status='订单已完成' 21 | ..type = OrderForm.comment; 22 | break; 23 | case 3: 24 | item..status='订单已评价' 25 | ..type = OrderForm.afterSale; 26 | break; 27 | } 28 | return item..storeName="香奈儿品牌店" 29 | ..imgUrl='images/order_form.png' 30 | ..title='香水女士持久淡香学生清新香水女士持久淡香学生清新香水女士持久淡香学生清新' 31 | ..price=19.90 32 | ..amount=2 33 | ..weight='200g' 34 | ..total=39.80; 35 | }); 36 | return OrderFormEntity(itemList); 37 | }); 38 | return result; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /lib/models/order_form_entity.dart: -------------------------------------------------------------------------------- 1 | class OrderFormEntity { 2 | List items; 3 | 4 | OrderFormEntity(this.items); 5 | 6 | } 7 | 8 | enum OrderForm{ 9 | payment, 10 | pending, 11 | comment, 12 | afterSale 13 | } 14 | 15 | abstract class OrderFormListItem { 16 | int id; 17 | String storeName; 18 | String imgUrl; 19 | String status; 20 | String title; 21 | double price; 22 | int amount; 23 | String weight; 24 | double total; 25 | OrderForm type; 26 | 27 | emptyInstance(); 28 | } 29 | 30 | // 全部 31 | class AllItem extends OrderFormListItem { 32 | static final _instance = AllItem() 33 | ..id = -1 34 | ..storeName='' 35 | ..imgUrl='' 36 | ..status='' 37 | ..title='' 38 | ..price=0.0 39 | ..amount=0 40 | ..weight='' 41 | ..total=0.0 42 | ..type=OrderForm.payment; 43 | 44 | 45 | @override 46 | emptyInstance() { 47 | return _instance; 48 | } 49 | } 50 | 51 | //// 待付款 52 | //class PaymentItem extends OrderFormListItem {} 53 | // 54 | //// 待完成 55 | //class PendingItem extends OrderFormListItem {} 56 | // 57 | //// 待评价 58 | //class CommentItem extends OrderFormListItem {} 59 | // 60 | //// 售后 61 | //class AfterSaleItem extends OrderFormListItem {} 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - flutter_statusbarcolor (0.0.1): 4 | - Flutter 5 | - FMDB (2.7.5): 6 | - FMDB/standard (= 2.7.5) 7 | - FMDB/standard (2.7.5) 8 | - path_provider (0.0.1): 9 | - Flutter 10 | - sqflite (0.0.1): 11 | - Flutter 12 | - FMDB (~> 2.7.2) 13 | 14 | DEPENDENCIES: 15 | - Flutter (from `.symlinks/flutter/ios`) 16 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) 17 | - path_provider (from `.symlinks/plugins/path_provider/ios`) 18 | - sqflite (from `.symlinks/plugins/sqflite/ios`) 19 | 20 | SPEC REPOS: 21 | https://github.com/cocoapods/specs.git: 22 | - FMDB 23 | 24 | EXTERNAL SOURCES: 25 | Flutter: 26 | :path: ".symlinks/flutter/ios" 27 | flutter_statusbarcolor: 28 | :path: ".symlinks/plugins/flutter_statusbarcolor/ios" 29 | path_provider: 30 | :path: ".symlinks/plugins/path_provider/ios" 31 | sqflite: 32 | :path: ".symlinks/plugins/sqflite/ios" 33 | 34 | SPEC CHECKSUMS: 35 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 36 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 37 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 38 | path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 39 | sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a 40 | 41 | PODFILE CHECKSUM: aff02bfeed411c636180d6812254b2daeea14d09 42 | 43 | COCOAPODS: 1.6.1 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_yjh 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 12 | 15 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_statusbarcolor","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_statusbarcolor-0.2.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.11\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]}],"android":[{"name":"flutter_statusbarcolor","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_statusbarcolor-0.2.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.11\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-0.0.4+3\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\develop\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-0.0.1+1\\\\","dependencies":[]}],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_statusbarcolor","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2021-03-02 21:54:57.372059","version":"1.22.0"} -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.flutter_yjh" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | -------------------------------------------------------------------------------- /lib/page/secondary/invite_friends.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/utils/app_size.dart'; 4 | import 'package:flutter_yjh/view/app_topbar.dart'; 5 | import 'package:flutter_yjh/view/customize_appbar.dart'; 6 | import 'package:flutter_yjh/view/theme_ui.dart'; 7 | 8 | 9 | /// 10 | /// 邀请好友页 11 | /// 12 | class InviteFriends extends StatelessWidget { 13 | 14 | final btnStyle = TextStyle(fontSize: AppSize.sp(43),color:Colors.white); 15 | 16 | void onAction(String content){ 17 | print(content); 18 | } 19 | 20 | _buildBtn(String text, List colors){ 21 | return InkWell( 22 | onTap: ()=>onAction(text), 23 | child: Container( 24 | padding: EdgeInsets.symmetric(vertical: 2,horizontal: 15), 25 | decoration: BoxDecoration( 26 | borderRadius: BorderRadius.circular(20), 27 | gradient: LinearGradient(colors: colors) 28 | ), 29 | child: Text(text,style: btnStyle), 30 | ), 31 | ); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return Scaffold( 37 | appBar: MyAppBar( 38 | height: AppSize.height(160), 39 | child: CommonBackTopBar(title: "邀请好友", 40 | onBack:()=>Navigator.pop(context)) 41 | ), 42 | body: Container( 43 | color: Colors.white, 44 | child: Column( 45 | children: [ 46 | Expanded(child: Image.asset("images/poster_content.png",fit: BoxFit.fill)), 47 | ThemeView.divider(), 48 | SizedBox( 49 | height: AppSize.height(150), 50 | child: Row( 51 | crossAxisAlignment: CrossAxisAlignment.center, 52 | mainAxisAlignment: MainAxisAlignment.spaceAround, 53 | children: [ 54 | _buildBtn("分享邀请链接",[Color(0xFFF98315),Color(0xFFF6C53C)]), 55 | _buildBtn("分享邀请海报",[Color(0xFFEA3D87),Color(0xFFFF7095)]), 56 | ]) 57 | ) 58 | ], 59 | ), 60 | ) 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/models/store_entity.dart: -------------------------------------------------------------------------------- 1 | import 'home_entity.dart'; 2 | 3 | class StoreEntity { 4 | List stores; 5 | 6 | StoreEntity({this.stores}); 7 | 8 | StoreEntity.fromJson(Map json) { 9 | if (json['store'] != null) { 10 | stores = new List();(json['store'] as List).forEach((v) { stores.add(new StoreModel.fromJson(v)); }); 11 | } 12 | } 13 | 14 | Map toJson() { 15 | final Map data = new Map(); 16 | if (this.stores != null) { 17 | data['store'] = this.stores.map((v) => v.toJson()).toList(); 18 | } 19 | return data; 20 | } 21 | } 22 | 23 | class StoreModel with HomeListItem{ 24 | String name; 25 | String photo; 26 | int id; 27 | List products; 28 | 29 | StoreModel({this.name, this.photo, this.id, this.products}); 30 | 31 | StoreModel.fromJson(Map json) { 32 | name = json['name']; 33 | photo = json['photo']; 34 | id = json['id']; 35 | if (json['products'] != null) { 36 | products = new List();(json['products'] as List).forEach((v) { products.add(new StoreProduct.fromJson(v)); }); 37 | } 38 | } 39 | 40 | Map toJson() { 41 | final Map data = new Map(); 42 | data['name'] = this.name; 43 | data['photo'] = this.photo; 44 | data['id'] = this.id; 45 | if (this.products != null) { 46 | data['products'] = this.products.map((v) => v.toJson()).toList(); 47 | } 48 | return data; 49 | } 50 | } 51 | 52 | class StoreProduct { 53 | int storeId; 54 | String img; 55 | String price; 56 | String name; 57 | int id; 58 | 59 | StoreProduct({this.storeId, this.img, this.price, this.name, this.id}); 60 | 61 | StoreProduct.fromJson(Map json) { 62 | storeId = json['store_id']; 63 | img = json['img']; 64 | price = json['price']; 65 | name = json['name']; 66 | id = json['id']; 67 | } 68 | 69 | Map toJson() { 70 | final Map data = new Map(); 71 | data['store_id'] = this.storeId; 72 | data['img'] = this.img; 73 | data['price'] = this.price; 74 | data['name'] = this.name; 75 | data['id'] = this.id; 76 | return data; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/page/index_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/page/findings_page.dart'; 4 | import 'package:flutter_yjh/page/home_page.dart'; 5 | import 'package:flutter_yjh/page/orderform_page.dart'; 6 | import 'package:flutter_yjh/page/personal_page.dart'; 7 | import 'package:flutter_yjh/utils/app_size.dart'; 8 | import 'package:flutter_yjh/view/my_icons.dart.dart'; 9 | 10 | class IndexPage extends StatefulWidget { 11 | @override 12 | _IndexPageState createState() => _IndexPageState(); 13 | } 14 | 15 | final List bottomBar = [ 16 | BottomNavigationBarItem(icon: Icon(MyIcons.home,size: AppSize.width(55)), title: Text("首页")), 17 | BottomNavigationBarItem(icon: Icon(MyIcons.findings,size: AppSize.width(55)), title: Text("发现")), 18 | BottomNavigationBarItem(icon: Icon(MyIcons.orderForm,size: AppSize.width(55)), title: Text("订单")), 19 | BottomNavigationBarItem(icon: Icon(MyIcons.personal,size: AppSize.width(55)), title: Text("我的")) 20 | ]; 21 | 22 | final List pages = [ 23 | HomePage(), 24 | FindingsPage(), 25 | OrderFormPage(), 26 | PersonalPage() 27 | ]; 28 | 29 | class _IndexPageState extends State with AutomaticKeepAliveClientMixin{ 30 | int currentIndex = 0; 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | print("--*-- _IndexPageState"); 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | super.build(context); 41 | // 初始化屏幕适配包 42 | AppSize.init(context); 43 | return Scaffold( 44 | bottomNavigationBar: BottomNavigationBar( 45 | type: BottomNavigationBarType.fixed, 46 | currentIndex: this.currentIndex, 47 | onTap: (index) { 48 | setState(() { 49 | this.currentIndex = index; 50 | pageController.jumpToPage(index); 51 | }); 52 | }, 53 | items: bottomBar), 54 | body: _getPageBody(context), 55 | ); 56 | } 57 | 58 | 59 | final pageController = PageController(); 60 | 61 | _getPageBody(BuildContext context){ 62 | return PageView( 63 | controller: pageController, 64 | children: pages, 65 | physics: NeverScrollableScrollPhysics(), // 禁止滑动 66 | ); 67 | } 68 | 69 | @override 70 | // TODO: implement wantKeepAlive 71 | bool get wantKeepAlive => true; 72 | } 73 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 37 | # referring to absolute paths on developers' machines. 38 | system('rm -rf .symlinks') 39 | system('mkdir -p .symlinks/plugins') 40 | 41 | # Flutter Pods 42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 43 | if generated_xcode_build_settings.empty? 44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 45 | end 46 | generated_xcode_build_settings.map { |p| 47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 48 | symlink = File.join('.symlinks', 'flutter') 49 | File.symlink(File.dirname(p[:path]), symlink) 50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 51 | end 52 | } 53 | 54 | # Plugin Pods 55 | plugin_pods = parse_KV_file('../.flutter-plugins') 56 | plugin_pods.map { |p| 57 | symlink = File.join('.symlinks', 'plugins', p[:name]) 58 | File.symlink(p[:path], symlink) 59 | pod p[:name], :path => File.join(symlink, 'ios') 60 | } 61 | end 62 | 63 | post_install do |installer| 64 | installer.pods_project.targets.each do |target| 65 | target.build_configurations.each do |config| 66 | config.build_settings['ENABLE_BITCODE'] = 'NO' 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [![Gitter](https://badges.gitter.im/bczl-flutter/community.svg)](https://gitter.im/bczl-flutter/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 4 | 5 | # 更新 6 | 7 | 已升级到支持空安全版本 ,可切换到仓库的 **null_safety** 分支 8 | 9 | # flutter_new_retail 10 | 11 | ## 前言 12 | 使用Flutter开发跨平台UI界面,快速高效,可谓神器。网上关于Flutter入门博客已不少了,但编写的一些Demo界面过于简单,尤其是布局,与实际项目相去较远,这里将我自己学习过程中编写的界面整理后分享给大家,主要是UI界面的搭建,不包括太多业务逻辑,希望对大家学习Flutter UI编写起到一定帮助作用。 13 | 14 | 项目地址:[点击我跳转](https://github.com/arcticfox1919/flutter_new_retail) 如果大家觉得有用,请打个星星支持 15 | 16 | > 将代码clone到本地,更新依赖即可运行 17 | 18 | 19 | 20 | 由于免费的服务器已到期,运行app获取不到测试数据。这里打包了一个本地 [api测试服务器](https://github.com/arcticfox1919/flutter_new_retail/releases),下载相应的版本运行,并确保模拟器或真机与服务器处于同一内网中 21 | 22 | 修改`/lib/dao/config.dart`文件,`const ServerHost = 'http://localhost:8081';`中需要将localhost替换为测试服务器在局域网中的IP地址。 23 | 24 | 25 | **以下展示几个主要界面** 26 | ## 四个主页 27 | ![主页](https://picturehost.oss-cn-shenzhen.aliyuncs.com/home_gif.gif) 28 | 29 | ![home1](https://picturehost.oss-cn-shenzhen.aliyuncs.com/home1.png) 30 | 31 | ![home2](https://picturehost.oss-cn-shenzhen.aliyuncs.com/home2.png) 32 | 33 | ![home3](https://picturehost.oss-cn-shenzhen.aliyuncs.com/home3.png) 34 | 35 | ![home4](https://picturehost.oss-cn-shenzhen.aliyuncs.com/home4.png) 36 | 37 | ## 仿淘宝详情页 38 | ![](https://picturehost.oss-cn-shenzhen.aliyuncs.com/details_gif.gif) 39 | 40 | ## 店铺 41 | ![](https://img-blog.csdnimg.cn/20190801203300152.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9hcmN0aWNmb3guYmxvZy5jc2RuLm5ldA==,size_16,color_FFFFFF,t_70) 42 | 43 | ![](https://img-blog.csdnimg.cn/20190801203329977.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9hcmN0aWNmb3guYmxvZy5jc2RuLm5ldA==,size_16,color_FFFFFF,t_70) 44 | ## 登录 45 | ![](https://img-blog.csdnimg.cn/20190801203356367.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9hcmN0aWNmb3guYmxvZy5jc2RuLm5ldA==,size_16,color_FFFFFF,t_70) 46 | 47 | ![](https://img-blog.csdnimg.cn/2019080120341019.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9hcmN0aWNmb3guYmxvZy5jc2RuLm5ldA==,size_16,color_FFFFFF,t_70) 48 | 49 | 50 | # 视频课程 51 | 如需要获取博主完整的**Flutter全栈式开发课程**,请 [**点击跳转**](http://m.study.163.com/provider/480000001855430/index.htm?share=2&shareId=480000001855430) 52 | 53 | ![qr_adv](https://img-blog.csdnimg.cn/img_convert/eb3c16913c155e08e1443a0029003aa1.png) 54 | 55 | **本项目内容包含在第二季课程《Flutter全栈式开发指南》** 56 | 57 | # 关注公众号:编程之路从0到1 58 | ![编程之路从0到1](https://img-blog.csdnimg.cn/20190301102949549.jpg) 59 | -------------------------------------------------------------------------------- /lib/page/secondary/follow_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/dao/home_dao.dart'; 4 | import 'package:flutter_yjh/models/store_entity.dart'; 5 | import 'package:flutter_yjh/utils/app_size.dart'; 6 | import 'package:flutter_yjh/view/app_topbar.dart'; 7 | import 'package:flutter_yjh/view/customize_appbar.dart'; 8 | import 'package:flutter_yjh/view/theme_ui.dart'; 9 | 10 | 11 | /// 12 | /// 我的关注页 13 | /// 14 | class FollowPage extends StatefulWidget { 15 | 16 | @override 17 | _FollowPageState createState() => _FollowPageState(); 18 | } 19 | 20 | class _FollowPageState extends State { 21 | List storeList = new List(); 22 | bool _isLoading = false; 23 | 24 | @override 25 | void initState() { 26 | _isLoading = true; 27 | loadData(); 28 | super.initState(); 29 | } 30 | 31 | void loadData() async{ 32 | StoreEntity stores = await HomeDao.fetch(); 33 | if(stores?.stores != null){ 34 | setState(() { 35 | storeList = stores.stores; 36 | _isLoading = false; 37 | }); 38 | } 39 | } 40 | 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | return Scaffold( 45 | appBar: MyAppBar( 46 | height: AppSize.height(160), 47 | child: CommonBackTopBar(title: "我的关注", 48 | onBack:()=>Navigator.pop(context)) 49 | ), 50 | body: _getContent() 51 | ); 52 | } 53 | 54 | _getContent() { 55 | if (_isLoading) { 56 | return Center( 57 | child: Center(child: CircularProgressIndicator()), 58 | ); 59 | } else { 60 | return Container( 61 | padding: EdgeInsets.only(top: AppSize.height(30)), 62 | color: Colors.white, 63 | child: ListView.builder( 64 | itemCount: storeList.length, 65 | itemBuilder: (context,i){ 66 | return Dismissible( 67 | key: Key(storeList[i].photo), 68 | child: Column( 69 | children: [ 70 | ListTile( 71 | leading: ClipOval( 72 | child:CachedNetworkImage(imageUrl: storeList[i].photo) 73 | ), 74 | title: Text(storeList[i].name,style: ThemeTextStyle.primaryStyle,), 75 | ), 76 | Padding( 77 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 78 | child: ThemeView.divider(), 79 | ) 80 | ], 81 | ) 82 | ); 83 | }) 84 | ); 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/view/theme_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | /// 4 | /// 封装app整体主题风格控件 5 | /// 6 | class ThemeView{ 7 | 8 | 9 | static Widget divider({Orient orient = Orient.horizontal}){ 10 | if (orient == Orient.horizontal){ 11 | return Divider(height: 0.0,color: Color(0xFFDEDEDE)); 12 | }else{ 13 | return VerticalDivider(width: 0.0,color: Color(0xFFDEDEDE)); 14 | } 15 | } 16 | 17 | 18 | } 19 | 20 | enum Orient{ 21 | horizontal, 22 | vertical 23 | } 24 | 25 | class ThemeStyle{ 26 | } 27 | 28 | class ThemeColor{ 29 | static const Color appBg = const Color(0xfff5f6f7); 30 | static const Color appBarTopBg = const Color(0xFFEA3D87); 31 | static const Color appBarBottomBg = const Color(0xFFFF7095); 32 | static const Color hintTextColor = const Color(0xff333333); 33 | static const Color subTextColor = const Color(0xff999999); 34 | static const Color starColor = const Color(0xFFFFA516); 35 | } 36 | 37 | class ThemeTextStyle{ 38 | static final primaryStyle = TextStyle(fontSize: AppSize.sp(44),color: Color(0xff333333)); 39 | static final primaryStyle2 = TextStyle(fontSize: AppSize.sp(44),color: Color(0xff656565)); 40 | static final menuStyle = TextStyle(fontSize: AppSize.sp(36),color: Color(0xff666666)); 41 | static final menuStyle2 = TextStyle(fontSize: AppSize.sp(36),color: Color(0xff656565)); 42 | static final menuStyle3 = TextStyle(fontSize: AppSize.sp(36),color: Color(0xff333333)); 43 | static final priceStyle = TextStyle(fontSize: AppSize.sp(32),color: Color(0xffee4646)); 44 | 45 | 46 | static final cardTitleStyle = TextStyle(fontSize: AppSize.sp(40),color: Color(0xff333333)); 47 | static final cardPriceStyle = TextStyle(fontSize: AppSize.sp(35),color: Color(0xffee4646)); 48 | static final cardNumStyle = TextStyle(fontSize: AppSize.sp(32),color: Color(0xff999999)); 49 | 50 | 51 | static final orderFormStatusStyle = TextStyle(fontSize: AppSize.sp(38),color: Color(0xff999999)); 52 | static final orderFormTitleStyle = TextStyle(fontSize: AppSize.sp(38),color: Color(0xff333333)); 53 | static final orderFormBtnStyle = TextStyle(fontSize: AppSize.sp(44),color: ThemeColor.appBarTopBg); 54 | static final orderCancelBtnStyle = TextStyle(fontSize: AppSize.sp(44),color: Color(0xff999999)); 55 | static final orderContentStyle = TextStyle(fontSize: AppSize.sp(36),color: Color(0xff999999)); 56 | 57 | 58 | static final personalShopNameStyle = TextStyle(fontSize: AppSize.sp(52),color: Color(0xff333333)); 59 | 60 | static final personalNumStyle = TextStyle( 61 | fontSize: AppSize.sp(44), 62 | color: ThemeColor.appBarTopBg, 63 | fontWeight: FontWeight.w700); 64 | 65 | static final primaryBoldStyle = TextStyle( 66 | fontSize: AppSize.sp(44), 67 | color: Color(0xff333333), 68 | fontWeight: FontWeight.w700); 69 | 70 | 71 | } 72 | 73 | class ThemeDecoration{ 74 | static final card = BoxDecoration( 75 | color: Colors.white, 76 | borderRadius: BorderRadius.circular(6) 77 | ); 78 | 79 | static final card2 = BoxDecoration( 80 | color: Colors.white, 81 | borderRadius: BorderRadius.circular(8) 82 | ); 83 | 84 | static final outlineBtn = BoxDecoration( 85 | border: Border.all(color: ThemeColor.appBarTopBg), 86 | borderRadius:BorderRadius.circular(20), 87 | ); 88 | 89 | static final outlineCancelBtn = BoxDecoration( 90 | border: Border.all(color: Color(0xffcccccc)), 91 | borderRadius:BorderRadius.circular(20), 92 | ); 93 | } 94 | 95 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /lib/page/secondary/my_scores.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/view/app_topbar.dart'; 4 | import 'package:flutter_yjh/view/customize_appbar.dart'; 5 | import 'package:flutter_yjh/view/theme_ui.dart'; 6 | 7 | 8 | /// 9 | /// 我的积分页 10 | /// 11 | class MyScoresPage extends StatefulWidget { 12 | 13 | @override 14 | _MyScoresPageState createState() => _MyScoresPageState(); 15 | } 16 | 17 | class _MyScoresPageState extends State { 18 | 19 | List scoresList; 20 | 21 | 22 | @override 23 | void initState() { 24 | scoresList = new List(); 25 | scoresList.add(ScoresEntity() 26 | ..title='兑换商品' 27 | ..date='2019-05-01 15:23:26' 28 | ..value='-2000'..color=Color(0xff333333)); 29 | 30 | scoresList.add(ScoresEntity() 31 | ..title='幸运抽奖抵扣' 32 | ..date='2019-05-01 15:23:26' 33 | ..value='-500'..color=Color(0xff333333)); 34 | 35 | scoresList.add(ScoresEntity() 36 | ..title='购物积分' 37 | ..date='2019-05-01 15:23:26' 38 | ..value='+288'..color=ThemeColor.appBarTopBg); 39 | 40 | scoresList.add(ScoresEntity() 41 | ..title='签到积分' 42 | ..date='2019-05-01 15:23:26' 43 | ..value='+50'..color=ThemeColor.appBarTopBg); 44 | 45 | super.initState(); 46 | } 47 | 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return Scaffold( 52 | appBar: MyAppBar( 53 | height: AppSize.height(160), 54 | child: CommonBackTopBar(title: "我的积分", 55 | onBack:()=>Navigator.pop(context)) 56 | ), 57 | body: Container( 58 | color: ThemeColor.appBg, 59 | child: Column( 60 | children: [ 61 | Container( 62 | margin: EdgeInsets.only(bottom: AppSize.height(30)), 63 | color: Colors.white, 64 | padding: EdgeInsets.symmetric(horizontal: AppSize.width(30),vertical:AppSize.height(60)), 65 | child: Row( 66 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 67 | children: [ 68 | Text('剩余积分',style: ThemeTextStyle.primaryStyle), 69 | Text('26340', style: TextStyle(fontSize: AppSize.sp(60),color: Color(0xfff14141))) 70 | ], 71 | ), 72 | ), 73 | Expanded( 74 | child: ListView.builder( 75 | physics:ClampingScrollPhysics(), 76 | itemCount: scoresList.length, 77 | itemBuilder: (context, i){ 78 | return Container( 79 | color: Colors.white, 80 | child: Column( 81 | children: [ 82 | ListTile( 83 | title: Text(scoresList[i].title,style: ThemeTextStyle.cardTitleStyle), 84 | subtitle: Text(scoresList[i].date,style: ThemeTextStyle.orderContentStyle), 85 | trailing: Text(scoresList[i].value, 86 | style: TextStyle(fontSize: AppSize.sp(52),color: scoresList[i].color)), 87 | ), 88 | ThemeView.divider() 89 | ], 90 | ), 91 | ); 92 | }), 93 | ) 94 | ], 95 | ), 96 | ) 97 | ); 98 | } 99 | } 100 | 101 | class ScoresEntity{ 102 | String title; 103 | String date; 104 | String value; 105 | Color color; 106 | } -------------------------------------------------------------------------------- /lib/view/ratingbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | ///评分数值变化回调 4 | typedef void RatingChangeCallback(double rating); 5 | 6 | 7 | ///创建一个StarRatingBar Widget 8 | class StarRatingBarWidget extends StatefulWidget { 9 | final double rating; 10 | final int starCount; 11 | final double starSize; 12 | final Color color; 13 | final RatingChangeCallback onRatingCallback; 14 | 15 | StarRatingBarWidget( 16 | {Key key, 17 | this.onRatingCallback, 18 | this.rating = 0.0, 19 | this.starCount, 20 | this.starSize, 21 | this.color}); 22 | 23 | @override 24 | StarRatingBarState createState() { 25 | return StarRatingBarState( 26 | onRatingCallback: this.onRatingCallback, 27 | rating: this.rating, 28 | starCount: this.starCount, 29 | starSize: this.starSize, 30 | color: this.color); 31 | } 32 | } 33 | 34 | ///创建一个 StarRatingBar State 35 | class StarRatingBarState extends State { 36 | double rating; 37 | final int starCount; 38 | final double starSize; 39 | final Color color; 40 | final RatingChangeCallback onRatingCallback; 41 | 42 | StarRatingBarState( 43 | {this.onRatingCallback, 44 | this.rating, 45 | this.starCount, 46 | this.starSize, 47 | this.color}); 48 | 49 | ///通过滑动的距离来计算出当前评分数值 50 | double getRatingValue(double dragDx) { 51 | if (dragDx <= 0) return 0.0; 52 | //评分控件宽度 53 | double totalWidth = starSize * starCount + 4; 54 | //单个星星占据的空间距离 55 | double singleDistance = totalWidth / starCount + 2; 56 | for (int i = 1; i <= starCount; i++) { 57 | if (dragDx < singleDistance * i) { 58 | if (dragDx < singleDistance * (i * 2 - 1) / 2) { 59 | return (i * 2 - 1) / 2; 60 | } 61 | return i * 1.0; 62 | } 63 | } 64 | return starCount * 1.0; 65 | } 66 | 67 | @override 68 | Widget build(BuildContext context) { 69 | void postInvalidateRatingValue(double rating) { 70 | this.onRatingCallback(rating); 71 | setState(() { 72 | this.rating = rating; 73 | }); 74 | } 75 | 76 | return new GestureDetector( 77 | //水平拖拽位置更新,注意:onRatingCallback此处做非空判断,如果为空,则不处理水平滑动手势 78 | onHorizontalDragUpdate: onRatingCallback == null? null : (DragUpdateDetails details) { 79 | RenderBox getBox = context.findRenderObject(); 80 | //details.globalPosition更新时显示的全局位置Offset 81 | //globalToLocal将全局坐标转换为当前盒子内部的坐标 82 | double dragDx = getBox.globalToLocal(details.globalPosition).dx; 83 | print("当前控件内部滑动距离:$dragDx"); 84 | postInvalidateRatingValue(getRatingValue(dragDx)); 85 | }, 86 | child: new StarRating( 87 | rating: this.rating, 88 | starCount: this.starCount, 89 | starSize: this.starSize, 90 | color: this.color, 91 | //注意:此处也做onRatingCallback非空判断,如果为空不做点击操作响应 92 | onRatingChanged: onRatingCallback == null ? null: (rating) => postInvalidateRatingValue(rating), 93 | ), 94 | ); 95 | } 96 | } 97 | 98 | ///构建星星列表 99 | class StarRating extends StatelessWidget { 100 | final int starCount; 101 | final double rating; 102 | final double starSize; 103 | final Color color; 104 | final RatingChangeCallback onRatingChanged; 105 | 106 | StarRating( 107 | {@required this.starCount, 108 | @required this.starSize, 109 | this.rating, 110 | this.onRatingChanged, 111 | this.color}); 112 | 113 | Widget buildStar(BuildContext context, int index) { 114 | Icon icon; 115 | if (index >= rating) { 116 | icon = new Icon( 117 | Icons.star_border, 118 | color: Theme.of(context).buttonColor, 119 | size: starSize, 120 | ); 121 | } else if (index > rating - 1 && index < rating) { 122 | icon = new Icon( 123 | Icons.star_half, 124 | color: color ?? Theme.of(context).primaryColor, 125 | size: starSize, 126 | ); 127 | } else { 128 | icon = new Icon( 129 | Icons.star, 130 | color: color ?? Theme.of(context).primaryColor, 131 | size: starSize, 132 | ); 133 | } 134 | ///如果你对水波纹有迷之热爱,你可以用InkResponse/InkWell/IconButton等包装即可 135 | return new GestureDetector( 136 | onTap: 137 | onRatingChanged == null ? null : () => onRatingChanged(index + 1.0), 138 | child: icon, 139 | ); 140 | } 141 | 142 | @override 143 | Widget build(BuildContext context) { 144 | //生成水平展示的星星列表 145 | return new Row( 146 | children: 147 | new List.generate(starCount, (index) => buildStar(context, index))); 148 | } 149 | } -------------------------------------------------------------------------------- /lib/view/app_topbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter_yjh/utils/app_size.dart'; 4 | 5 | import 'flutter_iconfont.dart'; 6 | 7 | class HomeTopBar extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return Row( 11 | mainAxisAlignment: MainAxisAlignment.center, 12 | children: [ 13 | SizedBox( 14 | width: 48, 15 | child: Column(mainAxisSize: MainAxisSize.min, 16 | mainAxisAlignment: MainAxisAlignment.center, 17 | children: [ 18 | Icon( 19 | IconFonts.scan_code, 20 | color: Colors.white, 21 | size: AppSize.width(48), 22 | ), 23 | Text("扫一扫", style: TextStyle(fontSize: AppSize.sp(28), color: Colors.white)) 24 | ]), 25 | ), 26 | Expanded( 27 | child: Container( 28 | height: AppSize.height(72), 29 | decoration: BoxDecoration( 30 | color: Colors.white, borderRadius: BorderRadius.circular(20.0)), 31 | child: Center( 32 | child: Row( 33 | mainAxisSize: MainAxisSize.min, 34 | children: [ 35 | Icon( 36 | CupertinoIcons.search, 37 | color: Color(0xff999999), 38 | size: AppSize.width(40), 39 | ), 40 | Text("请输入商品名称", 41 | style: TextStyle(fontSize:AppSize.sp(35), color: Color(0xff999999))) 42 | ], 43 | )), 44 | )), 45 | SizedBox( 46 | width: 48, 47 | child: Column( 48 | mainAxisAlignment: MainAxisAlignment.center, 49 | mainAxisSize: MainAxisSize.min, 50 | children: [ 51 | Icon(IconFonts.location, color: Colors.white, size: AppSize.width(56)), 52 | Text("黑龙江", style: TextStyle(fontSize: AppSize.sp(28), color: Colors.white)) 53 | ], 54 | ), 55 | ) 56 | ], 57 | ); 58 | } 59 | } 60 | 61 | class CommonTopBar extends StatelessWidget { 62 | final String title; 63 | 64 | CommonTopBar({ 65 | @required this.title 66 | }); 67 | 68 | @override 69 | Widget build(BuildContext context) { 70 | return Center(child: 71 | Text(title,style: TextStyle(color: Colors.white,fontSize: AppSize.sp(52)))); 72 | } 73 | } 74 | 75 | class CommonBackTopBar extends StatelessWidget { 76 | final String title; 77 | final Function onBack; 78 | 79 | CommonBackTopBar({ 80 | @required this.title, 81 | this.onBack 82 | }); 83 | 84 | @override 85 | Widget build(BuildContext context) { 86 | return Stack( 87 | children: [ 88 | Center(child: Text(title, 89 | style: TextStyle(color: Colors.white,fontSize: AppSize.sp(52)))), 90 | InkWell( 91 | onTap: onBack, 92 | child: Column( 93 | mainAxisAlignment: MainAxisAlignment.center, 94 | mainAxisSize: MainAxisSize.max, 95 | children: [ 96 | Padding( 97 | padding: EdgeInsets.only(left: AppSize.width(20)), 98 | child: Icon(IconFonts.arrow_left,color: Colors.white,size: AppSize.height(60)), 99 | ) 100 | ],), 101 | ) 102 | ], 103 | ); 104 | } 105 | } 106 | 107 | class CustomBackBar extends StatelessWidget { 108 | final Function onBack; 109 | final Function onAction; 110 | 111 | CustomBackBar({ 112 | this.onBack, 113 | this.onAction 114 | }); 115 | 116 | @override 117 | Widget build(BuildContext context) { 118 | return Stack( 119 | children: [ 120 | Center( 121 | child: InkWell( 122 | onTap: onAction, 123 | child: Container( 124 | width: AppSize.width(750), 125 | height: AppSize.height(72), 126 | decoration: BoxDecoration( 127 | color: Colors.white, borderRadius: BorderRadius.circular(20.0)), 128 | child: Center( 129 | child: Row( 130 | mainAxisSize: MainAxisSize.min, 131 | children: [ 132 | Icon( 133 | CupertinoIcons.search, 134 | color: Color(0xff999999), 135 | size: AppSize.width(40), 136 | ), 137 | Text("请输入品牌名称", 138 | style: TextStyle(fontSize:AppSize.sp(35), color: Color(0xff999999))) 139 | ], 140 | )), 141 | ), 142 | )), 143 | InkWell( 144 | onTap: onBack, 145 | child: Column( 146 | mainAxisAlignment: MainAxisAlignment.center, 147 | mainAxisSize: MainAxisSize.max, 148 | children: [ 149 | Padding( 150 | padding: EdgeInsets.only(left: AppSize.width(20)), 151 | child: Icon(IconFonts.arrow_left,color: Colors.white,size: AppSize.height(60)), 152 | ) 153 | ],), 154 | ) 155 | ], 156 | ); 157 | } 158 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_yjh 2 | description: A new Flutter application. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.1+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | flutter_swiper : ^1.1.6 27 | flutter_screenutil: ^1.1.0 28 | flutter_staggered_grid_view: ^0.3.0 29 | fluro: "^1.4.0" 30 | flutter_statusbarcolor: ^0.2.0 31 | dio: ^3.0.9 32 | cached_network_image: ^2.2.0+1 33 | flutter_easyrefresh: ^2.1.1 34 | 35 | 36 | 37 | dev_dependencies: 38 | flutter_test: 39 | sdk: flutter 40 | 41 | 42 | # For information on the generic Dart part of this file, see the 43 | # following page: https://www.dartlang.org/tools/pub/pubspec 44 | 45 | # The following section is specific to Flutter. 46 | flutter: 47 | 48 | # The following line ensures that the Material Icons font is 49 | # included with your application, so that you can use the icons in 50 | # the material Icons class. 51 | uses-material-design: true 52 | 53 | # To add assets to your application, add an assets section, like this: 54 | assets: 55 | - images/logo.png 56 | - images/banner_1.png 57 | - images/head_menu_1.png 58 | - images/head_menu_2.png 59 | - images/head_menu_3.png 60 | - images/head_menu_4.png 61 | - images/head_menu_5.png 62 | - images/head_menu_6.png 63 | - images/head_menu_7.png 64 | - images/head_menu_8.png 65 | 66 | - images/scrollmenu_1.png 67 | - images/scrollmenu_2.png 68 | - images/scrollmenu_3.png 69 | 70 | - images/check_in.png 71 | - images/lottery.png 72 | - images/new_talent.png 73 | - images/new_store.png 74 | - images/new_shop_text.png 75 | - images/newcomer_text.png 76 | - images/points_lottery_text.png 77 | - images/check_in_text.png 78 | 79 | - images/headline_icon.png 80 | 81 | - images/ad_bar.png 82 | - images/home_near_store.png 83 | - images/discount_bg.png 84 | - images/wallet_red.png 85 | - images/wallet_yellow.png 86 | - images/see_more_text1.png 87 | - images/see_more_text2.png 88 | 89 | - images/baobao.png 90 | - images/huazp.png 91 | 92 | - images/default_avatar.png 93 | - images/card_coupon.png 94 | - images/information.png 95 | - images/referrer.png 96 | 97 | - images/personal_ad.png 98 | 99 | - images/invite_friends.png 100 | - images/my_fans.png 101 | - images/income.png 102 | - images/reward.png 103 | 104 | - images/guide.png 105 | - images/footprint.png 106 | - images/about.png 107 | - images/complaint.png 108 | - images/customer.png 109 | - images/problem.png 110 | - images/clear.png 111 | - images/sign_out.png 112 | 113 | - images/exchange_btn.png 114 | 115 | - images/poster_content.png 116 | 117 | - images/contact_merchant.png 118 | - images/call_hotline.png 119 | 120 | - images/flame_ico.png 121 | 122 | - images/store_list_label.png 123 | 124 | - images/order_form.png 125 | - images/details_description.jpeg 126 | 127 | # An image asset can refer to one or more resolution-specific "variants", see 128 | # https://flutter.io/assets-and-images/#resolution-aware. 129 | # For details regarding adding assets from package dependencies, see 130 | # https://flutter.io/assets-and-images/#from-packages 131 | 132 | # To add custom fonts to your application, add a fonts section here, 133 | # in this "flutter" section. Each entry in this list should have a 134 | # "family" key with the font family name, and a "fonts" key with a 135 | # list giving the asset and other descriptors for the font. For 136 | # example: 137 | # fonts: 138 | # - family: Schyler 139 | # fonts: 140 | # - asset: fonts/Schyler-Regular.ttf 141 | # - asset: fonts/Schyler-Italic.ttf 142 | # style: italic 143 | # - family: Trajan Pro 144 | # fonts: 145 | # - asset: fonts/TrajanPro.ttf 146 | # - asset: fonts/TrajanPro_Bold.ttf 147 | # weight: 700 148 | # 149 | # For details regarding fonts from package dependencies, 150 | # see https://flutter.io/custom-fonts/#from-packages 151 | # fonts: 152 | # - family: MyIcons 153 | # fonts: 154 | # - asset: fonts/MyFlutterApp.ttf 155 | fonts: 156 | - family: MyIcons 157 | fonts: 158 | - asset: fonts/MyFlutterApp.ttf 159 | 160 | - family: MyIcons2 161 | fonts: 162 | - asset: fonts/iconfont2.ttf 163 | 164 | - family: IconFont 165 | fonts: 166 | - asset: fonts/iconfont.ttf 167 | -------------------------------------------------------------------------------- /lib/page/secondary/points_mall.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 3 | import 'package:flutter_easyrefresh/material_footer.dart'; 4 | import 'package:flutter_easyrefresh/material_header.dart'; 5 | import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 6 | import 'package:flutter_yjh/dao/findings_dao.dart'; 7 | import 'package:flutter_yjh/models/goods_entity.dart'; 8 | import 'package:flutter_yjh/utils/app_size.dart'; 9 | import 'package:flutter_yjh/view/app_topbar.dart'; 10 | import 'package:flutter_yjh/view/custom_view.dart'; 11 | import 'package:flutter_yjh/view/customize_appbar.dart'; 12 | import 'package:flutter_yjh/view/theme_ui.dart'; 13 | 14 | /// 15 | /// 积分商城页 16 | /// 17 | class PointsMall extends StatefulWidget { 18 | @override 19 | _PointsMallState createState() => _PointsMallState(); 20 | } 21 | 22 | class _PointsMallState extends State with SingleTickerProviderStateMixin{ 23 | 24 | final List myTabs = [ 25 | Tab(text: '实物'), 26 | Tab(text: '虚拟'), 27 | Tab(text: '代金券'), 28 | ]; 29 | 30 | final List bodys = [ 31 | MallPageView(0), 32 | MallPageView(1), 33 | MallPageView(2), 34 | ]; 35 | 36 | TabController mController; 37 | 38 | @override 39 | void initState() { 40 | mController = TabController( 41 | length: myTabs.length, 42 | vsync: this, 43 | ); 44 | super.initState(); 45 | } 46 | 47 | @override 48 | void dispose() { 49 | mController?.dispose(); 50 | super.dispose(); 51 | } 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | return Scaffold( 56 | appBar: MyAppBar( 57 | height: AppSize.height(160), 58 | child: CommonBackTopBar(title: "积分商城", 59 | onBack:()=>Navigator.pop(context)) 60 | ), 61 | body: Container( 62 | color: ThemeColor.appBg, 63 | child: Column( 64 | children: [ 65 | Container( 66 | color: Colors.white, 67 | height: AppSize.height(115), 68 | child: TabBar( 69 | controller: mController, 70 | labelColor: ThemeColor.appBarBottomBg, 71 | indicatorColor: ThemeColor.appBarBottomBg, 72 | indicatorSize: TabBarIndicatorSize.label, 73 | indicatorWeight: 1.0, 74 | unselectedLabelColor: ThemeColor.hintTextColor, 75 | labelStyle: TextStyle(fontSize: AppSize.sp(44)), 76 | tabs: myTabs, 77 | ), 78 | ), 79 | Expanded( 80 | child: TabBarView( 81 | controller: mController, 82 | children: bodys, 83 | ), 84 | ) 85 | ], 86 | ) 87 | ) 88 | ); 89 | } 90 | } 91 | 92 | class MallPageView extends StatefulWidget { 93 | final int currentPage; 94 | 95 | MallPageView(this.currentPage); 96 | 97 | @override 98 | _MallPageViewState createState() => _MallPageViewState(); 99 | } 100 | 101 | class _MallPageViewState extends State with AutomaticKeepAliveClientMixin{ 102 | GlobalKey _headerKey = GlobalKey(); 103 | GlobalKey _footerKey = GlobalKey(); 104 | 105 | bool _isLoading = false; 106 | 107 | List goodsList = new List(); 108 | 109 | @override 110 | void initState() { 111 | _isLoading = true; 112 | loadData(); 113 | super.initState(); 114 | } 115 | 116 | void loadData() async{ 117 | GoodsEntity entity = await FindingsDao.fetch(); 118 | if(entity.goods != null){ 119 | setState(() { 120 | goodsList = entity.goods.sublist(widget.currentPage*30,entity.goods.length); 121 | _isLoading = false; 122 | }); 123 | } 124 | } 125 | 126 | _getContent(){ 127 | if(_isLoading){ 128 | return Center( 129 | child: CircularProgressIndicator(), 130 | ); 131 | }else{ 132 | return Container( 133 | padding: EdgeInsets.only( 134 | top: AppSize.width(30), 135 | left: AppSize.width(30), 136 | right: AppSize.width(30)), 137 | child: EasyRefresh( 138 | header: MaterialHeader( 139 | key: _headerKey, 140 | ), 141 | footer: MaterialFooter( 142 | key: _footerKey, 143 | ), 144 | child: StaggeredGridView.countBuilder( 145 | primary: false, 146 | crossAxisCount: 4, 147 | itemCount: goodsList.length, 148 | itemBuilder: _buildCardItem, 149 | staggeredTileBuilder: (int index) => StaggeredTile.fit(2), 150 | mainAxisSpacing: 8.0, 151 | crossAxisSpacing: 6.0, 152 | ), 153 | onRefresh: () async { 154 | goodsList = goodsList.reversed.toList(); 155 | setState(()=>{}); 156 | }, 157 | ), 158 | ); 159 | } 160 | } 161 | 162 | @override 163 | Widget build(BuildContext context) { 164 | super.build(context); 165 | return _getContent(); 166 | } 167 | 168 | Widget _buildCardItem(BuildContext context, int i){ 169 | return ThemeBtnCard( 170 | title: goodsList[i].name, 171 | price: goodsList[i].price, 172 | imgUrl: goodsList[i].photo, 173 | ); 174 | 175 | } 176 | 177 | @override 178 | bool get wantKeepAlive => true; 179 | } 180 | 181 | -------------------------------------------------------------------------------- /lib/page/secondary/nearby_business.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 4 | import 'package:flutter_easyrefresh/material_footer.dart'; 5 | import 'package:flutter_easyrefresh/material_header.dart'; 6 | import 'package:flutter_yjh/dao/home_dao.dart'; 7 | import 'package:flutter_yjh/models/store_entity.dart'; 8 | import 'package:flutter_yjh/utils/app_size.dart'; 9 | import 'package:flutter_yjh/view/app_topbar.dart'; 10 | import 'package:flutter_yjh/view/customize_appbar.dart'; 11 | import 'package:flutter_yjh/view/flutter_iconfont.dart'; 12 | import 'package:flutter_yjh/view/theme_ui.dart'; 13 | 14 | /// 15 | /// 附近商圈页 16 | /// 17 | class NearbyBusiness extends StatefulWidget { 18 | 19 | @override 20 | _NearbyBusinessState createState() => _NearbyBusinessState(); 21 | } 22 | 23 | class _NearbyBusinessState extends State { 24 | GlobalKey _headerKey = GlobalKey(); 25 | GlobalKey _footerKey = GlobalKey(); 26 | 27 | List storeList = new List(); 28 | bool _isLoading = false; 29 | 30 | 31 | @override 32 | void initState() { 33 | _isLoading = true; 34 | loadData(); 35 | super.initState(); 36 | } 37 | 38 | 39 | void loadData() async{ 40 | StoreEntity stores = await HomeDao.fetch(); 41 | if(stores?.stores != null){ 42 | setState(() { 43 | storeList = stores.stores; 44 | _isLoading = false; 45 | }); 46 | } 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return Scaffold( 52 | appBar: MyAppBar( 53 | height: AppSize.height(160), 54 | child: CommonBackTopBar(title: "附近商圈", 55 | onBack:()=>Navigator.pop(context)) 56 | ), 57 | body: _getContent() 58 | ); 59 | } 60 | 61 | _getContent(){ 62 | if(_isLoading){ 63 | return Center( 64 | child: CircularProgressIndicator(), 65 | ); 66 | }else{ 67 | return Container( 68 | color: ThemeColor.appBg, 69 | padding: EdgeInsets.only( 70 | top: AppSize.width(30), 71 | left: AppSize.width(30), 72 | right: AppSize.width(30)), 73 | child: EasyRefresh( 74 | header: MaterialHeader( 75 | key: _headerKey, 76 | ), 77 | footer: MaterialFooter( 78 | key: _footerKey, 79 | ), 80 | child: ListView.builder( 81 | itemCount: storeList.length, 82 | itemBuilder: _buildItem), 83 | onRefresh: () async { 84 | storeList = storeList.reversed.toList(); 85 | setState(()=>{}); 86 | }, 87 | ), 88 | ); 89 | } 90 | } 91 | 92 | Widget _buildItem(BuildContext context, int i){ 93 | return InkWell( 94 | onTap: () => onItemClick(i), 95 | child: Container( 96 | margin: EdgeInsets.only(bottom: AppSize.height(30)), 97 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30), 98 | horizontal: AppSize.width(30)), 99 | decoration: ThemeDecoration.card2, 100 | child: Row( 101 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 102 | children: [ 103 | Flexible( 104 | child: Row( 105 | children: [ 106 | Padding( 107 | padding: EdgeInsets.only(right: AppSize.width(40)), 108 | child: CachedNetworkImage(imageUrl: storeList[i].photo, 109 | fit: BoxFit.cover, 110 | width: AppSize.width(170), height: AppSize.width(170)), 111 | ), 112 | Expanded( 113 | child: Column( 114 | crossAxisAlignment: CrossAxisAlignment.start, 115 | mainAxisAlignment: MainAxisAlignment.spaceAround, 116 | children: [ 117 | Padding( 118 | padding: EdgeInsets.only(bottom: AppSize.height(30)), 119 | child: Text(storeList[i].name, 120 | maxLines: 2, 121 | overflow: TextOverflow.clip, 122 | style: ThemeTextStyle.primaryStyle), 123 | ), 124 | 125 | Container( 126 | padding: EdgeInsets.symmetric(horizontal: 6), 127 | decoration: BoxDecoration( 128 | border: Border.all(color: ThemeColor.appBarTopBg), 129 | borderRadius: BorderRadius.circular(20), 130 | ), 131 | child: Text("商城", style: TextStyle( 132 | fontSize: AppSize.sp(26), 133 | color: ThemeColor.appBarTopBg 134 | ) 135 | ), 136 | ) 137 | ], 138 | ), 139 | ) 140 | ], 141 | ), 142 | ), 143 | Row( 144 | children: [ 145 | Icon(IconFonts.location, color: ThemeColor.subTextColor, 146 | size: AppSize.width(45),), 147 | Text("1.37KM", style: ThemeTextStyle.orderContentStyle) 148 | ], 149 | ) 150 | ], 151 | ), 152 | ), 153 | ); 154 | 155 | } 156 | 157 | void onItemClick(int i){ 158 | 159 | } 160 | } 161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /lib/page/orderform_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 3 | import 'package:flutter_easyrefresh/material_footer.dart'; 4 | import 'package:flutter_easyrefresh/material_header.dart'; 5 | import 'package:flutter_yjh/dao/order_form_dao.dart'; 6 | import 'package:flutter_yjh/models/order_form_entity.dart'; 7 | import 'package:flutter_yjh/routes/routes.dart'; 8 | import 'package:flutter_yjh/utils/app_size.dart'; 9 | import 'package:flutter_yjh/view/app_topbar.dart'; 10 | import 'package:flutter_yjh/view/custom_view.dart'; 11 | import 'package:flutter_yjh/view/customize_appbar.dart'; 12 | 13 | /// 14 | /// app 订单页 15 | /// 16 | class OrderFormPage extends StatefulWidget { 17 | 18 | @override 19 | _OrderFormPageState createState() => _OrderFormPageState(); 20 | } 21 | 22 | 23 | class _OrderFormPageState extends State with AutomaticKeepAliveClientMixin, 24 | SingleTickerProviderStateMixin{ 25 | final List myTabs = [ 26 | Tab(text: '全部'), 27 | Tab(text: '待付款'), 28 | Tab(text: '待完成'), 29 | Tab(text: '待评价'), 30 | Tab(text: '售后'), 31 | ]; 32 | 33 | final ValueNotifier orderFormData 34 | = ValueNotifier(null); 35 | 36 | 37 | List bodys; 38 | 39 | _initTabView(){ 40 | bodys = List.generate(myTabs.length, (i){ 41 | return OrderFormTabView(i,orderFormData); 42 | }); 43 | } 44 | 45 | 46 | TabController mController; 47 | 48 | @override 49 | void initState() { 50 | _initTabView(); 51 | 52 | loadData(); 53 | mController = TabController( 54 | length: myTabs.length, 55 | vsync: this, 56 | ); 57 | super.initState(); 58 | } 59 | 60 | void loadData() async{ 61 | orderFormData.value = await OrderFormDao.fetch(); 62 | } 63 | 64 | @override 65 | Widget build(BuildContext context) { 66 | super.build(context); 67 | return Scaffold( 68 | appBar: MyAppBar( 69 | height: AppSize.height(160), 70 | child: CommonTopBar(title: "订单"), 71 | ), 72 | body: Container( 73 | color: Color(0xfff5f6f7), 74 | child: Column( 75 | children: [ 76 | Container( 77 | color: Colors.white, 78 | height: AppSize.height(120), 79 | child: Row( 80 | children:[Expanded( 81 | child: TabBar( 82 | isScrollable: true, 83 | controller: mController, 84 | labelColor: Color(0xFFFF7095), 85 | indicatorColor:Color(0xFFFF7095), 86 | indicatorSize:TabBarIndicatorSize.tab, 87 | indicatorWeight:1.0, 88 | unselectedLabelColor: Color(0xff333333), 89 | labelStyle: TextStyle(fontSize: AppSize.sp(44)), 90 | indicatorPadding:EdgeInsets.only(left:AppSize.width(30),right: AppSize.width(70)), 91 | labelPadding:EdgeInsets.only(left:AppSize.width(30),right: AppSize.width(70)), 92 | tabs: myTabs, 93 | ), 94 | )] 95 | ), 96 | ), 97 | Expanded( 98 | child: TabBarView( 99 | controller: mController, 100 | children: bodys, 101 | ), 102 | ) 103 | ], 104 | ), 105 | ), 106 | ); 107 | } 108 | 109 | @override 110 | // TODO: implement wantKeepAlive 111 | bool get wantKeepAlive => true; 112 | } 113 | 114 | class OrderFormTabView extends StatefulWidget { 115 | final ValueNotifier data; 116 | final int currentIndex; 117 | 118 | OrderFormTabView(this.currentIndex,this.data); 119 | 120 | @override 121 | _OrderFormTabViewState createState() => _OrderFormTabViewState(); 122 | } 123 | 124 | class _OrderFormTabViewState extends State { 125 | GlobalKey _headerKey = GlobalKey(); 126 | GlobalKey _footerKey = GlobalKey(); 127 | 128 | List listData; 129 | 130 | @override 131 | void initState() { 132 | widget.data.addListener(notifyDataChange); 133 | listData = _getDataList(); 134 | super.initState(); 135 | } 136 | 137 | @override 138 | void dispose() { 139 | widget.data.removeListener(notifyDataChange); 140 | super.dispose(); 141 | } 142 | 143 | List _getDataList(){ 144 | var itemList = widget.data.value !=null ? 145 | widget.data.value.items : []; 146 | 147 | switch(widget.currentIndex){ 148 | case 0: 149 | return itemList; 150 | case 1: 151 | return List.of(itemList.where((ele)=>ele.type == OrderForm.payment)); 152 | case 2: 153 | return List.of(itemList.where((ele)=>ele.type == OrderForm.pending)); 154 | case 3: 155 | return List.of(itemList.where((ele)=>ele.type == OrderForm.comment)); 156 | case 4: 157 | return List.of(itemList.where((ele)=>ele.type == OrderForm.afterSale)); 158 | } 159 | return listData; 160 | } 161 | 162 | 163 | void notifyDataChange(){ 164 | setState((){ 165 | listData = _getDataList(); 166 | }); 167 | } 168 | 169 | @override 170 | Widget build(BuildContext context) { 171 | return Container( 172 | margin: EdgeInsets.only(top: AppSize.height(30)), 173 | child: EasyRefresh( 174 | header: MaterialHeader( 175 | key: _headerKey, 176 | ), 177 | footer: MaterialFooter( 178 | key: _footerKey, 179 | ), 180 | onRefresh: () async { 181 | 182 | }, 183 | child: ListView.builder( 184 | itemCount: listData.length, 185 | itemBuilder: (context, i) { 186 | return InkWell( 187 | onTap: ()=>navigate(listData[i].id), 188 | child: OrderFormCard(item: listData[i])); 189 | }), 190 | ), 191 | ); 192 | } 193 | 194 | void navigate(int id){ 195 | Routes.instance.navigateTo(context, Routes.order_details,id.toString()); 196 | } 197 | } 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /lib/page/secondary/good_shop.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 4 | import 'package:flutter_easyrefresh/material_footer.dart'; 5 | import 'package:flutter_easyrefresh/material_header.dart'; 6 | import 'package:flutter_yjh/dao/home_dao.dart'; 7 | import 'package:flutter_yjh/models/store_entity.dart'; 8 | import 'package:flutter_yjh/utils/app_size.dart'; 9 | import 'package:flutter_yjh/view/app_topbar.dart'; 10 | import 'package:flutter_yjh/view/custom_view.dart'; 11 | import 'package:flutter_yjh/view/customize_appbar.dart'; 12 | import 'package:flutter_yjh/view/my_icons.dart.dart'; 13 | import 'package:flutter_yjh/view/ratingbar.dart'; 14 | import 'package:flutter_yjh/view/theme_ui.dart'; 15 | 16 | 17 | /// 18 | /// 星选好店页 19 | /// 20 | class GoodShop extends StatefulWidget { 21 | 22 | @override 23 | _GoodShopState createState() => _GoodShopState(); 24 | } 25 | 26 | class _GoodShopState extends State { 27 | GlobalKey _headerKey = GlobalKey(); 28 | GlobalKey _footerKey = GlobalKey(); 29 | 30 | List storeList = new List(); 31 | bool _isLoading = false; 32 | 33 | 34 | @override 35 | void initState() { 36 | _isLoading = true; 37 | loadData(); 38 | super.initState(); 39 | } 40 | 41 | 42 | void loadData() async{ 43 | StoreEntity stores = await HomeDao.fetch(); 44 | if(stores?.stores != null){ 45 | setState(() { 46 | storeList = stores.stores; 47 | _isLoading = false; 48 | }); 49 | } 50 | } 51 | 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | return Scaffold( 56 | appBar: MyAppBar( 57 | height: AppSize.height(160), 58 | child: CommonBackTopBar(title: "星选好店", 59 | onBack:()=>Navigator.pop(context)) 60 | ), 61 | body: _getContent() 62 | ); 63 | } 64 | 65 | _getContent(){ 66 | if(_isLoading){ 67 | return Center( 68 | child: CircularProgressIndicator(), 69 | ); 70 | }else{ 71 | return Container( 72 | color: ThemeColor.appBg, 73 | padding: EdgeInsets.only( 74 | top: AppSize.width(30), 75 | left: AppSize.width(30), 76 | right: AppSize.width(30)), 77 | child: EasyRefresh( 78 | header: MaterialHeader( 79 | key: _headerKey, 80 | ), 81 | footer: MaterialFooter( 82 | key: _footerKey, 83 | ), 84 | child: ListView.builder( 85 | itemCount: storeList.length, 86 | itemBuilder: _buildItem), 87 | onRefresh: () async { 88 | storeList = storeList.reversed.toList(); 89 | setState(()=>{}); 90 | }, 91 | ), 92 | ); 93 | } 94 | } 95 | 96 | Widget _buildItem(BuildContext context, int i){ 97 | return InkWell( 98 | onTap: () => onItemClick(i), 99 | child: Container( 100 | margin: EdgeInsets.only(bottom: AppSize.height(30)), 101 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30), 102 | horizontal: AppSize.width(30)), 103 | decoration: ThemeDecoration.card2, 104 | child: Column( 105 | crossAxisAlignment: CrossAxisAlignment.stretch, 106 | children: [ 107 | Padding( 108 | padding: EdgeInsets.only(bottom: AppSize.height(30),), 109 | child: Row( 110 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 111 | children: [ 112 | Flexible( 113 | child: Row( 114 | children: [ 115 | Padding( 116 | padding: EdgeInsets.only(right: AppSize.width(30)), 117 | child: Icon(Icons.store,color: ThemeColor.subTextColor), 118 | ), 119 | 120 | Flexible( 121 | child: Text(storeList[i].name, 122 | style: ThemeTextStyle.primaryStyle, 123 | maxLines: 1,overflow: TextOverflow.clip, 124 | ), 125 | )], 126 | ), 127 | ), 128 | Text("距离 1.37KM", style: ThemeTextStyle.orderContentStyle) 129 | ], 130 | ), 131 | ), 132 | Row( 133 | crossAxisAlignment: CrossAxisAlignment.start, 134 | children: [ 135 | Padding( 136 | padding: EdgeInsets.only(right: AppSize.width(30)), 137 | child: ClipRRect( 138 | borderRadius: BorderRadius.circular(8), 139 | child: CachedNetworkImage(imageUrl: storeList[i].photo, 140 | fit: BoxFit.cover, 141 | width: AppSize.width(300), height: AppSize.height(250)), 142 | ), 143 | ), 144 | Flexible( 145 | child: Column( 146 | mainAxisSize: MainAxisSize.max, 147 | crossAxisAlignment: CrossAxisAlignment.stretch, 148 | mainAxisAlignment: MainAxisAlignment.start, 149 | children: [ 150 | Row( 151 | children: [ 152 | Text("评分: "), 153 | StarRatingBarWidget( 154 | rating: 4.5, 155 | starSize: AppSize.width(50), 156 | starCount: 5, 157 | color: ThemeColor.starColor) 158 | ], 159 | ), 160 | Padding( 161 | padding: EdgeInsets.only(top: AppSize.height(30), 162 | bottom: AppSize.height(60)), 163 | child: Row( 164 | children: [ 165 | Badge('女性'), 166 | Padding( 167 | padding: EdgeInsets.symmetric(horizontal: AppSize.width(30)), 168 | child: Badge('品牌'), 169 | ), 170 | Badge('折扣'), 171 | ], 172 | ), 173 | ), 174 | Text('品牌上新,全场七折优惠~',style: ThemeTextStyle.cardNumStyle,) 175 | ], 176 | ), 177 | ) 178 | ], 179 | ) 180 | ], 181 | ), 182 | ), 183 | ); 184 | 185 | } 186 | 187 | void onItemClick(int i){ 188 | 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /lib/routes/routes.dart: -------------------------------------------------------------------------------- 1 | import 'package:fluro/fluro.dart'; 2 | import 'package:flutter/material.dart' hide Router; 3 | import 'package:flutter_yjh/page/details/order_details.dart'; 4 | import 'package:flutter_yjh/page/details/product_details.dart'; 5 | import 'package:flutter_yjh/page/details/store_details.dart'; 6 | import 'package:flutter_yjh/page/index_page.dart'; 7 | import 'package:flutter_yjh/page/login_page.dart'; 8 | import 'package:flutter_yjh/page/registered_page.dart'; 9 | import 'package:flutter_yjh/page/secondary/card_voucher.dart'; 10 | import 'package:flutter_yjh/page/secondary/edit_profile.dart'; 11 | import 'package:flutter_yjh/page/secondary/famous_brand.dart'; 12 | import 'package:flutter_yjh/page/secondary/favorite_page.dart'; 13 | import 'package:flutter_yjh/page/secondary/female_channel.dart'; 14 | import 'package:flutter_yjh/page/secondary/follow_page.dart'; 15 | import 'package:flutter_yjh/page/secondary/good_shop.dart'; 16 | import 'package:flutter_yjh/page/secondary/income_record.dart'; 17 | import 'package:flutter_yjh/page/secondary/invite_friends.dart'; 18 | import 'package:flutter_yjh/page/secondary/my_fans.dart'; 19 | import 'package:flutter_yjh/page/secondary/my_scores.dart'; 20 | import 'package:flutter_yjh/page/secondary/nearby_business.dart'; 21 | import 'package:flutter_yjh/page/secondary/new_shop.dart'; 22 | import 'package:flutter_yjh/page/secondary/points_lottery.dart'; 23 | import 'package:flutter_yjh/page/secondary/points_mall.dart'; 24 | import 'package:flutter_yjh/page/secondary/shop_referrer.dart'; 25 | import 'package:flutter_yjh/page/secondary/shop_reward.dart'; 26 | import 'package:flutter_yjh/page/secondary/store_live.dart'; 27 | import 'package:flutter_yjh/page/secondary/super_discount.dart'; 28 | 29 | class Routes { 30 | static final Router router = new Router(); 31 | static const root = '/'; 32 | static const points_mall = '/points_mall'; 33 | static const famous_brand = '/famous_brand'; 34 | static const nearby_business = '/nearby_business'; 35 | static const female_channel = '/female_channel'; 36 | static const store_live = '/store_live'; 37 | static const invite_friends = '/invite_friends'; 38 | static const good_shop = '/good_shop'; 39 | static const points_lottery = '/points_lottery'; 40 | static const new_shop = '/new_shop'; 41 | static const super_discount = '/super_discount'; 42 | 43 | // details 44 | static const order_details = '/order_details'; 45 | static const product_details = '/product_details'; 46 | static const store_details = '/store_details'; 47 | 48 | // 个人中心二级界面 49 | static const favorite_page = '/favorite_page'; 50 | static const follow_page = '/follow_page'; 51 | static const my_scores = '/my_scores'; 52 | static const edit_profile = '/edit_profile'; 53 | static const shop_referrer = '/shop_referrer'; 54 | static const card_voucher = '/card_voucher'; 55 | static const my_fans = '/my_fans'; 56 | static const income_record = '/income_record'; 57 | static const shop_reward = '/shop_reward'; 58 | 59 | static const login_page = '/login_page'; 60 | static const registered_page = '/registered_page'; 61 | 62 | void _config() { 63 | router.define( 64 | root, handler: Handler(handlerFunc: (context, params) => IndexPage())); 65 | 66 | router.define( 67 | points_mall, handler: Handler(handlerFunc: (context, params) => PointsMall())); 68 | 69 | router.define( 70 | famous_brand, handler: Handler(handlerFunc: (context, params) => FamousBrand())); 71 | 72 | router.define( 73 | nearby_business, handler: Handler(handlerFunc: (context, params) => NearbyBusiness())); 74 | 75 | router.define( 76 | female_channel, handler: Handler(handlerFunc: (context, params) => FemaleClassroom())); 77 | 78 | router.define( 79 | store_live, handler: Handler(handlerFunc: (context, params) => StoreLive())); 80 | 81 | router.define( 82 | invite_friends, handler: Handler(handlerFunc: (context, params) => InviteFriends())); 83 | 84 | router.define( 85 | good_shop, handler: Handler(handlerFunc: (context, params) => GoodShop())); 86 | 87 | router.define( 88 | points_lottery, handler: Handler(handlerFunc: (context, params) => PointsLottery())); 89 | 90 | router.define( 91 | new_shop, handler: Handler(handlerFunc: (context, params) => NewShop())); 92 | 93 | router.define( 94 | '$order_details/:id', handler: Handler(handlerFunc: (context, params) => OrderDetails(int.parse(params['id'][0])))); 95 | 96 | router.define( 97 | '$product_details/:id', handler: 98 | Handler(handlerFunc: (context, params) => ProductDetails(int.parse(params['id'][0])))); 99 | 100 | 101 | router.define( 102 | super_discount, handler: Handler(handlerFunc: (context, params) => SuperDiscount())); 103 | 104 | router.define( 105 | '$store_details/:id', handler: Handler(handlerFunc: (context, params) => StoreDetails( 106 | int.parse(params['id'][0])))); 107 | 108 | // 个人中心二级界面 109 | router.define( 110 | favorite_page, handler: Handler(handlerFunc: (context, params) => FavoritePage())); 111 | 112 | router.define( 113 | follow_page, handler: Handler(handlerFunc: (context, params) => FollowPage())); 114 | 115 | router.define( 116 | my_scores, handler: Handler(handlerFunc: (context, params) => MyScoresPage())); 117 | 118 | router.define( 119 | edit_profile, handler: Handler(handlerFunc: (context, params) => EditProfilePage())); 120 | 121 | router.define( 122 | shop_referrer, handler: Handler(handlerFunc: (context, params) => ShopReferrerPage())); 123 | 124 | router.define( 125 | card_voucher, handler: Handler(handlerFunc: (context, params) => CardVoucherPage())); 126 | 127 | router.define( 128 | my_fans, handler: Handler(handlerFunc: (context, params) => MyFansPage())); 129 | 130 | router.define( 131 | income_record, handler: Handler(handlerFunc: (context, params) => IncomeRecordPage())); 132 | 133 | router.define( 134 | shop_reward, handler: Handler(handlerFunc: (context, params) => ShopRewardPage())); 135 | 136 | 137 | router.define( 138 | login_page, handler: Handler(handlerFunc: (context, params) => Login())); 139 | 140 | router.define( 141 | registered_page, handler: Handler(handlerFunc: (context, params) => Registered())); 142 | 143 | } 144 | 145 | Future navigateTo(BuildContext context, String path,[String param='']){ 146 | var p = param.isNotEmpty?'$path/$param':path; 147 | return router.navigateTo(context,p,transition: TransitionType.inFromRight); 148 | } 149 | 150 | Future navigateFromBottom(BuildContext context, String path,[String param='']){ 151 | var p = param.isNotEmpty?'$path/$param':path; 152 | return router.navigateTo(context,p,transition: TransitionType.inFromBottom); 153 | } 154 | 155 | factory Routes() =>_getInstance(); 156 | static Routes get instance => _getInstance(); 157 | static Routes _instance; 158 | 159 | Routes._() { 160 | _config(); 161 | } 162 | static Routes _getInstance() { 163 | if (_instance == null) { 164 | _instance = new Routes._(); 165 | } 166 | return _instance; 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /lib/page/secondary/famous_brand.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:cached_network_image/cached_network_image.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 5 | import 'package:flutter_easyrefresh/material_footer.dart'; 6 | import 'package:flutter_easyrefresh/material_header.dart'; 7 | import 'package:flutter_yjh/dao/home_dao.dart'; 8 | import 'package:flutter_yjh/models/store_entity.dart'; 9 | import 'package:flutter_yjh/utils/app_size.dart'; 10 | import 'package:flutter_yjh/view/app_topbar.dart'; 11 | import 'package:flutter_yjh/view/customize_appbar.dart'; 12 | import 'package:flutter_yjh/view/theme_ui.dart'; 13 | 14 | 15 | /// 16 | /// 知名品牌页 17 | /// 18 | class FamousBrand extends StatefulWidget { 19 | 20 | @override 21 | _FamousBrandState createState() => _FamousBrandState(); 22 | } 23 | 24 | class _FamousBrandState extends State with SingleTickerProviderStateMixin { 25 | 26 | final List myTabs = [ 27 | Tab(text: '衣服'), 28 | Tab(text: '化妆品'), 29 | Tab(text: '潮鞋'), 30 | Tab(text: '医美'), 31 | Tab(text: '包包'), 32 | 33 | ]; 34 | 35 | final List bodys = [ 36 | FamousTabView(0), 37 | FamousTabView(1), 38 | FamousTabView(2), 39 | FamousTabView(3), 40 | FamousTabView(4), 41 | ]; 42 | 43 | TabController mController; 44 | 45 | @override 46 | void initState() { 47 | mController = TabController( 48 | length: myTabs.length, 49 | vsync: this, 50 | ); 51 | super.initState(); 52 | } 53 | 54 | @override 55 | Widget build(BuildContext context) { 56 | return Scaffold( 57 | appBar: MyAppBar( 58 | height: AppSize.height(160), 59 | child: CustomBackBar(onBack:()=>Navigator.pop(context))), 60 | 61 | body: Container( 62 | color: ThemeColor.appBg, 63 | child: Column( 64 | children: [ 65 | Container( 66 | color: Colors.white, 67 | height: AppSize.height(120), 68 | child: TabBar( 69 | isScrollable: true, 70 | controller: mController, 71 | labelColor: Color(0xFFFF7095), 72 | indicatorColor: Color(0xFFFF7095), 73 | indicatorSize: TabBarIndicatorSize.tab, 74 | indicatorWeight: 1.0, 75 | unselectedLabelColor: Color(0xff333333), 76 | labelStyle: TextStyle(fontSize: AppSize.sp(44)), 77 | indicatorPadding: EdgeInsets.only( 78 | left: AppSize.width(30), right: AppSize.width(80)), 79 | labelPadding: EdgeInsets.only( 80 | left: AppSize.width(30), right: AppSize.width(80)), 81 | tabs: myTabs, 82 | ), 83 | ), 84 | Expanded( 85 | child: TabBarView( 86 | controller: mController, 87 | children: bodys, 88 | ), 89 | ) 90 | ], 91 | ), 92 | ), 93 | ); 94 | } 95 | } 96 | 97 | /// 98 | /// 分类页 99 | /// 100 | class FamousTabView extends StatefulWidget { 101 | final int currentPage; 102 | 103 | FamousTabView(this.currentPage); 104 | 105 | @override 106 | _FamousTabViewState createState() => _FamousTabViewState(); 107 | } 108 | 109 | class _FamousTabViewState extends State with AutomaticKeepAliveClientMixin{ 110 | GlobalKey _headerKey = GlobalKey(); 111 | GlobalKey _footerKey = GlobalKey(); 112 | 113 | List storeList = new List(); 114 | bool _isLoading = false; 115 | 116 | @override 117 | void initState() { 118 | _isLoading = true; 119 | loadData(); 120 | super.initState(); 121 | } 122 | 123 | void loadData() async{ 124 | StoreEntity stores = await HomeDao.fetch(); 125 | if(stores?.stores != null){ 126 | setState(() { 127 | storeList = stores.stores; 128 | _isLoading = false; 129 | }); 130 | } 131 | } 132 | 133 | _getContent(){ 134 | if(_isLoading){ 135 | return Center( 136 | child: CircularProgressIndicator(), 137 | ); 138 | }else{ 139 | return Container( 140 | padding: EdgeInsets.only( 141 | top: AppSize.width(30), 142 | left: AppSize.width(30), 143 | right: AppSize.width(30)), 144 | child: EasyRefresh( 145 | header: MaterialHeader( 146 | key: _headerKey, 147 | ), 148 | footer: MaterialFooter( 149 | key: _footerKey, 150 | ), 151 | child: ListView.builder( 152 | itemCount: storeList.length, 153 | itemBuilder: _buildItem), 154 | onRefresh: () async { 155 | storeList = storeList.reversed.toList(); 156 | setState(()=>{}); 157 | }, 158 | ), 159 | ); 160 | } 161 | } 162 | 163 | @override 164 | Widget build(BuildContext context) { 165 | super.build(context); 166 | return _getContent(); 167 | } 168 | 169 | 170 | Widget _buildItem(BuildContext context, int i){ 171 | return InkWell( 172 | onTap: ()=>onItemClick(i), 173 | child: Container( 174 | margin: EdgeInsets.only(bottom: AppSize.height(30)), 175 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30), 176 | horizontal: AppSize.width(30)), 177 | decoration: ThemeDecoration.card2, 178 | child: Row( 179 | children: [ 180 | Padding( 181 | padding: EdgeInsets.only(right: AppSize.width(80)), 182 | child: CachedNetworkImage(imageUrl: storeList[i].photo, 183 | fit: BoxFit.cover, 184 | width: AppSize.width(170),height: AppSize.width(170)), 185 | ), 186 | Column( 187 | crossAxisAlignment: CrossAxisAlignment.start, 188 | mainAxisAlignment: MainAxisAlignment.spaceAround, 189 | children: [ 190 | Padding( 191 | padding: EdgeInsets.only(bottom: AppSize.height(30)), 192 | child: Text(storeList[i].name, 193 | maxLines: 1, 194 | overflow: TextOverflow.clip, 195 | style: ThemeTextStyle.primaryStyle), 196 | ), 197 | 198 | Container( 199 | padding: EdgeInsets.symmetric(horizontal: 6), 200 | decoration: BoxDecoration( 201 | borderRadius: BorderRadius.circular(20), 202 | gradient: LinearGradient(colors: [ThemeColor.appBarTopBg,ThemeColor.appBarBottomBg]) 203 | ), 204 | child: Row( 205 | children: [ 206 | Image.asset("images/flame_ico.png"), 207 | Text("热度指数100",style: TextStyle( 208 | fontSize: AppSize.sp(28), 209 | color: Colors.white 210 | ),) 211 | ], 212 | ), 213 | ) 214 | ], 215 | ) 216 | ], 217 | ), 218 | ), 219 | ); 220 | 221 | } 222 | 223 | void onItemClick(int i){ 224 | 225 | } 226 | 227 | @override 228 | bool get wantKeepAlive => true; 229 | } -------------------------------------------------------------------------------- /lib/page/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/routes/routes.dart'; 3 | import 'package:flutter_yjh/utils/app_size.dart'; 4 | import 'package:flutter_yjh/utils/constants.dart'; 5 | import 'package:flutter_yjh/view/arc_bg.dart'; 6 | import 'package:flutter_yjh/view/custom_view.dart'; 7 | import 'package:flutter_yjh/view/flutter_iconfont.dart'; 8 | import 'package:flutter_yjh/view/theme_ui.dart'; 9 | 10 | class Login extends StatefulWidget { 11 | @override 12 | _LoginState createState() => _LoginState(); 13 | } 14 | 15 | class _LoginState extends State { 16 | TextEditingController _phoneNum = TextEditingController(); 17 | TextEditingController _password = TextEditingController(); 18 | 19 | 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Scaffold( 24 | resizeToAvoidBottomPadding: false, 25 | body: Container( 26 | color: ThemeColor.appBg, 27 | child: MediaQuery.removePadding( 28 | context: context, 29 | removeTop: true, 30 | child: Stack( 31 | children: [ 32 | ArcBackground(Screen.width, AppSize.height(800)), 33 | Container( 34 | margin: EdgeInsets.only( 35 | top: AppSize.height(380), 36 | left: AppSize.width(30), 37 | right: AppSize.width(30), 38 | bottom: AppSize.height(120)), 39 | padding: EdgeInsets.only( 40 | top: AppSize.height(300), 41 | right: AppSize.width(60), 42 | left: AppSize.width(60)), 43 | decoration: ThemeDecoration.card, 44 | child: Column( 45 | children: [ 46 | TextField( 47 | keyboardType: TextInputType.phone, 48 | controller: _phoneNum, 49 | maxLines: 1, 50 | maxLength: 30, 51 | decoration: InputDecoration( 52 | prefixIcon: Icon(Icons.phone_iphone), 53 | hintText: "请输入手机号", 54 | contentPadding: EdgeInsets.symmetric( 55 | vertical: AppSize.height(30))), 56 | ), 57 | Padding( 58 | padding: EdgeInsets.only( 59 | top: AppSize.height(30), bottom: AppSize.height(60)), 60 | child: TextField( 61 | controller: _password, 62 | maxLines: 1, 63 | maxLength: 32, 64 | obscureText: true, 65 | keyboardType: TextInputType.emailAddress, 66 | decoration: InputDecoration( 67 | prefixIcon: Icon(Icons.lock_outline), 68 | hintText: "请输入登录密码", 69 | contentPadding: EdgeInsets.symmetric( 70 | vertical: AppSize.height(30)), 71 | suffixIcon: Icon( 72 | IconFonts.eye_close, 73 | size: AppSize.width(50), 74 | )), 75 | ), 76 | ), 77 | Row( 78 | mainAxisAlignment: MainAxisAlignment.end, 79 | children: [ 80 | Text( 81 | '忘记密码?', 82 | style: ThemeTextStyle.menuStyle3, 83 | ) 84 | ]), 85 | InkWell( 86 | child: Container( 87 | width: Screen.width, 88 | margin: 89 | EdgeInsets.symmetric(vertical: AppSize.height(30)), 90 | padding: 91 | EdgeInsets.symmetric(vertical: AppSize.height(20)), 92 | child: Center( 93 | child: Text( 94 | '登录', 95 | style: TextStyle( 96 | fontSize: AppSize.sp(45), color: Colors.white), 97 | )), 98 | decoration: BoxDecoration( 99 | gradient: LinearGradient(colors: [ 100 | ThemeColor.appBarTopBg, 101 | ThemeColor.appBarBottomBg 102 | ]), 103 | borderRadius: BorderRadius.circular(20), 104 | boxShadow: [ 105 | BoxShadow( 106 | offset: Offset(1.0, 5.0), 107 | color: Color.fromRGBO(234, 61, 135, 0.4), 108 | blurRadius: 5.0, 109 | ) 110 | ]), 111 | ), 112 | ), 113 | 114 | Padding( 115 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 116 | child: Row( 117 | mainAxisAlignment: MainAxisAlignment.center, 118 | children: [ 119 | Text('验证码登录',style: ThemeTextStyle.menuStyle3), 120 | 121 | Padding( 122 | padding: EdgeInsets.symmetric(horizontal: AppSize.width(30)), 123 | child: SizedBox( 124 | height: AppSize.height(30), 125 | child: ThemeView.divider(orient: Orient.vertical)), 126 | ), 127 | 128 | InkWell( 129 | onTap: (){ 130 | Routes.instance.navigateFromBottom(context, Routes.registered_page); 131 | }, 132 | child: Text('新用户注册',style: TextStyle( 133 | fontSize: AppSize.sp(36), 134 | color: Color(0xFF02A9FF)),), 135 | ), 136 | ], 137 | ), 138 | ) 139 | ], 140 | ), 141 | ), 142 | Positioned( 143 | width: Screen.width, 144 | top: AppSize.height(320), 145 | child: Column( 146 | mainAxisSize: MainAxisSize.min, 147 | children: [ 148 | AvatarView(imgPath: 'images/logo.png',), 149 | Padding( 150 | padding: EdgeInsets.only(top: AppSize.height(30)), 151 | child: Text("登陆", style: ThemeTextStyle.personalShopNameStyle), 152 | ), 153 | ], 154 | ), 155 | ), 156 | Positioned( 157 | left: AppSize.width(60), 158 | right: AppSize.width(60), 159 | child: Row( 160 | mainAxisAlignment: MainAxisAlignment.center, 161 | children: [ 162 | SizedBox( 163 | child: Checkbox( 164 | value: true, 165 | onChanged: (v){}, 166 | ), 167 | ), 168 | 169 | Text('我已阅读并同意遵守',style: TextStyle( 170 | fontSize: AppSize.sp(30), 171 | color: ThemeColor.subTextColor 172 | )), 173 | Text('《服务许可协议》',style: TextStyle( 174 | fontSize: AppSize.sp(30), 175 | decoration: TextDecoration.underline, 176 | color: ThemeColor.hintTextColor 177 | )), 178 | ], 179 | ), 180 | bottom: AppSize.height(150)), 181 | 182 | Positioned( 183 | top: Screen.statusH+AppSize.height(30), 184 | left: AppSize.width(30), 185 | child: InkWell( 186 | onTap: (){ 187 | Navigator.pop(context); 188 | }, 189 | child: Icon(IconFonts.arrow_left,color: Colors.white,)), 190 | 191 | ) 192 | ], 193 | ), 194 | ), 195 | ), 196 | ); 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /lib/page/findings_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 3 | import 'package:flutter_yjh/dao/findings_dao.dart'; 4 | import 'package:flutter_yjh/models/goods_entity.dart'; 5 | import 'package:flutter_yjh/routes/routes.dart'; 6 | import 'package:flutter_yjh/utils/app_size.dart'; 7 | import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 8 | import 'package:flutter_yjh/view/app_topbar.dart'; 9 | import 'package:flutter_yjh/view/custom_view.dart'; 10 | import 'package:flutter_yjh/view/customize_appbar.dart'; 11 | import 'package:flutter_yjh/view/flutter_iconfont.dart'; 12 | import 'package:flutter_yjh/view/theme_ui.dart'; 13 | import 'package:flutter_easyrefresh/material_header.dart'; 14 | import 'package:flutter_easyrefresh/material_footer.dart'; 15 | 16 | /// 17 | /// app 发现页 18 | /// 19 | class FindingsPage extends StatefulWidget { 20 | @override 21 | _FindingsPageState createState() => _FindingsPageState(); 22 | } 23 | 24 | class _FindingsPageState extends State 25 | with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin { 26 | final List myTabs = [ 27 | Tab(text: '推荐'), 28 | Tab(text: '衣服'), 29 | Tab(text: '化妆品'), 30 | Tab(text: '潮鞋'), 31 | Tab(text: '医美'), 32 | Tab(text: '包包'), 33 | 34 | ]; 35 | 36 | final List bodys = [ 37 | FindingTabView(0), 38 | FindingTabView(1), 39 | FindingTabView(2), 40 | FindingTabView(3), 41 | FindingTabView(4), 42 | FindingTabView(5), 43 | ]; 44 | 45 | TabController mController; 46 | PopupWindow popupWindow; 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | super.build(context); 51 | popupWindow = PopupWindow(context); 52 | return Scaffold( 53 | appBar: MyAppBar( 54 | height: AppSize.height(160), 55 | child: CommonTopBar(title: "发现"), 56 | ), 57 | body: Container( 58 | color: ThemeColor.appBg, 59 | child: Column( 60 | children: [ 61 | Container( 62 | color: Colors.white, 63 | height: AppSize.height(120), 64 | child: Row(children: [ 65 | Expanded( 66 | child: TabBar( 67 | isScrollable: true, 68 | controller: mController, 69 | labelColor: Color(0xFFFF7095), 70 | indicatorColor: Color(0xFFFF7095), 71 | indicatorSize: TabBarIndicatorSize.tab, 72 | indicatorWeight: 1.0, 73 | unselectedLabelColor: Color(0xff333333), 74 | labelStyle: TextStyle(fontSize: AppSize.sp(44)), 75 | indicatorPadding: EdgeInsets.only( 76 | left: AppSize.width(30), right: AppSize.width(80)), 77 | labelPadding: EdgeInsets.only( 78 | left: AppSize.width(30), right: AppSize.width(80)), 79 | tabs: myTabs, 80 | ), 81 | ), 82 | Padding( 83 | padding: EdgeInsets.only(top: 10, bottom: 10), 84 | child: ThemeView.divider(orient: Orient.vertical)), 85 | Padding( 86 | padding: EdgeInsets.only(left: 8, right: 8), 87 | child: InkWell( 88 | onTap: () { 89 | popupWindow.show( 90 | Container( 91 | margin: 92 | EdgeInsets.only(bottom: AppSize.height(500)), 93 | child: Padding( 94 | padding: EdgeInsets.only(left: 16,top: 8), 95 | child: Text("全部分类"), 96 | ), 97 | color: Colors.white, 98 | ), 99 | ); 100 | }, 101 | child: Icon(IconFonts.arrow_down,color: Color(0xff999999),))) 102 | ]), 103 | ), 104 | Expanded( 105 | child: TabBarView( 106 | controller: mController, 107 | children: bodys, 108 | ), 109 | ) 110 | ], 111 | ), 112 | ), 113 | ); 114 | } 115 | 116 | @override 117 | void initState() { 118 | super.initState(); 119 | 120 | mController = TabController( 121 | length: myTabs.length, 122 | vsync: this, 123 | ); 124 | } 125 | 126 | @override 127 | void dispose() { 128 | super.dispose(); 129 | mController.dispose(); 130 | } 131 | 132 | @override 133 | bool get wantKeepAlive => true; 134 | } 135 | 136 | 137 | /// 138 | /// 分类页 139 | /// 140 | class FindingTabView extends StatefulWidget { 141 | final int currentPage; 142 | 143 | FindingTabView(this.currentPage); 144 | 145 | @override 146 | _FindingTabViewState createState() => _FindingTabViewState(); 147 | } 148 | 149 | class _FindingTabViewState extends State with AutomaticKeepAliveClientMixin{ 150 | GlobalKey _headerKey = GlobalKey(); 151 | GlobalKey _footerKey = GlobalKey(); 152 | 153 | List goodsList = new List(); 154 | bool _isLoading = false; 155 | 156 | @override 157 | void initState() { 158 | _isLoading = true; 159 | loadData(); 160 | super.initState(); 161 | } 162 | 163 | void loadData() async{ 164 | GoodsEntity entity = await FindingsDao.fetch(); 165 | if(entity?.goods != null){ 166 | setState(() { 167 | goodsList = entity.goods.sublist(widget.currentPage*30,entity.goods.length); 168 | _isLoading = false; 169 | }); 170 | } 171 | } 172 | 173 | _buildContent(){ 174 | if(_isLoading){ 175 | return Center( 176 | child: CircularProgressIndicator(), 177 | ); 178 | }else{ 179 | return Container( 180 | padding: EdgeInsets.only( 181 | top: AppSize.width(30), 182 | left: AppSize.width(30), 183 | right: AppSize.width(30)), 184 | child: EasyRefresh( 185 | header: MaterialHeader( 186 | key: _headerKey, 187 | ), 188 | footer: MaterialFooter( 189 | key: _footerKey, 190 | ), 191 | child: StaggeredGridView.countBuilder( 192 | primary: false, 193 | crossAxisCount: 4, 194 | itemCount: goodsList.length, 195 | itemBuilder: _buildCardItem, 196 | staggeredTileBuilder: (int index) => StaggeredTile.fit(2), 197 | mainAxisSpacing: 8.0, 198 | crossAxisSpacing: 6.0, 199 | ), 200 | onRefresh: () async { 201 | goodsList = goodsList.reversed.toList(); 202 | setState(()=>{}); 203 | }, 204 | ), 205 | ); 206 | } 207 | } 208 | 209 | @override 210 | Widget build(BuildContext context) { 211 | super.build(context); 212 | return _buildContent(); 213 | } 214 | 215 | 216 | // 生成每项卡片 217 | Widget _buildCardItem(BuildContext context, int i){ 218 | return InkWell( 219 | onTap: ()=>onItemClick(i), 220 | child: ThemeCard( 221 | title: goodsList[i].name, 222 | price: goodsList[i].price, 223 | imgUrl: goodsList[i].photo, 224 | number: '63524人已付款', 225 | ), 226 | ); 227 | 228 | } 229 | 230 | void onItemClick(int i){ 231 | int id = goodsList[i].id; 232 | Routes.instance.navigateTo(context, Routes.product_details,id.toString()); 233 | } 234 | 235 | @override 236 | bool get wantKeepAlive => true; 237 | } 238 | 239 | 240 | /// 241 | /// 弹出窗口 242 | /// 243 | class PopupWindow { 244 | BuildContext ctx; 245 | OverlayState overlayState; 246 | OverlayEntry overlayEntry; 247 | 248 | PopupWindow(this.ctx) { 249 | overlayState = Overlay.of(this.ctx); 250 | } 251 | 252 | isShowing() { 253 | return overlayEntry != null; 254 | } 255 | 256 | show(Widget child) { 257 | if (isShowing()) { 258 | return; 259 | } 260 | 261 | overlayEntry = new OverlayEntry(builder: (context) { 262 | return SafeArea( 263 | child: GestureDetector( 264 | onTap: () { 265 | this.dismiss(); 266 | }, 267 | child: Material( 268 | type: MaterialType.transparency, 269 | child: Container( 270 | color: Color.fromRGBO(0, 0, 0, 0.5), 271 | margin: EdgeInsets.only(top: AppSize.height(280)), 272 | child: child, 273 | ), 274 | ), 275 | ), 276 | ); 277 | }); 278 | overlayState.insert(overlayEntry); 279 | } 280 | 281 | dismiss() { 282 | overlayEntry?.remove(); 283 | overlayEntry = null; 284 | } 285 | } 286 | -------------------------------------------------------------------------------- /lib/page/secondary/shop_referrer.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_yjh/dao/home_dao.dart'; 4 | import 'package:flutter_yjh/models/store_entity.dart'; 5 | import 'package:flutter_yjh/utils/app_size.dart'; 6 | import 'package:flutter_yjh/view/app_topbar.dart'; 7 | import 'package:flutter_yjh/view/custom_view.dart'; 8 | import 'package:flutter_yjh/view/customize_appbar.dart'; 9 | import 'package:flutter_yjh/view/theme_ui.dart'; 10 | import 'dart:math' show Random; 11 | 12 | 13 | /// 14 | /// 门店/推荐人页 15 | /// 16 | class ShopReferrerPage extends StatefulWidget { 17 | 18 | @override 19 | _ShopReferrerPageState createState() => _ShopReferrerPageState(); 20 | } 21 | 22 | class _ShopReferrerPageState extends State with SingleTickerProviderStateMixin{ 23 | final List myTabs = [ 24 | Tab(text: '加入的门店'), 25 | Tab(text: '我的推荐人'), 26 | ]; 27 | 28 | List bodys; 29 | 30 | StoreModel storeModel; 31 | 32 | TabController mController; 33 | 34 | 35 | createBody(){ 36 | if(bodys == null){ 37 | bodys = new List<_TabPage>(); 38 | bodys.add(_createShopPage()); 39 | bodys.add(_createReferrerPage()); 40 | } 41 | return bodys; 42 | } 43 | 44 | @override 45 | void initState() { 46 | mController = TabController( 47 | length: myTabs.length, 48 | vsync: this, 49 | ); 50 | 51 | loadData(); 52 | super.initState(); 53 | } 54 | 55 | void loadData() async{ 56 | StoreEntity stores = await HomeDao.fetch(); 57 | if(stores?.stores != null){ 58 | int i = Random().nextInt(stores.stores.length); 59 | setState(() { 60 | storeModel = stores.stores[i]; 61 | }); 62 | } 63 | } 64 | 65 | @override 66 | void dispose() { 67 | mController?.dispose(); 68 | super.dispose(); 69 | } 70 | 71 | @override 72 | Widget build(BuildContext context) { 73 | return Scaffold( 74 | appBar: MyAppBar( 75 | height: AppSize.height(160), 76 | child: CommonBackTopBar(title: "门店/推荐人", 77 | onBack:()=>Navigator.pop(context)) 78 | ), 79 | body: _getContent() 80 | ); 81 | } 82 | 83 | Widget _getContent(){ 84 | if(storeModel != null){ 85 | return Container( 86 | color: ThemeColor.appBg, 87 | child: Column( 88 | children: [ 89 | Container( 90 | color: Colors.white, 91 | height: AppSize.height(115), 92 | child: TabBar( 93 | controller: mController, 94 | labelColor: ThemeColor.appBarBottomBg, 95 | indicatorColor: ThemeColor.appBarBottomBg, 96 | indicatorSize: TabBarIndicatorSize.label, 97 | indicatorWeight: 1.0, 98 | unselectedLabelColor: ThemeColor.hintTextColor, 99 | labelStyle: TextStyle(fontSize: AppSize.sp(44)), 100 | tabs: myTabs, 101 | ), 102 | ), 103 | Expanded( 104 | child: TabBarView( 105 | controller: mController, 106 | children: createBody(), 107 | ), 108 | ) 109 | ], 110 | ) 111 | ); 112 | }else{ 113 | return Center(child: CircularProgressIndicator()); 114 | } 115 | } 116 | 117 | Widget _createShopPage(){ 118 | return _TabPage( 119 | child:SingleChildScrollView( 120 | child: Column( 121 | crossAxisAlignment: CrossAxisAlignment.start, 122 | children: [ 123 | Row( 124 | crossAxisAlignment: CrossAxisAlignment.start, 125 | children: [ 126 | Padding( 127 | padding: EdgeInsets.only(right: AppSize.width(30)), 128 | child: ClipRRect( 129 | borderRadius:BorderRadius.circular(8), 130 | child: CachedNetworkImage( 131 | imageUrl: storeModel.photo, 132 | fit: BoxFit.cover,width: AppSize.width(200),height: AppSize.width(200)), 133 | ), 134 | ), 135 | Flexible( 136 | child: Column( 137 | crossAxisAlignment: CrossAxisAlignment.start, 138 | children: [ 139 | Padding( 140 | padding: EdgeInsets.only(bottom: AppSize.height(50)), 141 | child: Text(storeModel.name, 142 | style: ThemeTextStyle.personalShopNameStyle), 143 | ), 144 | 145 | Text("加入时间:2019-05-12",style: ThemeTextStyle.orderContentStyle) 146 | ], 147 | ), 148 | ) 149 | ], 150 | ), 151 | Padding( 152 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 153 | child: ThemeView.divider(), 154 | ), 155 | Padding( 156 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 157 | child: Text('门店地址',style: ThemeTextStyle.primaryStyle), 158 | ), 159 | Text('四川省 成都市 XXXX区 XXX街道 XXXXXX小区1栋一单元0201号',style: ThemeTextStyle.menuStyle), 160 | Padding( 161 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 162 | child: ThemeView.divider(), 163 | ), 164 | 165 | _getContact('会长微信:','DHU8925656'), 166 | 167 | Padding( 168 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 169 | child: ThemeView.divider(), 170 | ), 171 | _getContact('会长电话:','13256842256'), 172 | Padding( 173 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 174 | child: ThemeView.divider(), 175 | ), 176 | Row( 177 | mainAxisAlignment: MainAxisAlignment.center, 178 | children: [ 179 | CachedNetworkImage(imageUrl: 'https://f12.baidu.com/it/u=3168097238,1008455172&fm=72',) 180 | ], 181 | ), 182 | Row( 183 | mainAxisAlignment: MainAxisAlignment.center, 184 | children: [Text('扫一扫加会长微信',style: ThemeTextStyle.primaryStyle)], 185 | ) 186 | ], 187 | ), 188 | ) 189 | ); 190 | } 191 | 192 | Widget _getContact(String label,String value){ 193 | return Row( 194 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 195 | children: [ 196 | Text( 197 | label, 198 | style: TextStyle( 199 | fontWeight: FontWeight.w500, 200 | fontSize: AppSize.sp(44), 201 | color: Color(0xff333333)), 202 | ), 203 | Container( 204 | padding: EdgeInsets.only(left: 10, right: 10), 205 | decoration: BoxDecoration( 206 | border: Border.all( 207 | width: 1.0, color: Color(0xFFFFF0F4)), 208 | color: Color(0xFFFFF0F4), 209 | borderRadius: BorderRadius.circular(18.0)), 210 | margin: EdgeInsets.only(left: 20, right: 20), 211 | child: Text(value, style: ThemeTextStyle.orderFormBtnStyle)), 212 | Text("点击复制", 213 | style: TextStyle( 214 | decoration: TextDecoration.underline, 215 | fontSize: AppSize.sp(36), 216 | color: Color(0xFF15AFF7))), 217 | ],); 218 | } 219 | 220 | Widget _createReferrerPage(){ 221 | return _TabPage( 222 | child:Column( 223 | children: [ 224 | AvatarView(), 225 | Text("昵称/账号", style: ThemeTextStyle.primaryStyle), 226 | 227 | Padding( 228 | padding: EdgeInsets.only(top: AppSize.height(90)), 229 | child: _getContact('微信:','dhu8925656'), 230 | ), 231 | 232 | Padding( 233 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 234 | child: ThemeView.divider(), 235 | ), 236 | 237 | _getContact('电话:','13256842256'), 238 | 239 | Padding( 240 | padding: EdgeInsets.symmetric(vertical: AppSize.height(30)), 241 | child: ThemeView.divider(), 242 | ), 243 | Text('邀请人二维码',style: ThemeTextStyle.orderContentStyle), 244 | CachedNetworkImage(imageUrl: 'https://f12.baidu.com/it/u=3168097238,1008455172&fm=72'), 245 | Text('长按保存',style: ThemeTextStyle.primaryStyle) 246 | ], 247 | ) 248 | ); 249 | } 250 | } 251 | 252 | class _TabPage extends StatelessWidget { 253 | final Widget child; 254 | 255 | _TabPage({this.child}); 256 | 257 | @override 258 | Widget build(BuildContext context) { 259 | return Container( 260 | margin: EdgeInsets.symmetric( 261 | vertical: AppSize.height(30), 262 | horizontal: AppSize.width(30) 263 | ), 264 | padding: EdgeInsets.symmetric( 265 | vertical: AppSize.height(30), 266 | horizontal: AppSize.width(30) 267 | ), 268 | decoration: ThemeDecoration.card2, 269 | child: child, 270 | ); 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /lib/page/registered_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_yjh/utils/app_size.dart'; 3 | import 'package:flutter_yjh/utils/constants.dart'; 4 | import 'package:flutter_yjh/view/arc_bg.dart'; 5 | import 'package:flutter_yjh/view/custom_view.dart'; 6 | import 'package:flutter_yjh/view/flutter_iconfont.dart'; 7 | import 'package:flutter_yjh/view/theme_ui.dart'; 8 | 9 | /// 10 | /// 注册页面 11 | /// 12 | class Registered extends StatefulWidget { 13 | @override 14 | _RegisteredState createState() => _RegisteredState(); 15 | } 16 | 17 | class _RegisteredState extends State { 18 | TextEditingController _phoneNum = TextEditingController(); 19 | TextEditingController _password = TextEditingController(); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Scaffold( 24 | resizeToAvoidBottomPadding: false, 25 | body: Container( 26 | color: ThemeColor.appBg, 27 | child: MediaQuery.removePadding( 28 | context: context, 29 | removeTop: true, 30 | child: SingleChildScrollView( 31 | child: Stack( 32 | children: [ 33 | ArcBackground(Screen.width, AppSize.height(800)), 34 | Container( 35 | margin: EdgeInsets.only( 36 | top: AppSize.height(380), 37 | left: AppSize.width(30), 38 | right: AppSize.width(30), 39 | bottom: AppSize.height(120)), 40 | padding: EdgeInsets.only( 41 | top: AppSize.height(300), 42 | right: AppSize.width(60), 43 | left: AppSize.width(60)), 44 | decoration: ThemeDecoration.card, 45 | child: Column( 46 | children: [ 47 | TextField( 48 | keyboardType: TextInputType.phone, 49 | controller: _phoneNum, 50 | maxLines: 1, 51 | maxLength: 30, 52 | decoration: InputDecoration( 53 | prefixIcon: Icon(Icons.phone_iphone), 54 | hintText: "请输入手机号", 55 | contentPadding: EdgeInsets.symmetric( 56 | vertical: AppSize.height(30))), 57 | ), 58 | TextField( 59 | controller: _password, 60 | maxLines: 1, 61 | maxLength: 6, 62 | obscureText: true, 63 | keyboardType: TextInputType.emailAddress, 64 | decoration: InputDecoration( 65 | hintText: "请输入短信验证码", 66 | contentPadding: EdgeInsets.symmetric( 67 | vertical: AppSize.height(30)), 68 | suffixIcon: Padding( 69 | padding: EdgeInsets.symmetric( 70 | vertical: AppSize.height(30)), 71 | child: Text( 72 | '获取验证码', 73 | style: TextStyle( 74 | fontSize: AppSize.sp(40), 75 | color: ThemeColor.appBarTopBg), 76 | ), 77 | )), 78 | ), 79 | TextField( 80 | controller: _password, 81 | maxLines: 1, 82 | maxLength: 32, 83 | obscureText: true, 84 | keyboardType: TextInputType.emailAddress, 85 | decoration: InputDecoration( 86 | prefixIcon: Icon(Icons.lock_outline), 87 | hintText: "请输入登录密码", 88 | contentPadding: EdgeInsets.symmetric( 89 | vertical: AppSize.height(30)), 90 | suffixIcon: Icon( 91 | IconFonts.eye_close, 92 | size: AppSize.width(50), 93 | )), 94 | ), 95 | TextField( 96 | controller: _password, 97 | maxLines: 1, 98 | maxLength: 32, 99 | obscureText: true, 100 | keyboardType: TextInputType.emailAddress, 101 | decoration: InputDecoration( 102 | prefixIcon: Icon(Icons.lock_outline), 103 | hintText: "请再次确认登录密码", 104 | contentPadding: EdgeInsets.symmetric( 105 | vertical: AppSize.height(30)), 106 | suffixIcon: Icon( 107 | IconFonts.eye_close, 108 | size: AppSize.width(50), 109 | )), 110 | ), 111 | TextField( 112 | keyboardType: TextInputType.phone, 113 | controller: _phoneNum, 114 | maxLines: 1, 115 | maxLength: 30, 116 | decoration: InputDecoration( 117 | prefixIcon: Icon(Icons.phone_iphone), 118 | hintText: "邀请人手机号/推荐码", 119 | contentPadding: EdgeInsets.symmetric( 120 | vertical: AppSize.height(30))), 121 | ), 122 | InkWell( 123 | child: Container( 124 | width: Screen.width, 125 | margin: EdgeInsets.symmetric( 126 | vertical: AppSize.height(30)), 127 | padding: EdgeInsets.symmetric( 128 | vertical: AppSize.height(20)), 129 | child: Center( 130 | child: Text( 131 | '注册', 132 | style: TextStyle( 133 | fontSize: AppSize.sp(45), color: Colors.white), 134 | )), 135 | decoration: BoxDecoration( 136 | gradient: LinearGradient(colors: [ 137 | ThemeColor.appBarTopBg, 138 | ThemeColor.appBarBottomBg 139 | ]), 140 | borderRadius: BorderRadius.circular(20), 141 | boxShadow: [ 142 | BoxShadow( 143 | offset: Offset(1.0, 5.0), 144 | color: Color.fromRGBO(234, 61, 135, 0.4), 145 | blurRadius: 5.0, 146 | ) 147 | ]), 148 | ), 149 | ), 150 | Padding( 151 | padding: 152 | EdgeInsets.symmetric(vertical: AppSize.height(30)), 153 | child: Row( 154 | mainAxisAlignment: MainAxisAlignment.center, 155 | children: [ 156 | Text('已有账号,', style: ThemeTextStyle.cardNumStyle), 157 | Text( 158 | '立即登录', 159 | style: TextStyle( 160 | decoration: TextDecoration.underline, 161 | fontSize: AppSize.sp(36), 162 | color: Color(0xFF02A9FF)), 163 | ), 164 | ], 165 | ), 166 | ), 167 | Row( 168 | mainAxisAlignment: MainAxisAlignment.center, 169 | children: [ 170 | SizedBox( 171 | child: Checkbox( 172 | value: true, 173 | onChanged: (v) {}, 174 | ), 175 | ), 176 | Text('我已阅读并同意遵守', 177 | style: TextStyle( 178 | fontSize: AppSize.sp(30), 179 | color: ThemeColor.subTextColor)), 180 | Text('《服务许可协议》', 181 | style: TextStyle( 182 | fontSize: AppSize.sp(30), 183 | decoration: TextDecoration.underline, 184 | color: ThemeColor.hintTextColor)), 185 | ], 186 | ), 187 | ], 188 | ), 189 | ), 190 | Positioned( 191 | width: Screen.width, 192 | top: AppSize.height(320), 193 | child: Column( 194 | mainAxisSize: MainAxisSize.min, 195 | children: [ 196 | AvatarView( 197 | imgPath: 'images/logo.png', 198 | ), 199 | Padding( 200 | padding: EdgeInsets.only(top: AppSize.height(30)), 201 | child: Text("注册", 202 | style: ThemeTextStyle.personalShopNameStyle), 203 | ), 204 | ], 205 | ), 206 | ), 207 | Positioned( 208 | top: Screen.statusH + AppSize.height(30), 209 | left: AppSize.width(30), 210 | child: InkWell( 211 | onTap: () { 212 | Navigator.pop(context); 213 | }, 214 | child: Icon( 215 | IconFonts.arrow_left, 216 | color: Colors.white, 217 | )), 218 | ) 219 | ], 220 | ), 221 | ), 222 | ), 223 | ), 224 | ); 225 | } 226 | } 227 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.5.0-nullsafety.1" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0-nullsafety.1" 18 | cached_network_image: 19 | dependency: "direct main" 20 | description: 21 | name: cached_network_image 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "2.2.0+1" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.1.0-nullsafety.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.2.0-nullsafety.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.1.0-nullsafety.1" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "1.15.0-nullsafety.3" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "2.1.5" 67 | cupertino_icons: 68 | dependency: "direct main" 69 | description: 70 | name: cupertino_icons 71 | url: "https://pub.flutter-io.cn" 72 | source: hosted 73 | version: "0.1.3" 74 | dio: 75 | dependency: "direct main" 76 | description: 77 | name: dio 78 | url: "https://pub.flutter-io.cn" 79 | source: hosted 80 | version: "3.0.9" 81 | fake_async: 82 | dependency: transitive 83 | description: 84 | name: fake_async 85 | url: "https://pub.flutter-io.cn" 86 | source: hosted 87 | version: "1.2.0-nullsafety.1" 88 | file: 89 | dependency: transitive 90 | description: 91 | name: file 92 | url: "https://pub.flutter-io.cn" 93 | source: hosted 94 | version: "5.2.0" 95 | fluro: 96 | dependency: "direct main" 97 | description: 98 | name: fluro 99 | url: "https://pub.flutter-io.cn" 100 | source: hosted 101 | version: "1.6.3" 102 | flutter: 103 | dependency: "direct main" 104 | description: flutter 105 | source: sdk 106 | version: "0.0.0" 107 | flutter_cache_manager: 108 | dependency: transitive 109 | description: 110 | name: flutter_cache_manager 111 | url: "https://pub.flutter-io.cn" 112 | source: hosted 113 | version: "1.4.1" 114 | flutter_easyrefresh: 115 | dependency: "direct main" 116 | description: 117 | name: flutter_easyrefresh 118 | url: "https://pub.flutter-io.cn" 119 | source: hosted 120 | version: "2.1.1" 121 | flutter_page_indicator: 122 | dependency: transitive 123 | description: 124 | name: flutter_page_indicator 125 | url: "https://pub.flutter-io.cn" 126 | source: hosted 127 | version: "0.0.3" 128 | flutter_screenutil: 129 | dependency: "direct main" 130 | description: 131 | name: flutter_screenutil 132 | url: "https://pub.flutter-io.cn" 133 | source: hosted 134 | version: "1.1.0" 135 | flutter_staggered_grid_view: 136 | dependency: "direct main" 137 | description: 138 | name: flutter_staggered_grid_view 139 | url: "https://pub.flutter-io.cn" 140 | source: hosted 141 | version: "0.3.0" 142 | flutter_statusbarcolor: 143 | dependency: "direct main" 144 | description: 145 | name: flutter_statusbarcolor 146 | url: "https://pub.flutter-io.cn" 147 | source: hosted 148 | version: "0.2.3" 149 | flutter_swiper: 150 | dependency: "direct main" 151 | description: 152 | name: flutter_swiper 153 | url: "https://pub.flutter-io.cn" 154 | source: hosted 155 | version: "1.1.6" 156 | flutter_test: 157 | dependency: "direct dev" 158 | description: flutter 159 | source: sdk 160 | version: "0.0.0" 161 | http: 162 | dependency: transitive 163 | description: 164 | name: http 165 | url: "https://pub.flutter-io.cn" 166 | source: hosted 167 | version: "0.12.1" 168 | http_parser: 169 | dependency: transitive 170 | description: 171 | name: http_parser 172 | url: "https://pub.flutter-io.cn" 173 | source: hosted 174 | version: "3.1.4" 175 | intl: 176 | dependency: transitive 177 | description: 178 | name: intl 179 | url: "https://pub.flutter-io.cn" 180 | source: hosted 181 | version: "0.16.1" 182 | matcher: 183 | dependency: transitive 184 | description: 185 | name: matcher 186 | url: "https://pub.flutter-io.cn" 187 | source: hosted 188 | version: "0.12.10-nullsafety.1" 189 | meta: 190 | dependency: transitive 191 | description: 192 | name: meta 193 | url: "https://pub.flutter-io.cn" 194 | source: hosted 195 | version: "1.3.0-nullsafety.3" 196 | path: 197 | dependency: transitive 198 | description: 199 | name: path 200 | url: "https://pub.flutter-io.cn" 201 | source: hosted 202 | version: "1.8.0-nullsafety.1" 203 | path_provider: 204 | dependency: transitive 205 | description: 206 | name: path_provider 207 | url: "https://pub.flutter-io.cn" 208 | source: hosted 209 | version: "1.6.11" 210 | path_provider_linux: 211 | dependency: transitive 212 | description: 213 | name: path_provider_linux 214 | url: "https://pub.flutter-io.cn" 215 | source: hosted 216 | version: "0.0.1+1" 217 | path_provider_macos: 218 | dependency: transitive 219 | description: 220 | name: path_provider_macos 221 | url: "https://pub.flutter-io.cn" 222 | source: hosted 223 | version: "0.0.4+3" 224 | path_provider_platform_interface: 225 | dependency: transitive 226 | description: 227 | name: path_provider_platform_interface 228 | url: "https://pub.flutter-io.cn" 229 | source: hosted 230 | version: "1.0.2" 231 | pedantic: 232 | dependency: transitive 233 | description: 234 | name: pedantic 235 | url: "https://pub.flutter-io.cn" 236 | source: hosted 237 | version: "1.9.0" 238 | platform: 239 | dependency: transitive 240 | description: 241 | name: platform 242 | url: "https://pub.flutter-io.cn" 243 | source: hosted 244 | version: "2.2.1" 245 | plugin_platform_interface: 246 | dependency: transitive 247 | description: 248 | name: plugin_platform_interface 249 | url: "https://pub.flutter-io.cn" 250 | source: hosted 251 | version: "1.0.2" 252 | process: 253 | dependency: transitive 254 | description: 255 | name: process 256 | url: "https://pub.flutter-io.cn" 257 | source: hosted 258 | version: "3.0.13" 259 | rxdart: 260 | dependency: transitive 261 | description: 262 | name: rxdart 263 | url: "https://pub.flutter-io.cn" 264 | source: hosted 265 | version: "0.24.1" 266 | sky_engine: 267 | dependency: transitive 268 | description: flutter 269 | source: sdk 270 | version: "0.0.99" 271 | source_span: 272 | dependency: transitive 273 | description: 274 | name: source_span 275 | url: "https://pub.flutter-io.cn" 276 | source: hosted 277 | version: "1.8.0-nullsafety.2" 278 | sqflite: 279 | dependency: transitive 280 | description: 281 | name: sqflite 282 | url: "https://pub.flutter-io.cn" 283 | source: hosted 284 | version: "1.3.1" 285 | sqflite_common: 286 | dependency: transitive 287 | description: 288 | name: sqflite_common 289 | url: "https://pub.flutter-io.cn" 290 | source: hosted 291 | version: "1.0.2+1" 292 | stack_trace: 293 | dependency: transitive 294 | description: 295 | name: stack_trace 296 | url: "https://pub.flutter-io.cn" 297 | source: hosted 298 | version: "1.10.0-nullsafety.1" 299 | stream_channel: 300 | dependency: transitive 301 | description: 302 | name: stream_channel 303 | url: "https://pub.flutter-io.cn" 304 | source: hosted 305 | version: "2.1.0-nullsafety.1" 306 | string_scanner: 307 | dependency: transitive 308 | description: 309 | name: string_scanner 310 | url: "https://pub.flutter-io.cn" 311 | source: hosted 312 | version: "1.1.0-nullsafety.1" 313 | synchronized: 314 | dependency: transitive 315 | description: 316 | name: synchronized 317 | url: "https://pub.flutter-io.cn" 318 | source: hosted 319 | version: "2.2.0+1" 320 | term_glyph: 321 | dependency: transitive 322 | description: 323 | name: term_glyph 324 | url: "https://pub.flutter-io.cn" 325 | source: hosted 326 | version: "1.2.0-nullsafety.1" 327 | test_api: 328 | dependency: transitive 329 | description: 330 | name: test_api 331 | url: "https://pub.flutter-io.cn" 332 | source: hosted 333 | version: "0.2.19-nullsafety.2" 334 | transformer_page_view: 335 | dependency: transitive 336 | description: 337 | name: transformer_page_view 338 | url: "https://pub.flutter-io.cn" 339 | source: hosted 340 | version: "0.1.6" 341 | typed_data: 342 | dependency: transitive 343 | description: 344 | name: typed_data 345 | url: "https://pub.flutter-io.cn" 346 | source: hosted 347 | version: "1.3.0-nullsafety.3" 348 | uuid: 349 | dependency: transitive 350 | description: 351 | name: uuid 352 | url: "https://pub.flutter-io.cn" 353 | source: hosted 354 | version: "2.1.0" 355 | vector_math: 356 | dependency: transitive 357 | description: 358 | name: vector_math 359 | url: "https://pub.flutter-io.cn" 360 | source: hosted 361 | version: "2.1.0-nullsafety.3" 362 | xdg_directories: 363 | dependency: transitive 364 | description: 365 | name: xdg_directories 366 | url: "https://pub.flutter-io.cn" 367 | source: hosted 368 | version: "0.1.0" 369 | sdks: 370 | dart: ">=2.10.0-110 <2.11.0" 371 | flutter: ">=1.12.13+hotfix.5 <2.0.0" 372 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------