main.dart import 'package:flutter/material.dart'; import 'routes/router.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget { MyApp({Key key}) : super(key: key); _MyAppState createState() => _MyAppState(); } class _MyAppState e…
Flutter和Dart交流学习群:交流群:452892873 01Flutter仿京东商城项目 功能分析.底部导航Tab切换以及路由配置.架构搭建 02Flutter仿京东商城项目 首页布局以及不同终端屏幕适配方案 基本架构: Tabs.dart代码: import 'package:flutter/material.dart'; import 'Home.dart'; import 'Cart.dart'; import 'Category.dart'; import 'User.dart'…
Storage.dart import 'package:shared_preferences/shared_preferences.dart'; class Storage{ static Future<void> setString(key,value) async{ SharedPreferences sp=await SharedPreferences.getInstance(); sp.setString(key, value); } static Future<String&…
ProductList.dart import 'package:flutter/material.dart'; import '../services/ScreenAdaper.dart'; import '../config/Config.dart'; import 'package:dio/dio.dart'; import '../model/ProductModel.dart'; import '../widget/LoadingWidget.dart'; class ProductL…
Search.dart import 'package:flutter/material.dart'; import 'package:flutter_jdshop/services/ScreenAdaper.dart'; class SearchPage extends StatefulWidget { SearchPage({Key key}) : super(key: key); _SearchPageState createState() => _SearchPageState(); }…
效果: widget/JdButton.dart import 'package:flutter/material.dart'; import '../services/ScreenAdaper.dart'; class JdButton extends StatelessWidget { final Color color; final String text; final Object cb; JdButton({Key key,this.color=Colors.black,this.te…
ProductContent.dart import 'package:flutter/material.dart'; import '../services/ScreenAdaper.dart'; import 'ProductContent/ProductContentFirst.dart'; import 'ProductContent/ProductContentSecond.dart'; import 'ProductContent/ProductContentThird.dart';…
Flutter实战(交流群:452892873) 本项目是一个实战项目,根据目录建文件,并复制从第一节到最新更新的文章,可以构成完整的一个请求后台数据的项目: CateModel.dart class CateModel { List<CateItemModel> result; CateModel({this.result}); CateModel.fromJson(Map<String, dynamic> json) { if (json['result'] != null)…
CheckOut.dart import 'package:flutter/material.dart'; import '../services/ScreenAdapter.dart'; import 'package:provider/provider.dart'; import '../provider/CheckOut.dart'; import '../services/UserServices.dart'; import '../services/SignServices.dart'…
加群452892873 下载对应41课文件,运行方法,建好项目,直接替换lib目录 AddressAdd.dart import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_jdshop/config/Config.dart'; import 'package:flutter_jdshop/services/EventBus.dart'; import 'packa…