Browse Source

7.4 分离model 做出登录页面 初步完成开台页面

Rice 2 years ago
parent
commit
5f9894c432
13 changed files with 654 additions and 151 deletions
  1. 3 0
      README.md
  2. 1 1
      android/app/build.gradle
  3. 1 0
      android/settings_aar.gradle
  4. 27 0
      lib/Staff.dart
  5. 45 0
      lib/Welcome.dart
  6. 270 0
      lib/login.dart
  7. 33 147
      lib/main.dart
  8. 40 0
      lib/models/table.dart
  9. 27 0
      lib/models/user.dart
  10. 44 3
      lib/order.dart
  11. 90 0
      lib/table.dart
  12. 69 0
      pubspec.lock
  13. 4 0
      pubspec.yaml

+ 3 - 0
README.md

@@ -14,3 +14,6 @@ A few resources to get you started if this is your first Flutter project:
 For help getting started with Flutter, view our
 [online documentation](https://flutter.dev/docs), which offers tutorials,
 samples, guidance on mobile development, and a full API reference.
+
+### VSCode FOREVER!!!
+

+ 1 - 1
android/app/build.gradle

@@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {
 
 def flutterRoot = localProperties.getProperty('flutter.sdk')
 if (flutterRoot == null) {
-    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
+    throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
 }
 
 def flutterVersionCode = localProperties.getProperty('flutter.versionCode')

+ 1 - 0
android/settings_aar.gradle

@@ -0,0 +1 @@
+include ':app'

+ 27 - 0
lib/Staff.dart

@@ -0,0 +1,27 @@
+import 'package:flutter/material.dart';
+
+///STAFF START
+class StaffInfoPage extends StatefulWidget {
+  static const routeName = '/staff';
+
+  @override
+  State<StatefulWidget> createState() => _StaffInfoState();
+}
+
+class _StaffInfoState extends State<StaffInfoPage> {
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        title: Text("员工信息"),
+      ),
+      body: Container(
+        child: Center(
+          child: Text("STAFF INFORMATION"),
+        ),
+      ),
+    );
+  }
+}
+
+/// STAFF END

+ 45 - 0
lib/Welcome.dart

@@ -0,0 +1,45 @@
+import 'package:flutter/material.dart';
+import 'package:fooddeliveryapp/table.dart';
+import 'package:provider/provider.dart';
+
+import 'Staff.dart';
+import 'login.dart';
+import 'models/user.dart';
+import 'order.dart';
+
+class WelcomePage extends StatelessWidget {
+  static const routeName = '/welcome';
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        automaticallyImplyLeading: false,
+        title: Text("点餐软件首页"),
+      ),
+      body: Consumer<UserStatus>(builder: (context, userStatus, child) {
+        return Column(
+          children: <Widget>[
+            GestureDetector(
+              child: IndexCard("OPEN", "开始自主点餐,并进行结算"),
+              onTap: () {
+                if (userStatus.value)
+                  Navigator.pushNamed(context, TablePage.routeName);
+                else
+                  Navigator.pushNamed(context, LoginPage.routeName);
+              },
+            ),
+            GestureDetector(
+                child: IndexCard("STAFF", "设备员工信息"),
+                onTap: () {
+                  if (userStatus.value)
+                    Navigator.pushNamed(context, StaffInfoPage.routeName);
+                  else
+                    Navigator.pushNamed(context, LoginPage.routeName);
+                })
+          ],
+        );
+      }),
+    );
+  }
+}

+ 270 - 0
lib/login.dart

@@ -0,0 +1,270 @@
+import 'package:flutter/material.dart';
+import 'package:fluttertoast/fluttertoast.dart';
+import 'package:provider/provider.dart';
+
+import 'Welcome.dart';
+import 'models/user.dart';
+
+class LoginPage extends StatefulWidget {
+  static const routeName = "/";
+
+  @override
+  _LoginPageState createState() {
+    return _LoginPageState();
+  }
+}
+
+class _LoginPageState extends State<LoginPage> {
+  TextEditingController _pwdEditController;
+  TextEditingController _userNameEditController;
+
+  final FocusNode _userNameFocusNode = FocusNode();
+  final FocusNode _pwdFocusNode = FocusNode();
+
+  @override
+  void initState() {
+    super.initState();
+
+    _pwdEditController = TextEditingController();
+    _userNameEditController = TextEditingController();
+
+    _pwdEditController.addListener(() => setState(() => {}));
+    _userNameEditController.addListener(() => setState(() => {}));
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    final loginStatus = Provider.of<UserStatus>(context);
+    return Scaffold(
+      appBar: AppBar(
+        leading: Icon(Icons.settings),
+        title: Text("STAFF LOGIN"),
+        backgroundColor: Colors.amber,
+        elevation: 0,
+      ),
+      body: SingleChildScrollView(
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: <Widget>[
+            buildTopWidget(context),
+            SizedBox(
+              height: 80,
+            ),
+            buildEditWidget(context),
+            buildLoginButton(loginStatus)
+          ],
+        ),
+      ),
+    );
+  }
+
+  /// 头部
+  Widget buildTopWidget(BuildContext context) {
+    double height = 200.0;
+    double width = MediaQuery.of(context).size.width;
+    return Container(
+      width: width,
+      height: height,
+      color: Colors.amber,
+      child: Stack(
+        overflow: Overflow.visible, // 超出部分显示
+        children: <Widget>[
+          Positioned(
+            left: (width - 90) / 2.0,
+            top: height - 45,
+            child: Container(
+              width: 90.0,
+              height: 90.0,
+              decoration: BoxDecoration(
+                ///阴影
+                boxShadow: [
+                  BoxShadow(color: Theme.of(context).cardColor, blurRadius: 4.0)
+                ],
+
+                ///形状
+                shape: BoxShape.circle,
+
+                ///图片
+                image: DecorationImage(
+                  fit: BoxFit.cover,
+                  image: NetworkImage(
+                     'https://picsum.photos/id/1/150'),
+                ),
+              ),
+            ),
+          )
+        ],
+      ),
+    );
+  }
+
+  Widget buildEditWidget(BuildContext context) {
+    return Container(
+      margin: EdgeInsets.only(left: 15, right: 15),
+      child: Column(
+        children: <Widget>[
+          buildLoginNameTextField(),
+          SizedBox(height: 20.0),
+          buildPwdTextField(),
+        ],
+      ),
+    );
+  }
+
+  Widget buildLoginNameTextField() {
+    return Container(
+      height: 40,
+      decoration: BoxDecoration(
+        color: Colors.grey[200],
+        borderRadius: BorderRadius.all(Radius.circular(20.0)),
+      ),
+      child: Stack(
+        children: <Widget>[
+          Positioned(
+            left: 16,
+            top: 11,
+            width: 18,
+            height: 18,
+            child: Icon(Icons.supervised_user_circle),
+          ),
+          Positioned(
+            left: 45,
+            top: 10,
+            bottom: 10,
+            width: 1,
+            child: Container(
+              color: Colors.black,
+            ),
+          ),
+          Positioned(
+            left: 55,
+            right: 10,
+            top: 10,
+            height: 30,
+            child: TextField(
+              controller: _userNameEditController,
+              focusNode: _userNameFocusNode,
+              decoration: InputDecoration(
+                hintText: "请输入用户名",
+                border: InputBorder.none,
+              ),
+              style: TextStyle(fontSize: 14),
+            ),
+          )
+        ],
+      ),
+    );
+  }
+
+  Widget buildPwdTextField() {
+    return Container(
+        height: 40,
+        decoration: BoxDecoration(
+          color: Colors.grey[200],
+          borderRadius: BorderRadius.all(Radius.circular(20.0)),
+        ),
+        child: Stack(
+          children: <Widget>[
+            Positioned(
+              left: 16,
+              top: 11,
+              width: 18,
+              height: 18,
+              child: Icon(Icons.security),
+            ),
+            Positioned(
+              left: 45,
+              top: 10,
+              bottom: 10,
+              width: 1,
+              child: Container(
+                color: Colors.black,
+              ),
+            ),
+            Positioned(
+              left: 55,
+              right: 10,
+              top: 10,
+              height: 30,
+              child: TextField(
+                controller: _pwdEditController,
+                focusNode: _pwdFocusNode,
+                decoration: InputDecoration(
+                  hintText: "请输入密码",
+                  border: InputBorder.none,
+                ),
+                style: TextStyle(fontSize: 14),
+                obscureText: true,
+
+                /// 设置密码
+              ),
+            )
+          ],
+        ));
+  }
+
+  Widget buildLoginButton(UserStatus loginStatus) {
+    return Container(
+      margin: EdgeInsets.only(top: 40, left: 10, right: 10),
+      padding: EdgeInsets.all(0),
+      width: MediaQuery.of(context).size.width - 20,
+      height: 40,
+      child: RaisedButton(
+        onPressed: () {
+          print("【LoginPage】尝试登陆...");
+          if (checkInput()) {
+            Fluttertoast.showToast(
+                msg: "登录成功",
+                gravity: ToastGravity.CENTER,
+                timeInSecForIos: 2,
+                textColor: Colors.white,
+                fontSize: 14.0);
+            loginStatus.value = true;
+//            print("loginStatus" + loginStatus.value);
+//            Navigator.popAndPushNamed(context, OrderPage.routeName);
+            print("【LoginPage】登陆完成,即将进行路由跳转...");
+            Navigator.popAndPushNamed(context, WelcomePage.routeName);
+          } else {
+            Fluttertoast.showToast(
+                msg: "账号或密码错误",
+                gravity: ToastGravity.CENTER,
+                timeInSecForIos: 2,
+                textColor: Colors.white,
+                fontSize: 14.0);
+          }
+        },
+        child: Text("登录"),
+        color: Colors.amber,
+        textColor: Colors.white,
+        shape: RoundedRectangleBorder(
+          borderRadius: BorderRadius.all(Radius.circular(20.0)),
+        ),
+      ),
+    );
+  }
+
+  bool checkInput() {
+    if (_userNameEditController.text.length == 0) {
+      Fluttertoast.showToast(
+          msg: "请输入用户名",
+          gravity: ToastGravity.CENTER,
+          timeInSecForIos: 2,
+          textColor: Colors.white,
+          fontSize: 14.0);
+
+      return false;
+    } else if (_pwdEditController.text.length == 0) {
+      Fluttertoast.showToast(
+          msg: "请输入密码",
+          gravity: ToastGravity.CENTER,
+          timeInSecForIos: 2,
+          textColor: Colors.white,
+          fontSize: 14.0);
+      return false;
+    }
+
+    return _userNameEditController.text == '1001' &&
+        _pwdEditController.text == '1001';
+  }
+}
+

+ 33 - 147
lib/main.dart

@@ -1,5 +1,13 @@
 import 'package:flutter/material.dart';
-//import 'package:fooddeliveryapp/order.dart';
+import 'package:fooddeliveryapp/login.dart';
+import 'package:fooddeliveryapp/order.dart';
+import 'package:fooddeliveryapp/table.dart';
+import 'package:provider/provider.dart';
+
+import 'Staff.dart';
+import 'Welcome.dart';
+import 'models/table.dart';
+import 'models/user.dart';
 
 void main() => runApp(MyApp());
 
@@ -7,155 +15,33 @@ class MyApp extends StatelessWidget {
   // This widget is the root of your application.
   @override
   Widget build(BuildContext context) {
-    return MaterialApp(
-      routes: {
-        WelcomePage.routeName: (context) {
-          return WelcomePage();
-        },
-        OrderPage.routeName: (context) => OrderPage(),
-        StaffInfoPage.routeName: (context) => StaffInfoPage()
-      },
-      title: '点餐软件demo',
-      theme: ThemeData(
-        // This is the theme of your application.
-        //
-        // Try running your application with "flutter run". You'll see the
-        // application has a blue toolbar. Then, without quitting the app, try
-        // changing the primarySwatch below to Colors.green and then invoke
-        // "hot reload" (press "r" in the console where you ran "flutter run",
-        // or simply save your changes to "hot reload" in a Flutter IDE).
-        // Notice that the counter didn't reset back to zero; the application
-        // is not restarted.
-        primarySwatch: Colors.red,
-      ),
-//      home: MyHomePage(title: '点餐软件首页'),
-    );
-  }
-}
-
-class WelcomePage extends StatelessWidget {
-  static const routeName = '/';
-
-  @override
-  Widget build(BuildContext context) {
-    // TODO: implement build
-    return Scaffold(
-      appBar: AppBar(
-        title: Text("点餐软件首页"),
-      ),
-      body: Column(
-        children: <Widget>[
-          GestureDetector(
-            child: IndexCard("开台", "开始自主点餐,并进行结算"),
-            onTap: () => Navigator.pushNamed(context, OrderPage.routeName),
-          ),
-          GestureDetector(
-            child: IndexCard("STAFF", "设备员工信息"),
-            onTap: () => Navigator.pushNamed(context, StaffInfoPage.routeName),
-          )
-        ],
-      ),
-    );
-  }
-}
-
-///Order START
-class IndexCard extends StatelessWidget {
-  var title;
-  var description;
-
-  IndexCard(this.title, this.description);
-
-  @override
-  Widget build(BuildContext context) {
-    // TODO: implement build
-    return Container(
-      padding: EdgeInsets.fromLTRB(12, 12, 12, 0),
-      child: Card(
-//          shape: RoundedRectangleBorder(
-//            borderRadius: BorderRadius.circular(15.0),
-//          ),
-          color: Colors.amber,
-          elevation: 10,
-          child: Container(
-            padding: EdgeInsets.fromLTRB(15, 15, 15, 15),
-            child: Column(
-              mainAxisSize: MainAxisSize.min,
-              children: <Widget>[
-                Row(
-                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                  children: <Widget>[
-                    Text(
-                      title,
-                      style: TextStyle(fontSize: 30),
-                    ),
-                    Text(title),
-                    Text(title)
-                  ],
-                ),
-                Row(
-                  children: <Widget>[
-                    Icon(Icons.border_color),
-                    Text(description)
-                  ],
-                )
-              ],
-            ),
-          )),
-    );
-  }
-}
-
-class OrderPage extends StatefulWidget {
-  static const routeName = '/order';
-
-  @override
-  State<StatefulWidget> createState() {
-    // TODO: implement createState
-    return _OrderPageState();
-  }
-}
-
-class _OrderPageState extends State<OrderPage> {
-  @override
-  Widget build(BuildContext context) {
-    // TODO: implement build
-    return Scaffold(
-      appBar: AppBar(title: Text("点单页面")),
-      body: Center(
-        child: Column(
-          children: <Widget>[Text("order页面")],
+    return MultiProvider(
+      providers: [
+        ChangeNotifierProvider(
+          create: (context) => UserStatus(),
         ),
-      ),
-    );
-  }
-}
-
-/// order END
-
-///STAFF START
-class StaffInfoPage extends StatefulWidget {
-  static const routeName = '/staff';
-
-  @override
-  State<StatefulWidget> createState() => _staffInfoState();
-}
-
-class _staffInfoState extends State<StaffInfoPage> {
-  @override
-  Widget build(BuildContext context) {
-    // TODO: implement build
-    return Scaffold(
-      appBar: AppBar(
-        title: Text("员工信息"),
-      ),
-      body: Container(
-        child: Center(
-          child: Text("STAFF INFORMATION"),
+        ChangeNotifierProvider(
+          create: (context) => TableStatusList(),
+        )
+      ],
+      child: MaterialApp(
+        routes: {
+          //登录页面
+          LoginPage.routeName: (context) => LoginPage(),
+          //登录后的首页
+          WelcomePage.routeName: (context) => WelcomePage(),
+          //订单页面
+          OrderPage.routeName: (context) => OrderPage(),
+          //员工信息页面
+          StaffInfoPage.routeName: (context) => StaffInfoPage(),
+          //开台页面
+          TablePage.routeName: (context) => TablePage()
+        },
+        title: '点餐软件demo',
+        theme: ThemeData(
+          primarySwatch: Colors.red,
         ),
       ),
     );
   }
 }
-
-/// STAFF END

+ 40 - 0
lib/models/table.dart

@@ -0,0 +1,40 @@
+import 'dart:collection';
+
+import 'package:flutter/material.dart';
+
+//所有桌状态
+class TableStatusList with ChangeNotifier {
+  Map<int, TableStatus> _tableStatusMap = HashMap();
+
+  get tableMap => _tableStatusMap;
+
+  int size() => _tableStatusMap.length;
+
+  bool isopen(int index) {
+    if (_tableStatusMap != null && _tableStatusMap[index] != null)
+      return _tableStatusMap[index].isopen;
+    else
+      return false;
+  }
+
+  addtable(TableStatus tableStatus) {
+    _tableStatusMap[tableStatus.id] = tableStatus;
+  }
+
+  deletetable(int index) {
+    _tableStatusMap.remove(index);
+  }
+}
+
+//桌状态
+class TableStatus {
+  TableStatus(this.id);
+
+  int id;
+
+  bool isopen = false;
+
+  double amount = 0;
+}
+
+// class OrderDetails {}

+ 27 - 0
lib/models/user.dart

@@ -0,0 +1,27 @@
+import 'package:flutter/material.dart';
+
+///存储页面间的共享数据
+
+//用户登录状态
+class UserStatus with ChangeNotifier {
+  bool _loginStatus = false;
+  String _userName;
+  int _performance;
+
+  get value => _loginStatus;
+
+  get name => _userName;
+
+  get perfromace => _performance;
+
+  set name(String name) {
+    _userName = name;
+    notifyListeners();
+  }
+
+  set value(bool newStatus) {
+    _loginStatus = newStatus;
+    notifyListeners();
+  }
+}
+

+ 44 - 3
lib/order.dart

@@ -1,13 +1,53 @@
 import 'package:flutter/material.dart';
 
-//main() => runApp(OrderPage());
+///Order START
+class IndexCard extends StatelessWidget {
+  final String title;
+  final String description;
+
+  IndexCard(this.title, this.description);
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      padding: EdgeInsets.fromLTRB(12, 12, 12, 0),
+      child: Card(
+          color: Colors.amber,
+          elevation: 10,
+          child: Container(
+            padding: EdgeInsets.fromLTRB(15, 15, 15, 15),
+            child: Column(
+              mainAxisSize: MainAxisSize.min,
+              children: <Widget>[
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: <Widget>[
+                    Text(
+                      title,
+                      style: TextStyle(fontSize: 30),
+                    ),
+                    Text(title),
+                    Text(title)
+                  ],
+                ),
+                Row(
+                  children: <Widget>[
+                    Icon(Icons.border_color),
+                    Text(description)
+                  ],
+                )
+              ],
+            ),
+          )),
+    );
+  }
+}
 
 class OrderPage extends StatefulWidget {
   static const routeName = '/order';
 
   @override
   State<StatefulWidget> createState() {
-    // TODO: implement createState
     return _OrderPageState();
   }
 }
@@ -15,7 +55,6 @@ class OrderPage extends StatefulWidget {
 class _OrderPageState extends State<OrderPage> {
   @override
   Widget build(BuildContext context) {
-    // TODO: implement build
     return Scaffold(
       appBar: AppBar(title: Text("点单页面")),
       body: Center(
@@ -26,3 +65,5 @@ class _OrderPageState extends State<OrderPage> {
     );
   }
 }
+
+/// order END

+ 90 - 0
lib/table.dart

@@ -0,0 +1,90 @@
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+
+import 'models/table.dart';
+
+class TablePage extends StatefulWidget {
+  static const String routeName = '/table';
+
+  @override
+  State<StatefulWidget> createState() {
+    return _TableState();
+  }
+}
+
+class _TableState extends State<TablePage> {
+  @override
+  Widget build(BuildContext context) {
+    return Consumer<TableStatusList>(
+        builder: (context, tableStatusList, child) {
+      return Scaffold(
+          body: NestedScrollView(
+        headerSliverBuilder: (context, bool innerBoxIsScrolled) {
+          return <Widget>[
+            SliverAppBar(
+              primary: true,
+              expandedHeight: 200,
+              pinned: true,
+              floating: true,
+              snap: false,
+              flexibleSpace: _getFlexBar(tableStatusList),
+            )
+          ];
+        },
+        body: _getTableItems(tableStatusList),
+      ));
+    });
+  }
+
+  _getFlexBar(TableStatusList tableStatusList) {
+    return FlexibleSpaceBar(
+      title: Column(
+        mainAxisSize: MainAxisSize.min,
+        children: <Widget>[
+          Text('目前开台数:' + tableStatusList.size().toString(),
+              style: TextStyle(fontSize: 12)),
+          Text(
+            '剩余空位:'+(30-tableStatusList.size()).toString(),
+            style: TextStyle(fontSize: 10),
+          ),
+        ],
+      ),
+      background: Image.network(
+        'https://picsum.photos/200/300/?blur',
+        fit: BoxFit.fill,
+      ),
+    );
+  }
+
+  _getTableItems(tableStatusList) {
+    return GridView.extent(
+        maxCrossAxisExtent: 150,
+        padding: EdgeInsets.all(4),
+        mainAxisSpacing: 4,
+        crossAxisSpacing: 4,
+        children: _buildGridTileList(30, tableStatusList));
+  }
+
+/*
+* 单写了一个私有方法,创建指定数量的组件
+* */
+  List<Widget> _buildGridTileList(int count, TableStatusList tableStatusList) {
+    List<Widget> containers = [];
+    for (var i = 0; i < count; i++) {
+      // var image = Image.network('https://picsum.photos/id/$i/150');
+      // containers.add(image);
+      containers.add(GestureDetector(
+        child: Text(tableStatusList.isopen(i).toString() + "$i"),
+        onTap: () {
+          if (tableStatusList.isopen(i)) {
+            //进行开台
+            print("$i");
+          } else {
+            print("该桌未开台=> " + "$i");
+          }
+        },
+      ));
+    }
+    return containers;
+  }
+}

+ 69 - 0
pubspec.lock

@@ -74,6 +74,32 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  flutter_web_plugins:
+    dependency: transitive
+    description: flutter
+    source: sdk
+    version: "0.0.0"
+  fluttertoast:
+    dependency: "direct main"
+    description:
+      name: fluttertoast
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "3.1.3"
+  http:
+    dependency: "direct main"
+    description:
+      name: http
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.12.1"
+  http_parser:
+    dependency: transitive
+    description:
+      name: http_parser
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "3.1.4"
   image:
     dependency: transitive
     description:
@@ -95,6 +121,13 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "1.1.8"
+  nested:
+    dependency: transitive
+    description:
+      name: nested
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.0.4"
   path:
     dependency: transitive
     description:
@@ -116,6 +149,13 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "2.4.0"
+  provider:
+    dependency: "direct main"
+    description:
+      name: provider
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "4.0.5+1"
   quiver:
     dependency: transitive
     description:
@@ -123,6 +163,34 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "2.0.5"
+  shared_preferences:
+    dependency: "direct main"
+    description:
+      name: shared_preferences
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.5.7+3"
+  shared_preferences_macos:
+    dependency: transitive
+    description:
+      name: shared_preferences_macos
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.0.1+10"
+  shared_preferences_platform_interface:
+    dependency: transitive
+    description:
+      name: shared_preferences_platform_interface
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "1.0.4"
+  shared_preferences_web:
+    dependency: transitive
+    description:
+      name: shared_preferences_web
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "0.1.2+7"
   sky_engine:
     dependency: transitive
     description: flutter
@@ -193,3 +261,4 @@ packages:
     version: "3.5.0"
 sdks:
   dart: ">=2.4.0 <3.0.0"
+  flutter: ">=1.12.13+hotfix.5 <2.0.0"

+ 4 - 0
pubspec.yaml

@@ -23,6 +23,10 @@ dependencies:
   # The following adds the Cupertino Icons font to your application.
   # Use with the CupertinoIcons class for iOS style icons.
   cupertino_icons: ^0.1.2
+  provider: ^4.0.5+1
+  http: ^0.12.1
+  shared_preferences: ^0.5.7+2
+  fluttertoast: ^3.0.3
 
 dev_dependencies:
   flutter_test: