Commit bb56d287 authored by 窦文's avatar 窦文

Merge branch 'master' of git.naiterui.com:zouzhisheng/netrain_flutter_app

parents f5855635 43eec03d
...@@ -8,10 +8,19 @@ class AppColors{ ...@@ -8,10 +8,19 @@ class AppColors{
static const hintText = 0xffb4b4b4; static const hintText = 0xffb4b4b4;
/// 输入框字体颜色 /// 输入框字体颜色
static const EditTextColor = 0xff333333; static const EditTextColor = 0xff333333;
static const color_999 = 0xff999999;
/// 页面背景颜色 /// 页面背景颜色
static const scaffoldBackgroundColor = 0xffffffff; static const scaffoldBackgroundColor = 0xffffffff;
/// 分割线颜色 /// 分割线颜色
static const dividerColor = 0xffeeeeee; static const dividerColor = 0xffeeeeee;
/// 控件禁用时的颜色 /// 控件禁用时的颜色
static const disabledColor = 0xffdddddd; static const disabledColor = 0xffdddddd;
static const blue_bg_color = 0xFF2893FF;
static const blue_bg_color2 = 0xFFEEF9FF;
static const text_default_color = 0xff666666;
static const white_transparent_50 = 0x8CFFFFFF;
} }
\ No newline at end of file
...@@ -21,4 +21,17 @@ class Images{ ...@@ -21,4 +21,17 @@ class Images{
static const ic_login_button = "${imagesPath}login_button.png"; static const ic_login_button = "${imagesPath}login_button.png";
static const ic_doctor_avatar = "${imagesPath}ic_doctor_avatar.png"; static const ic_doctor_avatar = "${imagesPath}ic_doctor_avatar.png";
static const lake = "${imagesPath}lake.png"; static const lake = "${imagesPath}lake.png";
static const ic_bottom_01 = "${imagesPath}nav_01.png";
static const ic_bottom_02 = "${imagesPath}nav_02.png";
static const ic_bottom_03 = "${imagesPath}nav_03.png";
static const ic_bottom_03_true = "${imagesPath}nav_03_true.png";
static const ic_friend = "${imagesPath}ic_friend.png";
static const ic_prescription_home = "${imagesPath}ic_prescription_home.png";
static const ic_code = "${imagesPath}ic_code.png";
static const ic_more_white_little = "${imagesPath}ic_more_white_little.png";
static const img_home_pharmacy = "${imagesPath}img_home_pharmacy.png";
static const img_home_treatment = "${imagesPath}img_home_treatment.png";
static const ic_home_list = "${imagesPath}ic_home_list.png";
static const img_blank_nomessage = "${imagesPath}img_blank_nomessage.png";
} }
\ No newline at end of file
import 'package:flutter/material.dart';
class fifthDemo extends StatefulWidget {
fifthDemo({Key key}) : super(key: key);
@override
_fifthDemoState createState() {
return _fifthDemoState();
}
}
class _fifthDemoState extends State<fifthDemo> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
title: Text("第五个页面"),
),
body: fifthListViewDemo(),
);
}
}
class fifthListViewDemo extends StatefulWidget {
fifthListViewDemo({Key key}) : super(key: key);
@override
_fifthListViewDemoState createState() {
return _fifthListViewDemoState();
}
}
class _fifthListViewDemoState extends State<fifthListViewDemo> {
List<int>listArr = List();
@override
void initState() {
super.initState();
for(var i = 0; i<100 ;i++){
listArr.add(i);
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scrollbar(
child: RefreshIndicator(
child: ListView.builder(itemBuilder:(BuildContext context, int index){
if (index == 2) {
}
return Container(
child: Flex(
children: [
Text(listArr[index].toString()),
ElevatedButton(onPressed: (){
print("点击了");
}, child:Text("我是个按钮") ),
Container(
width: 100,
height: 300,
color: Colors.orange,
)
],
),
);
}),
),
);
}
Future _onRefresh() async {
await Future.delayed(
Duration(seconds: 2),
() {
print("object");
},
);
return "";
}
}
\ No newline at end of file
...@@ -3,6 +3,8 @@ import 'package:netrain_flutter_app/common/Images.dart'; ...@@ -3,6 +3,8 @@ import 'package:netrain_flutter_app/common/Images.dart';
import 'secondVC.dart'; import 'secondVC.dart';
class jssPageDemo extends StatelessWidget { class jssPageDemo extends StatelessWidget {
// const ({Key? key}) : super(key: key) // const ({Key? key}) : super(key: key)
...@@ -91,14 +93,17 @@ class buttonDemo extends StatelessWidget { ...@@ -91,14 +93,17 @@ class buttonDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
//改用ElevatedButton
RaisedButton( RaisedButton(
onPressed: (){}, onPressed: (){},
child:Text("漂浮按钮") child:Text("漂浮按钮")
), ),
//改用 TextButton
FlatButton( FlatButton(
onPressed: (){}, onPressed: (){},
child: Text("扁平按钮") child: Text("扁平按钮")
), ),
//改用 TextButton
FlatButton.icon( FlatButton.icon(
onPressed: (){}, onPressed: (){},
icon: Icon(Icons.outbound), icon: Icon(Icons.outbound),
...@@ -106,6 +111,7 @@ class buttonDemo extends StatelessWidget { ...@@ -106,6 +111,7 @@ class buttonDemo extends StatelessWidget {
color: Colors.black, color: Colors.black,
textColor: Colors.white, textColor: Colors.white,
), ),
//改用 OutlinedButton
OutlineButton(onPressed: (){}, OutlineButton(onPressed: (){},
child: Text("边框按钮"), child: Text("边框按钮"),
), ),
......
import 'package:flutter/material.dart';
class fourthDemo extends StatefulWidget {
fourthDemo({Key key}) : super(key: key);
@override
_fourthDemoState createState() {
return _fourthDemoState();
}
}
class _fourthDemoState extends State<fourthDemo> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
title: Text("jss测试第四个页面"),
),
body: someDemo());
}
}
class someDemo extends StatefulWidget {
someDemo({Key key}) : super(key: key);
@override
_someDemoState createState() {
return _someDemoState();
}
}
class _someDemoState extends State<someDemo> {
List<int> listArrData = List();
@override
void initState() {
super.initState();
for (var i = 0; i < 100; i++) {
listArrData.add(i);
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scrollbar(
child: RefreshIndicator(
child: ListView(
//y轴
scrollDirection: Axis.vertical,
children: listArrData
.map((e) => Container(
width: 200,
height: 100,
child: Flex(
direction: Axis.vertical,
children: [
Text(e.toString()),
ElevatedButton(
onPressed: () {
},
child: Text("点击进入第5个页面"))
],
),
decoration: BoxDecoration(
color: Colors.red,
),
//旋转跳跃我闭着眼
// transform: Matrix4.rotationZ(0.5),
))
.toList(),
),
onRefresh: _onRefresh,
));
}
Future _onRefresh() async {
await Future.delayed(
Duration(seconds: 2),
() {
print("object");
},
);
return "";
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/common/Images.dart'; import 'package:netrain_flutter_app/common/Images.dart';
import 'thirdVC.dart'; import 'thirdVC.dart';
class twoVCdemo extends StatelessWidget { class twoVCdemo extends StatelessWidget {
// const ({Key? key}) : super(key: key); // const ({Key? key}) : super(key: key);
...@@ -12,20 +11,21 @@ class twoVCdemo extends StatelessWidget { ...@@ -12,20 +11,21 @@ class twoVCdemo extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: Text("jssDemo第二个页面的标题"), title: Text("jssDemo第二个页面的标题"),
), ),
body: Column( body: Column(
children: [ children: [
ElevatedButton( ElevatedButton(
child: Text("第二页面的按钮,跳转带参数过去"), child: Text("第二页面的按钮,跳转带参数过去"),
onPressed:() { onPressed: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (context){ builder: (context) {
return nextViewDemo(); return nextViewDemo();
}, },
settings: RouteSettings( settings: RouteSettings(
name: "我是传过去的", name: "我是传过去的",
arguments:"参数,是对象类型", arguments: "参数,是对象类型",
), ),
//是否有返回 //是否有返回
maintainState: false, maintainState: false,
...@@ -35,12 +35,12 @@ class twoVCdemo extends StatelessWidget { ...@@ -35,12 +35,12 @@ class twoVCdemo extends StatelessWidget {
); );
}, },
), ),
Flex(direction:Axis.horizontal,
children: [
Image.asset(Images.ic_home_normal,alignment: Alignment.center,),
Flex(
direction: Axis.horizontal,
children: [
Image.asset(Images.ic_home_normal, alignment: Alignment.center,),
], ],
) )
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/jishuaishuai/fourthVC.dart';
class nextViewDemo extends StatelessWidget { class nextViewDemo extends StatelessWidget {
...@@ -7,13 +8,16 @@ class nextViewDemo extends StatelessWidget { ...@@ -7,13 +8,16 @@ class nextViewDemo extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.black26,
appBar: AppBar( appBar: AppBar(
title: Text("jss测试第三界面"), title: Text("jss测试第三界面"),
), ),
body: Column( body: Container(
child: Flex(
direction: Axis.vertical,
children: [ children: [
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
...@@ -23,11 +27,132 @@ class nextViewDemo extends StatelessWidget { ...@@ -23,11 +27,132 @@ class nextViewDemo extends StatelessWidget {
}, },
child: Text("点击返回传值"), child: Text("点击返回传值"),
), ),
ElevatedButton(onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder:(context){
return fourthDemo();
},
settings: RouteSettings(
name: "thirdVC"
)
)
);
}, child: Container(
child: Text("点击进入第四个页面"),
)
),
listViewDemo(),
WarpDemo(),
],
),
)
);
}
}
class listViewDemo extends StatefulWidget {
listViewDemo({Key key}) : super(key: key);
@override
_listViewDemoState createState() {
return _listViewDemoState(
);
}
}
class _listViewDemoState extends State<listViewDemo> {
@override
void initState() {
super.initState();
//创建时
}
@override
void dispose() {
//销毁时
super.dispose();
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container(
width: 600,
height: 300,
color: Colors.grey,
child:Align(
alignment:Alignment(-0.5,0.5),
child: Stack(
alignment: AlignmentDirectional.topStart,
children: [
Container(
width: 100,
height: 100,
color: Colors.orange,
),
Positioned(
left: 20,
right: 30,
top: 10,
bottom: 20,
child: Container(
color: Colors.red,
)),
], ],
), ),
)
);
}
}
class WarpDemo extends StatefulWidget {
WarpDemo({Key key}) : super(key: key);
@override
_WarpDemoState createState() {
return _WarpDemoState();
}
}
class _WarpDemoState extends State<WarpDemo> {
List<int>listArr = List();
@override
void initState() {
super.initState();
for(var i = 0;i < 10;i++){
listArr.add(i);
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return Wrap(
// spacing: 10.0,
runAlignment: WrapAlignment.center,
// runSpacing: 1,
children: listArr.map((e) => Container(
height: 100,
width: 100,
child: Text(e.toString()),
color: Colors.blue,
)).toList(
)
); );
} }
} }
\ No newline at end of file
...@@ -123,6 +123,7 @@ class _RegisterState extends State { ...@@ -123,6 +123,7 @@ class _RegisterState extends State {
} }
onRegisterClick() { onRegisterClick() {
Navigator.pushNamed(context, "doctorHome");
if(_formKey.currentState.validate()){ if(_formKey.currentState.validate()){
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("请求注册"))); ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("请求注册")));
} }
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:netrain_flutter_app/xuehao/BottomNavpage.dart';
import 'package:netrain_flutter_app/xuehao/car_details.dart'; import 'package:netrain_flutter_app/xuehao/car_details.dart';
import 'package:netrain_flutter_app/common/AppColors.dart'; import 'package:netrain_flutter_app/common/AppColors.dart';
import 'package:netrain_flutter_app/xuehao/grid_page.dart'; import 'package:netrain_flutter_app/xuehao/grid_page.dart';
...@@ -8,6 +10,7 @@ import 'package:netrain_flutter_app/xuehao/list_page.dart'; ...@@ -8,6 +10,7 @@ import 'package:netrain_flutter_app/xuehao/list_page.dart';
import 'laishanqi/Stateful_page.dart'; import 'laishanqi/Stateful_page.dart';
import 'laishanqi/Stateless_page.dart'; import 'laishanqi/Stateless_page.dart';
import 'laishanqi/layout_page.dart'; import 'laishanqi/layout_page.dart';
import 'laishanqi/netrain/DoctorHomePage.dart';
import 'laishanqi/netrain/user/loginPage.dart'; import 'laishanqi/netrain/user/loginPage.dart';
import 'laishanqi/netrain/user/RegisterPage.dart'; import 'laishanqi/netrain/user/RegisterPage.dart';
import 'laishanqi/photo.dart'; import 'laishanqi/photo.dart';
...@@ -34,6 +37,11 @@ class MyApp extends StatelessWidget { ...@@ -34,6 +37,11 @@ class MyApp extends StatelessWidget {
// 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) {
// 设置状态栏为透明
SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor:Colors.transparent);
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
return WillPopScope( return WillPopScope(
child: MaterialApp( child: MaterialApp(
title: 'Flutter Demo', title: 'Flutter Demo',
...@@ -62,8 +70,9 @@ class MyApp extends StatelessWidget { ...@@ -62,8 +70,9 @@ class MyApp extends StatelessWidget {
"firstVC":(context) => jssPageDemo(), "firstVC":(context) => jssPageDemo(),
"car_details":(context) =>CarDetailsPage(), "car_details":(context) =>CarDetailsPage(),
"student":(context) => jssPageDemo(), "student":(context) => jssPageDemo(),
"car_details":(context) =>CarDetailsPage(), "grid_page":(context) =>GridPage(),
"grid_page":(context) =>GridPage() "doctorHome":(context) => DoctorHomePage(),
"bottom_page":(context) =>BottomNavPage(),
}, },
), ),
onWillPop: () async { onWillPop: () async {
...@@ -119,7 +128,8 @@ class _RouterNavigatorState extends State<RouterNavigator> { ...@@ -119,7 +128,8 @@ class _RouterNavigatorState extends State<RouterNavigator> {
_item("listview页面",List_Page(),'listPage'), _item("listview页面",List_Page(),'listPage'),
_item("jssDemo", jssPageDemo(), 'firstVC'), _item("jssDemo", jssPageDemo(), 'firstVC'),
_item("jssDemo", jssPageDemo(), 'student'), _item("jssDemo", jssPageDemo(), 'student'),
_item("gridView",GridPage(),'grid_page') _item("gridView",GridPage(),'grid_page'),
_item("BottomNav",BottomNavPage(),'bottom_page'),
], ],
), ),
); );
......
import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/common/AppColors.dart';
import 'package:netrain_flutter_app/common/Images.dart';
/**
* @author xuehao
* on 2021/7/14
*/
class BottomNavPage extends StatefulWidget {
BottomNavPage({Key key}) : super(key: key);
@override
_BottomNavPageState createState() => _BottomNavPageState();
}
class _BottomNavPageState extends State<BottomNavPage> {
int _index = 0;
@override
Widget build(BuildContext context) {
List<BottomNavigationBarItem> _bottomNavigationbar = [
BottomNavigationBarItem(
title: Text("工作站"),
icon: Image.asset(Images.ic_bottom_01),
),
BottomNavigationBarItem(
title: Text("消息"),
icon: Image.asset(Images.ic_bottom_02),
),
BottomNavigationBarItem(
//显示的字样
title: Text("我的"),
//未选中时的图片
icon: Image.asset(Images.ic_bottom_03),
//选中后的图片
activeIcon: Image.asset(Images.ic_bottom_03_true),
),
];
List<Widget> _widgetItems = [
HomePage(),
MsgPage(),
UserCenter(),
];
return new MaterialApp(
title: "bottom_page",
home: Scaffold(
bottomNavigationBar: BottomNavigationBar(
items: _bottomNavigationbar,
type: BottomNavigationBarType.fixed,
currentIndex: _index,
onTap: (index) {
_changePage(index);
},
),
body: _widgetItems[_index]),
);
}
_changePage(int index) {
setState(() {
_index = index;
});
}
}
class HomePage extends StatefulWidget {
HomePage({Key key}) : super(key: key);
@override
_HomePageState createState() {
return _HomePageState();
}
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Color(AppColors.blue_bg_color),
title: Text(
"基本信息",
style: TextStyle(
fontSize: 16,
),
),
centerTitle: true,
leading: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Icon(Icons.arrow_back_ios),
),
actions: [
Container(
margin: EdgeInsets.fromLTRB(0, 0, 10, 0),
alignment: Alignment.centerRight,
child: Text(
"稍后提交",
textAlign: TextAlign.center,
),
)
],
),
body: new Column(children: [
Container(
height: 80,
color: Color(AppColors.blue_bg_color),
child: Column(
children: [
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(width: 54),
Container(
alignment: Alignment.center,
height: 22,
width: 22,
child: Text(
"1",
style: TextStyle(color: Color(AppColors.blue_bg_color)),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.0),
color: Colors.white,
),
),
Spacer(),
Container(
alignment: Alignment.center,
height: 22,
width: 22,
child: Text(
"2",
style: TextStyle(color: Color(AppColors.blue_bg_color)),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.0),
color: Color(AppColors.white_transparent_50),
),
),
Spacer(),
Container(
alignment: Alignment.center,
height: 22,
width: 22,
child: Text(
"3",
style: TextStyle(color: Color(AppColors.blue_bg_color)),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.0),
color: Color(AppColors.white_transparent_50),
),
),
SizedBox(width: 54),
],
),
SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(width: 41),
Text(
"基本信息",
style: TextStyle(color: Colors.white, fontSize: 12),
),
Spacer(),
Text(
"提交证件",
style: TextStyle(
color: Color(AppColors.white_transparent_50),
fontSize: 12),
),
Spacer(),
Text(
"审核完毕",
style: TextStyle(
color: Color(AppColors.white_transparent_50),
fontSize: 12),
),
SizedBox(width: 41),
],
),
Spacer(),
],
),
),
Container(
margin: EdgeInsets.all(16),
padding: EdgeInsets.fromLTRB(0, 0, 0, 16),
decoration: BoxDecoration(
color: Color(AppColors.blue_bg_color2),
borderRadius: BorderRadius.circular(4.0),
),
child: Column(
children: [
Container(
child: Text(
"您完成所有认证资料,并完成互联网医院认证备案后,杏联医生工作室将为您提供以下功能:",
style: TextStyle(
fontSize: 12, color: Color(AppColors.text_default_color)),
),
margin: EdgeInsets.all(10),
),
Row(
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
child: Row(
children: [
Column(
children: [
Text(
"邀请患者",
style: TextStyle(
fontSize: 16,
color: Color(AppColors.EditTextColor),
fontWeight: FontWeight.bold),
),
Text(
"专属二维码",
style: TextStyle(
color: Color(AppColors.text_default_color),
fontSize: 12
),
)
],
),
SizedBox(width: 16),
Image.asset(Images.ic_friend)
],
),
),
flex: 1,
),
Expanded(
child: Container(
child: Row(
children: [
Column(
children: [
Text(
"电子处方权",
style: TextStyle(
fontSize: 16,
color: Color(AppColors.EditTextColor),
fontWeight: FontWeight.bold),
),
Text(
"建立自己的诊室",
style: TextStyle(
color: Color(AppColors.text_default_color),
fontSize: 12
),
)
],
),
SizedBox(width: 16),
Image.asset(Images.ic_prescription_home)
],
),
),
flex: 1,
),
],
),
],
),
)
]),
);
}
}
class MsgPage extends StatefulWidget {
MsgPage({Key key}) : super(key: key);
@override
_MsgPageState createState() {
return _MsgPageState();
}
}
class _MsgPageState extends State<MsgPage> {
@override
Widget build(BuildContext context) {
return Center(
child: Text("消息"),
);
}
}
class UserCenter extends StatefulWidget {
UserCenter({Key key}) : super(key: key);
@override
_UserCenterState createState() {
return _UserCenterState();
}
}
class _UserCenterState extends State<UserCenter> {
@override
Widget build(BuildContext context) {
return Center(
child: Text("个人中心"),
);
}
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class CirclePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
var paint = new Paint();
paint.isAntiAlias = true;
paint.strokeWidth = 0.0;
paint.color = Colors.white;
paint.invertColors = false;
canvas.drawCircle(
Offset(size.width / 2, size.height / 2), size.height / 2, paint);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment