feat(migrate): 将之前写好的部件迁移了过来
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -44,3 +44,6 @@ app.*.map.json
|
|||||||
/android/app/debug
|
/android/app/debug
|
||||||
/android/app/profile
|
/android/app/profile
|
||||||
/android/app/release
|
/android/app/release
|
||||||
|
|
||||||
|
*.properties
|
||||||
|
.gradle
|
||||||
@@ -45,7 +45,7 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "cn.org.novo.bistro"
|
applicationId "cn.org.novo.bistro"
|
||||||
minSdkVersion flutter.minSdkVersion
|
minSdkVersion 19
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
|
|||||||
25
lib/app.dart
Normal file
25
lib/app.dart
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'layout/LayoutScaffold.dart';
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 应用页
|
||||||
|
///
|
||||||
|
class App extends StatefulWidget {
|
||||||
|
const App({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<StatefulWidget> createState() => _AppState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AppState extends State<App> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// TODO: implement build
|
||||||
|
return LayoutScaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('应用'),
|
||||||
|
),
|
||||||
|
body: null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
103
lib/common/access_control_filter.dart
Normal file
103
lib/common/access_control_filter.dart
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'global.dart';
|
||||||
|
import 'package:bistro/mine/login.dart';
|
||||||
|
|
||||||
|
typedef ACFCallback = Future Function(Map userInfo);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 登录状态检查
|
||||||
|
///
|
||||||
|
class AccessControlFilter extends StatefulWidget {
|
||||||
|
/// 头部
|
||||||
|
final AppBar? appBar;
|
||||||
|
|
||||||
|
/// 标题
|
||||||
|
final String? title;
|
||||||
|
|
||||||
|
/// 内容组件
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
/// 未登录的显示
|
||||||
|
final Widget? didNotLoginWidget;
|
||||||
|
|
||||||
|
const AccessControlFilter({
|
||||||
|
required Key key,
|
||||||
|
this.appBar,
|
||||||
|
this.title,
|
||||||
|
required this.child,
|
||||||
|
this.didNotLoginWidget,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AccessControlFilterState createState() => _AccessControlFilterState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AccessControlFilterState extends State<AccessControlFilter> {
|
||||||
|
/// 登录状态
|
||||||
|
bool _isLogin = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
_updateUserState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(AccessControlFilter oldWidget) {
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
_updateUserState();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 更新用户信息
|
||||||
|
void _updateUserState({data}) {
|
||||||
|
// final Map userInfo = data != null ? data : UserInfo().userInfo;
|
||||||
|
// final bool isLogin = userInfo != null && userInfo.length != 0;
|
||||||
|
// setState(() {
|
||||||
|
// _isLogin = isLogin;
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 未登录的显示
|
||||||
|
Widget? _didNotLoginWidget() {
|
||||||
|
// 如果传入的未登录情况下显示的组件,则采用传入的
|
||||||
|
if (widget.didNotLoginWidget != null) return widget.didNotLoginWidget;
|
||||||
|
|
||||||
|
// 缺省的未登录情况下的显示
|
||||||
|
return Center(
|
||||||
|
child: RaisedButton(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
textTheme: ButtonTextTheme.primary,
|
||||||
|
child: const Text('请先登录'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Login(
|
||||||
|
successCallback: (Map data) {
|
||||||
|
_updateUserState(data: data);
|
||||||
|
printWhenDebug('登录成功');
|
||||||
|
},
|
||||||
|
key: widget.key ?? const Key('acf'),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: widget.appBar ??
|
||||||
|
AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
title: Text(widget.title ?? ""),
|
||||||
|
),
|
||||||
|
body: _isLogin ? widget.child : _didNotLoginWidget(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
112
lib/common/global.dart
Normal file
112
lib/common/global.dart
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:dio_http_cache/dio_http_cache.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
// 提供五套可选主题色
|
||||||
|
const _themes = <MaterialColor>[
|
||||||
|
Colors.blue,
|
||||||
|
Colors.cyan,
|
||||||
|
Colors.teal,
|
||||||
|
Colors.green,
|
||||||
|
Colors.red,
|
||||||
|
];
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 当调试模式打开时打印
|
||||||
|
///
|
||||||
|
void printWhenDebug(Object object) {
|
||||||
|
if (Global.debug) {
|
||||||
|
if (kDebugMode) {
|
||||||
|
print(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 当前环境
|
||||||
|
///
|
||||||
|
enum Env {
|
||||||
|
dev,
|
||||||
|
pro,
|
||||||
|
}
|
||||||
|
|
||||||
|
class Global {
|
||||||
|
static SharedPreferences? _prefs;
|
||||||
|
static Dio? dio;
|
||||||
|
static Map profile = {};
|
||||||
|
static bool debug = false;
|
||||||
|
///
|
||||||
|
/// 当前环境
|
||||||
|
///
|
||||||
|
static const Env env = Env.dev;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 根域名
|
||||||
|
///
|
||||||
|
static const Map baseUrlList = {
|
||||||
|
Env.dev: 'http://safe.doylee.cn',
|
||||||
|
// Env.dev: 'http://192.168.31.189/campus_safety',
|
||||||
|
Env.pro: 'http://10.111.2.158',
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 接口根路由
|
||||||
|
///
|
||||||
|
static String baseUrl = baseUrlList[env];
|
||||||
|
|
||||||
|
// 网络缓存对象
|
||||||
|
static DioCacheManager netCache = DioCacheManager(
|
||||||
|
CacheConfig(
|
||||||
|
baseUrl: baseUrl,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// 可选的主题列表
|
||||||
|
static List<MaterialColor> get themes => _themes;
|
||||||
|
|
||||||
|
// 是否为release版
|
||||||
|
static bool get isRelease => bool.fromEnvironment("dart.vm.product");
|
||||||
|
|
||||||
|
//初始化全局信息,会在APP启动时执行
|
||||||
|
static Future init() async {
|
||||||
|
dio = Dio();
|
||||||
|
// 添加拦截器
|
||||||
|
dio?.interceptors.add(netCache.interceptor);
|
||||||
|
|
||||||
|
// 初始化用户信息
|
||||||
|
_prefs = await SharedPreferences.getInstance();
|
||||||
|
var _profile = _prefs?.getString("user_info");
|
||||||
|
if (_profile != null) {
|
||||||
|
try {
|
||||||
|
if (kDebugMode) {
|
||||||
|
print('开始读取用户信息...');
|
||||||
|
}
|
||||||
|
profile = jsonDecode(_profile);
|
||||||
|
if (kDebugMode) {
|
||||||
|
print('用户信息读取成功');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
if (kDebugMode) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 持久化Profile信息
|
||||||
|
static Future<bool>? saveProfile({required Map userInfo}) {
|
||||||
|
profile = userInfo;
|
||||||
|
final userJson = jsonEncode(userInfo);
|
||||||
|
return _prefs?.setString("user_info", userJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 读取持久化Profile信息
|
||||||
|
static Future<Map> getProfile() {
|
||||||
|
return jsonDecode(_prefs?.getString("user_info") ?? '{}');
|
||||||
|
}
|
||||||
|
}
|
||||||
34
lib/layout/LayoutScaffold.dart
Normal file
34
lib/layout/LayoutScaffold.dart
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class LayoutScaffold extends StatelessWidget {
|
||||||
|
final AppBar appBar;
|
||||||
|
final Widget? body;
|
||||||
|
|
||||||
|
const LayoutScaffold({
|
||||||
|
Key? key,
|
||||||
|
required this.appBar,
|
||||||
|
this.body,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Text title = appBar.title as Text;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: PreferredSize(
|
||||||
|
child: AppBar(
|
||||||
|
title: Text(
|
||||||
|
title.data ?? '',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 30,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
centerTitle: true,
|
||||||
|
bottom: appBar.bottom,
|
||||||
|
),
|
||||||
|
preferredSize: appBar.preferredSize,
|
||||||
|
),
|
||||||
|
body: body,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
111
lib/life.dart
Normal file
111
lib/life.dart
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:bistro/layout/LayoutScaffold.dart';
|
||||||
|
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||||
|
|
||||||
|
class Life extends StatelessWidget {
|
||||||
|
const Life({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutScaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('讨论'),
|
||||||
|
bottom: PreferredSize(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
preferredSize: const Size.fromHeight(50),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: MasonryGridView.count(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
itemBuilder: cardBuilder,
|
||||||
|
padding: const EdgeInsets.only(top: 23),
|
||||||
|
mainAxisSpacing: 12.0,
|
||||||
|
crossAxisSpacing: 3.0,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget cardBuilder(BuildContext context, int index) {
|
||||||
|
return Card(
|
||||||
|
elevation: 4,
|
||||||
|
color: Theme.of(context).backgroundColor,
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
InkWell(
|
||||||
|
child: Image.asset(
|
||||||
|
[
|
||||||
|
'res/assets/images/logo.jpg',
|
||||||
|
'res/assets/images/dololo.jpg',
|
||||||
|
'res/assets/images/Spider-Man.jpg',
|
||||||
|
'res/assets/images/ch4o5.png',
|
||||||
|
'res/assets/images/fire.jpg',
|
||||||
|
'res/assets/images/tiefutu.jpg',
|
||||||
|
'res/assets/images/big-dog.jpg',
|
||||||
|
][index % 7],
|
||||||
|
),
|
||||||
|
onTap: () {},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: const Text(
|
||||||
|
'苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉苏月桉',
|
||||||
|
maxLines: 2,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.visible,
|
||||||
|
),
|
||||||
|
isThreeLine: true,
|
||||||
|
subtitle: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
InkWell(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Icons.person_outline,
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'苏月桉苏月桉苏月桉苏月苏月苏月苏月'.substring(0, 11),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {},
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
child: Icon(
|
||||||
|
[
|
||||||
|
Icons.favorite_border,
|
||||||
|
Icons.favorite,
|
||||||
|
][index % 2],
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
),
|
||||||
|
onTap: () {},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
224
lib/main.dart
224
lib/main.dart
@@ -1,115 +1,179 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
// import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
|
import 'app.dart';
|
||||||
|
import 'life.dart';
|
||||||
|
import 'news.dart';
|
||||||
|
import 'mine.dart';
|
||||||
|
import 'router/router.dart';
|
||||||
|
|
||||||
void main() {
|
//import 'common/access_control_filter.dart';
|
||||||
runApp(const MyApp());
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
void main() => runApp(const Bistro());
|
||||||
const MyApp({Key? key}) : super(key: key);
|
|
||||||
|
class Bistro extends StatelessWidget {
|
||||||
|
const Bistro({Key? key}) : super(key: key);
|
||||||
|
|
||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Flutter Demo',
|
title: '小酒馆',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
// This is the theme of your application.
|
fontFamily: "SongTiHeavy",
|
||||||
//
|
primaryColor: const Color(0xFFff857a),
|
||||||
// Try running your application with "flutter run". You'll see the
|
primaryColorDark: Colors.black54,
|
||||||
// application has a blue toolbar. Then, without quitting the app, try
|
backgroundColor: const Color(0xFFFFF7F8),
|
||||||
// changing the primarySwatch below to Colors.green and then invoke
|
bottomAppBarColor: const Color(0xFFFFF7F8),
|
||||||
// "hot reload" (press "r" in the console where you ran "flutter run",
|
appBarTheme: const AppBarTheme(color: Colors.white), colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.amber).copyWith(secondary: Colors.deepOrangeAccent)),
|
||||||
// or simply save your changes to "hot reload" in a Flutter IDE).
|
home: const BistroFrame(title: 'Flutter Demo Home Page', ),
|
||||||
// Notice that the counter didn't reset back to zero; the application
|
// 国际化
|
||||||
// is not restarted.
|
// localizationsDelegates: [
|
||||||
primarySwatch: Colors.blue,
|
// GlobalMaterialLocalizations.delegate,
|
||||||
),
|
// GlobalWidgetsLocalizations.delegate,
|
||||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
// ],
|
||||||
|
// supportedLocales: const [
|
||||||
|
// Locale('zh', 'CN'),
|
||||||
|
// ],
|
||||||
|
// locale: const Locale('zh'),
|
||||||
|
// 路由
|
||||||
|
routes: router,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyHomePage extends StatefulWidget {
|
class BistroFrame extends StatefulWidget {
|
||||||
const MyHomePage({Key? key, required this.title}) : super(key: key);
|
const BistroFrame({Key? key,required this.title}) : super(key: key);
|
||||||
|
|
||||||
// This widget is the home page of your application. It is stateful, meaning
|
|
||||||
// that it has a State object (defined below) that contains fields that affect
|
|
||||||
// how it looks.
|
|
||||||
|
|
||||||
// This class is the configuration for the state. It holds the values (in this
|
|
||||||
// case the title) provided by the parent (in this case the App widget) and
|
|
||||||
// used by the build method of the State. Fields in a Widget subclass are
|
|
||||||
// always marked "final".
|
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MyHomePage> createState() => _MyHomePageState();
|
_BistroFrameState createState() => _BistroFrameState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MyHomePageState extends State<MyHomePage> {
|
class _BistroFrameState extends State<BistroFrame> {
|
||||||
int _counter = 0;
|
late Widget _body;
|
||||||
|
int _index = 0;
|
||||||
|
|
||||||
void _incrementCounter() {
|
void initData() {
|
||||||
setState(() {
|
//页面初始化时要干的事
|
||||||
// This call to setState tells the Flutter framework that something has
|
_body = IndexedStack(
|
||||||
// changed in this State, which causes it to rerun the build method below
|
children: <Widget>[
|
||||||
// so that the display can reflect the updated values. If we changed
|
const App(),
|
||||||
// _counter without calling setState(), then the build method would not be
|
Life(),
|
||||||
// called again, and so nothing would appear to happen.
|
const App(),
|
||||||
_counter++;
|
News(),
|
||||||
});
|
Mine(),
|
||||||
|
],
|
||||||
|
index: _index,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// This method is rerun every time setState is called, for instance as done
|
initData();
|
||||||
// by the _incrementCounter method above.
|
|
||||||
//
|
|
||||||
// The Flutter framework has been optimized to make rerunning build methods
|
|
||||||
// fast, so that you can just rebuild anything that needs updating rather
|
|
||||||
// than having to individually change instances of widgets.
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
body: _body,
|
||||||
// Here we take the value from the MyHomePage object that was created by
|
bottomNavigationBar: BottomAppBar(
|
||||||
// the App.build method, and use it to set our appbar title.
|
shape: const CircularNotchedRectangle(),
|
||||||
title: Text(widget.title),
|
child: Row(
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
// Center is a layout widget. It takes a single child and positions it
|
|
||||||
// in the middle of the parent.
|
|
||||||
child: Column(
|
|
||||||
// Column is also a layout widget. It takes a list of children and
|
|
||||||
// arranges them vertically. By default, it sizes itself to fit its
|
|
||||||
// children horizontally, and tries to be as tall as its parent.
|
|
||||||
//
|
|
||||||
// Invoke "debug painting" (press "p" in the console, choose the
|
|
||||||
// "Toggle Debug Paint" action from the Flutter Inspector in Android
|
|
||||||
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
|
|
||||||
// to see the wireframe for each widget.
|
|
||||||
//
|
|
||||||
// Column has various properties to control how it sizes itself and
|
|
||||||
// how it positions its children. Here we use mainAxisAlignment to
|
|
||||||
// center the children vertically; the main axis here is the vertical
|
|
||||||
// axis because Columns are vertical (the cross axis would be
|
|
||||||
// horizontal).
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Text(
|
bottomAppBarItem(
|
||||||
'You have pushed the button this many times:',
|
index: 0,
|
||||||
|
icon: Icons.apps,
|
||||||
|
title: '应用',
|
||||||
),
|
),
|
||||||
Text(
|
bottomAppBarItem(
|
||||||
'$_counter',
|
index: 1,
|
||||||
style: Theme.of(context).textTheme.headline4,
|
icon: Icons.forum,
|
||||||
|
title: '讨论',
|
||||||
|
),
|
||||||
|
bottomAppBarItem(
|
||||||
|
index: 2,
|
||||||
|
isShow: false,
|
||||||
|
),
|
||||||
|
bottomAppBarItem(
|
||||||
|
index: 3,
|
||||||
|
icon: Icons.business,
|
||||||
|
title: '资讯',
|
||||||
|
),
|
||||||
|
bottomAppBarItem(
|
||||||
|
index: 4,
|
||||||
|
icon: Icons.perm_identity,
|
||||||
|
title: '我的',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: _incrementCounter,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
tooltip: 'Increment',
|
onPressed: () => {},
|
||||||
child: const Icon(Icons.add),
|
child: Icon(
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
Icons.search,
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget bottomAppBarItem({
|
||||||
|
required int index, // 序列
|
||||||
|
IconData? icon, // 图标
|
||||||
|
String? title, // 标签
|
||||||
|
bool isShow = true, // 是否需要显示
|
||||||
|
}) {
|
||||||
|
//设置默认未选中的状态
|
||||||
|
double size = 13;
|
||||||
|
Color color = Colors.black87;
|
||||||
|
|
||||||
|
if (_index == index) {
|
||||||
|
//选中的话
|
||||||
|
size = 15;
|
||||||
|
color = Theme.of(context).primaryColor;
|
||||||
|
}
|
||||||
|
TextStyle style = TextStyle(
|
||||||
|
fontSize: size,
|
||||||
|
);
|
||||||
|
Widget child;
|
||||||
|
if (isShow) {
|
||||||
|
child = GestureDetector(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
width: 25.0,
|
||||||
|
height: 23.0,
|
||||||
|
child: Icon(
|
||||||
|
icon,
|
||||||
|
color: color,
|
||||||
|
size: size * 1.7,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
title!,
|
||||||
|
style: style,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
if (_index != index) {
|
||||||
|
setState(() {
|
||||||
|
_index = index;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
child = Container();
|
||||||
|
}
|
||||||
|
|
||||||
|
//构造返回的Widget
|
||||||
|
return SizedBox(
|
||||||
|
height: 49,
|
||||||
|
width: MediaQuery.of(context).size.width / 5,
|
||||||
|
child: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
lib/mine.dart
Normal file
20
lib/mine.dart
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'layout/LayoutScaffold.dart';
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 【我的】页
|
||||||
|
///
|
||||||
|
class Mine extends StatelessWidget {
|
||||||
|
const Mine({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutScaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('我的'),
|
||||||
|
),
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
lib/mine/login.dart
Normal file
35
lib/mine/login.dart
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 登录页
|
||||||
|
///
|
||||||
|
class Login extends StatefulWidget {
|
||||||
|
final Function successCallback;
|
||||||
|
|
||||||
|
const Login({
|
||||||
|
required Key key,
|
||||||
|
required this.successCallback,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_LoginState createState() => _LoginState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LoginState extends State<Login> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// TODO: implement build
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text(
|
||||||
|
'登录',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 30,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
body: const Text('登录'),
|
||||||
|
);;
|
||||||
|
}
|
||||||
|
}
|
||||||
15
lib/news.dart
Normal file
15
lib/news.dart
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'layout/LayoutScaffold.dart';
|
||||||
|
|
||||||
|
class News extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutScaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('资讯'),
|
||||||
|
),
|
||||||
|
body: null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
5
lib/router/router.dart
Normal file
5
lib/router/router.dart
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import 'package:bistro/app.dart';
|
||||||
|
|
||||||
|
var router = {
|
||||||
|
'/app': (context) => App(), //应用页
|
||||||
|
};
|
||||||
294
pubspec.lock
294
pubspec.lock
@@ -1,6 +1,27 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
|
_fe_analyzer_shared:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: _fe_analyzer_shared
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "22.0.0"
|
||||||
|
analyzer:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: analyzer
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.7.2"
|
||||||
|
args:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: args
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.0"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -15,6 +36,20 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
build:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: build
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.1"
|
||||||
|
build_config:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: build_config
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -29,6 +64,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
checked_yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: checked_yaml
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
chewie:
|
chewie:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -43,6 +85,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
|
cli_util:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cli_util
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.5"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -57,6 +106,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
version: "1.15.0"
|
||||||
|
convert:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: convert
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.1"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -78,6 +134,27 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
dart_style:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: dart_style
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.1"
|
||||||
|
dio:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: dio
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.4"
|
||||||
|
dio_http_cache:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: dio_http_cache
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.0"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -92,6 +169,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.1.2"
|
||||||
|
file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.2"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -132,6 +216,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0"
|
version: "0.5.0"
|
||||||
|
flutter_staggered_grid_view:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_staggered_grid_view
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.6.1"
|
||||||
flutter_svg:
|
flutter_svg:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -149,6 +240,13 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
glob:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: glob
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
html:
|
html:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -156,6 +254,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.15.0"
|
version: "0.15.0"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.0"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -163,6 +268,20 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.3"
|
version: "0.6.3"
|
||||||
|
json_annotation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: json_annotation
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.0"
|
||||||
|
json_serializable:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: json_serializable
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.4"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -170,6 +289,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.1"
|
version: "1.0.1"
|
||||||
|
logging:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: logging
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -205,6 +331,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
|
package_config:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: package_config
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -226,6 +359,34 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.1"
|
version: "0.2.1"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.5"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.3"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
|
pedantic:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pedantic
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.11.1"
|
||||||
permission_handler:
|
permission_handler:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -261,6 +422,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.4.0"
|
version: "4.4.0"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
plugin_platform_interface:
|
plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -268,6 +436,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.2"
|
||||||
|
process:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: process
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.4"
|
||||||
provider:
|
provider:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -275,6 +450,20 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.2"
|
version: "6.0.2"
|
||||||
|
pub_semver:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pub_semver
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
pubspec_parse:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pubspec_parse
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
quiver:
|
quiver:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -282,11 +471,74 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1+1"
|
version: "3.0.1+1"
|
||||||
|
shared_preferences:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: shared_preferences
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.13"
|
||||||
|
shared_preferences_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_android
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.11"
|
||||||
|
shared_preferences_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_ios
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
shared_preferences_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_linux
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
shared_preferences_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_macos
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.3"
|
||||||
|
shared_preferences_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
|
shared_preferences_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_web
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.3"
|
||||||
|
shared_preferences_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.99"
|
version: "0.0.99"
|
||||||
|
source_gen:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: source_gen
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.3"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -294,6 +546,20 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
version: "1.8.1"
|
||||||
|
sqflite:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
|
sqflite_common:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_common
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -315,6 +581,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
synchronized:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: synchronized
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -427,6 +700,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.0"
|
version: "0.2.0"
|
||||||
|
watcher:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: watcher
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
web_socket_channel:
|
web_socket_channel:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -469,6 +749,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.1"
|
version: "2.4.1"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0+1"
|
||||||
xml:
|
xml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -476,6 +763,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.3.1"
|
version: "5.3.1"
|
||||||
|
yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: yaml
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.16.1 <3.0.0"
|
dart: ">=2.16.1 <3.0.0"
|
||||||
flutter: ">=2.8.0"
|
flutter: ">=2.8.0"
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ dependencies:
|
|||||||
|
|
||||||
# WebView
|
# WebView
|
||||||
webview_flutter: ^2.8.0
|
webview_flutter: ^2.8.0
|
||||||
|
flutter_staggered_grid_view: ^0.6.1
|
||||||
|
shared_preferences: ^2.0.13
|
||||||
|
dio: ^4.0.4
|
||||||
|
dio_http_cache: ^0.3.0
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import 'package:bistro/main.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
// Build our app and trigger a frame.
|
// Build our app and trigger a frame.
|
||||||
await tester.pumpWidget(const MyApp());
|
await tester.pumpWidget(const Bistro());
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
// Verify that our counter starts at 0.
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
|||||||
Reference in New Issue
Block a user