Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
netrain_flutter_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邹志胜
netrain_flutter_app
Commits
1aac69f7
Commit
1aac69f7
authored
Jul 18, 2021
by
laishanqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改颜色使用方式,增加扩展方法,扩展了长度单位的使用方法
parent
f1aa7572
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
208 additions
and
109 deletions
+208
-109
AppColors.dart
netrain_flutter_app/lib/common/AppColors.dart
+14
-12
Ext.dart
netrain_flutter_app/lib/common/Ext.dart
+61
-0
layout_page.dart
netrain_flutter_app/lib/laishanqi/layout_page.dart
+1
-1
DoctorMain.dart
netrain_flutter_app/lib/laishanqi/netrain/DoctorMain.dart
+2
-2
DoctorHomePage.dart
...ter_app/lib/laishanqi/netrain/maintab/DoctorHomePage.dart
+75
-69
PharmacyPage.dart
..._app/lib/laishanqi/netrain/prescription/PharmacyPage.dart
+28
-0
RegisterPage.dart
..._flutter_app/lib/laishanqi/netrain/user/RegisterPage.dart
+5
-5
main.dart
netrain_flutter_app/lib/main.dart
+7
-5
BottomNavpage.dart
netrain_flutter_app/lib/xuehao/BottomNavpage.dart
+15
-15
No files found.
netrain_flutter_app/lib/common/AppColors.dart
View file @
1aac69f7
import
'package:flutter/material.dart'
;
/// 项目颜色配置
class
AppColors
{
/// 标题背景颜色
static
const
titleBackgroundColor
=
0xffffffff
;
static
const
titleBackgroundColor
=
Color
(
0xffffffff
)
;
/// 主色
static
const
mainColor
=
0xff2893FF
;
static
const
mainColor
=
Color
(
0xff2893FF
)
;
/// hint颜色
static
const
hintText
=
0xffb4b4b4
;
static
const
hintText
=
Color
(
0xffb4b4b4
)
;
/// 输入框字体颜色
static
const
EditTextColor
=
0xff333333
;
static
const
color_999
=
0xff999999
;
static
const
EditTextColor
=
Color
(
0xff333333
)
;
static
const
color_999
=
Color
(
0xff999999
)
;
/// 页面背景颜色
static
const
scaffoldBackgroundColor
=
0xffffffff
;
static
const
scaffoldBackgroundColor
=
Color
(
0xffffffff
)
;
/// 分割线颜色
static
const
dividerColor
=
0xffeeeeee
;
static
const
dividerColor
=
Color
(
0xffeeeeee
)
;
/// 控件禁用时的颜色
static
const
disabledColor
=
0xffdddddd
;
static
const
disabledColor
=
Color
(
0xffdddddd
)
;
static
const
blue_bg_color
=
0xFF2893FF
;
static
const
blue_bg_color
=
Color
(
0xFF2893FF
)
;
static
const
blue_bg_color2
=
0xFFEEF9FF
;
static
const
blue_bg_color2
=
Color
(
0xFFEEF9FF
)
;
static
const
text_default_color
=
0xff666666
;
static
const
text_default_color
=
Color
(
0xff666666
)
;
static
const
white_transparent_50
=
0x8CFFFFFF
;
static
const
white_transparent_50
=
Color
(
0x8CFFFFFF
)
;
}
\ No newline at end of file
netrain_flutter_app/lib/common/Ext.dart
0 → 100644
View file @
1aac69f7
import
'package:flustars/flustars.dart'
;
import
'package:flutter/material.dart'
;
extension
IntValue
on
int
{
/// 返回根据屏幕宽高适配后尺寸(单位 dp or pt)
double
dp
(){
return
toDouble
().
dp
();
}
/// 返回间距,应用于四个位置:top,bottom,left,right
EdgeInsets
spacingAll
(){
return
EdgeInsets
.
all
(
dp
());
}
EdgeInsets
spacingLeft
(){
return
EdgeInsets
.
only
(
left:
dp
());
}
EdgeInsets
spacingRight
(){
return
EdgeInsets
.
only
(
right:
dp
());
}
EdgeInsets
spacingTop
(){
return
EdgeInsets
.
only
(
top:
dp
());
}
EdgeInsets
spacingBottom
(){
return
EdgeInsets
.
only
(
bottom:
dp
());
}
EdgeInsets
spacingVertical
(){
return
EdgeInsets
.
symmetric
(
vertical:
dp
());
}
EdgeInsets
spacingHorizontal
(){
return
EdgeInsets
.
symmetric
(
horizontal:
dp
());
}
}
extension
DoubleValue
on
double
{
/// 返回根据屏幕宽高适配后尺寸(单位 dp or pt)
double
dp
(){
return
ScreenUtil
.
getInstance
().
getAdapterSize
(
this
);
}
EdgeInsets
spacingAll
(){
return
EdgeInsets
.
all
(
dp
());
}
EdgeInsets
spacingLeft
(){
return
EdgeInsets
.
only
(
left:
dp
());
}
EdgeInsets
spacingRight
(){
return
EdgeInsets
.
only
(
right:
dp
());
}
EdgeInsets
spacingTop
(){
return
EdgeInsets
.
only
(
top:
dp
());
}
EdgeInsets
spacingBottom
(){
return
EdgeInsets
.
only
(
bottom:
dp
());
}
EdgeInsets
spacingVertical
(){
return
EdgeInsets
.
symmetric
(
vertical:
dp
());
}
EdgeInsets
spacingHorizontal
(){
return
EdgeInsets
.
symmetric
(
horizontal:
dp
());
}
}
netrain_flutter_app/lib/laishanqi/layout_page.dart
View file @
1aac69f7
...
...
@@ -137,7 +137,7 @@ class _LayoutGroupState extends State<LayoutPage> {
),
),
FractionallySizedBox
(
widthFactor:
0.5
,
widthFactor:
1
,
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
grey
),
child:
Text
(
'屏幕的二分之一'
),
...
...
netrain_flutter_app/lib/laishanqi/netrain/DoctorMain.dart
View file @
1aac69f7
...
...
@@ -30,8 +30,8 @@ class _doctorMainPageState extends State<doctorMainPage> {
height:
50
,
child:
BottomNavigationBar
(
backgroundColor:
Colors
.
white
,
selectedItemColor:
Color
(
AppColors
.
mainColor
)
,
unselectedItemColor:
Color
(
AppColors
.
hintText
)
,
selectedItemColor:
AppColors
.
mainColor
,
unselectedItemColor:
AppColors
.
hintText
,
selectedFontSize:
10
,
unselectedFontSize:
10
,
currentIndex:
currentIndex
,
...
...
netrain_flutter_app/lib/laishanqi/netrain/maintab/DoctorHomePage.dart
View file @
1aac69f7
This diff is collapsed.
Click to expand it.
netrain_flutter_app/lib/laishanqi/netrain/prescription/PharmacyPage.dart
0 → 100644
View file @
1aac69f7
import
'package:flutter/material.dart'
;
import
'package:netrain_flutter_app/common/Ext.dart'
;
class
PharmacyPage
extends
StatefulWidget
{
@override
_PharmacyPageState
createState
()
{
return
_PharmacyPageState
();
}
}
class
_PharmacyPageState
extends
State
<
PharmacyPage
>
{
@override
void
initState
()
{
super
.
initState
();
}
@override
void
dispose
()
{
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
// TODO: implement build
return
null
;
}
}
\ No newline at end of file
netrain_flutter_app/lib/laishanqi/netrain/user/RegisterPage.dart
View file @
1aac69f7
...
...
@@ -95,7 +95,7 @@ class _RegisterState extends State {
Text
(
"密码由9-16位大小写字母、数字加特殊符号组成"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
mainColor
)
,
fontSize:
12
),
TextStyle
(
color:
AppColors
.
mainColor
,
fontSize:
12
),
),
Container
(
margin:
EdgeInsets
.
only
(
top:
20
),
...
...
@@ -105,9 +105,9 @@ class _RegisterState extends State {
backgroundColor:
MaterialStateProperty
.
resolveWith
((
states
)
{
if
(
states
.
contains
(
MaterialState
.
disabled
))
{
return
Color
(
AppColors
.
disabledColor
)
;
return
AppColors
.
disabledColor
;
}
return
Color
(
AppColors
.
mainColor
)
;
return
AppColors
.
mainColor
;
}),
),
child:
Text
(
...
...
@@ -203,11 +203,11 @@ class _RegisterState extends State {
enabledBorder:
UnderlineInputBorder
(
// 默认状态的下划线边框
borderSide:
BorderSide
(
color:
Color
(
AppColors
.
dividerColor
)
,
width:
0.5
)),
BorderSide
(
color:
AppColors
.
dividerColor
,
width:
0.5
)),
focusedBorder:
UnderlineInputBorder
(
// 输入框获取焦点后
borderSide:
BorderSide
(
color:
Color
(
AppColors
.
mainColor
)
,
width:
0.5
)),
BorderSide
(
color:
AppColors
.
mainColor
,
width:
0.5
)),
errorBorder:
UnderlineInputBorder
(
// 错误的时候
borderSide:
BorderSide
(
color:
Colors
.
red
,
width:
0.5
)),
...
...
netrain_flutter_app/lib/main.dart
View file @
1aac69f7
import
'package:flustars/flustars.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_localizations/flutter_localizations.dart'
;
...
...
@@ -38,6 +39,7 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget
build
(
BuildContext
context
)
{
setDesignWHD
(
375
,
812
);
// 设置状态栏为透明
SystemUiOverlayStyle
systemUiOverlayStyle
=
SystemUiOverlayStyle
(
statusBarColor:
Colors
.
transparent
);
...
...
@@ -48,11 +50,11 @@ class MyApp extends StatelessWidget {
title:
'Flutter Demo'
,
initialRoute:
"main"
,
theme:
ThemeData
(
primaryColor:
Color
(
AppColors
.
titleBackgroundColor
)
,
hintColor:
Color
(
AppColors
.
hintText
)
,
accentColor:
Color
(
AppColors
.
mainColor
)
,
dividerColor:
Color
(
AppColors
.
dividerColor
)
,
scaffoldBackgroundColor:
Color
(
AppColors
.
scaffoldBackgroundColor
)
,
primaryColor:
AppColors
.
titleBackgroundColor
,
hintColor:
AppColors
.
hintText
,
accentColor:
AppColors
.
mainColor
,
dividerColor:
AppColors
.
dividerColor
,
scaffoldBackgroundColor:
AppColors
.
scaffoldBackgroundColor
,
visualDensity:
VisualDensity
.
adaptivePlatformDensity
,
),
localizationsDelegates:
[
...
...
netrain_flutter_app/lib/xuehao/BottomNavpage.dart
View file @
1aac69f7
...
...
@@ -80,7 +80,7 @@ class _HomePageState extends State<HomePage> {
return
Scaffold
(
appBar:
AppBar
(
elevation:
0
,
backgroundColor:
Color
(
AppColors
.
blue_bg_color
),
backgroundColor:
(
AppColors
.
blue_bg_color
),
title:
Text
(
"基本信息"
,
style:
TextStyle
(
...
...
@@ -108,7 +108,7 @@ class _HomePageState extends State<HomePage> {
body:
new
Column
(
children:
[
Container
(
height:
80
,
color:
Color
(
AppColors
.
blue_bg_color
),
color:
(
AppColors
.
blue_bg_color
),
child:
Column
(
children:
[
Spacer
(),
...
...
@@ -122,7 +122,7 @@ class _HomePageState extends State<HomePage> {
width:
22
,
child:
Text
(
"1"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
blue_bg_color
)),
style:
TextStyle
(
color:
(
AppColors
.
blue_bg_color
)),
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
11.0
),
...
...
@@ -136,11 +136,11 @@ class _HomePageState extends State<HomePage> {
width:
22
,
child:
Text
(
"2"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
blue_bg_color
)),
style:
TextStyle
(
color:
(
AppColors
.
blue_bg_color
)),
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
11.0
),
color:
Color
(
AppColors
.
white_transparent_50
),
color:
(
AppColors
.
white_transparent_50
),
),
),
Spacer
(),
...
...
@@ -150,11 +150,11 @@ class _HomePageState extends State<HomePage> {
width:
22
,
child:
Text
(
"3"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
blue_bg_color
)),
style:
TextStyle
(
color:
(
AppColors
.
blue_bg_color
)),
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
11.0
),
color:
Color
(
AppColors
.
white_transparent_50
),
color:
(
AppColors
.
white_transparent_50
),
),
),
SizedBox
(
width:
54
),
...
...
@@ -173,14 +173,14 @@ class _HomePageState extends State<HomePage> {
Text
(
"提交证件"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
white_transparent_50
),
color:
(
AppColors
.
white_transparent_50
),
fontSize:
12
),
),
Spacer
(),
Text
(
"审核完毕"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
white_transparent_50
),
color:
(
AppColors
.
white_transparent_50
),
fontSize:
12
),
),
SizedBox
(
width:
41
),
...
...
@@ -194,7 +194,7 @@ class _HomePageState extends State<HomePage> {
margin:
EdgeInsets
.
all
(
16
),
padding:
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
16
),
decoration:
BoxDecoration
(
color:
Color
(
AppColors
.
blue_bg_color2
),
color:
(
AppColors
.
blue_bg_color2
),
borderRadius:
BorderRadius
.
circular
(
4.0
),
),
child:
Column
(
...
...
@@ -203,7 +203,7 @@ class _HomePageState extends State<HomePage> {
child:
Text
(
"您完成所有认证资料,并完成互联网医院认证备案后,杏联医生工作室将为您提供以下功能:"
,
style:
TextStyle
(
fontSize:
12
,
color:
Color
(
AppColors
.
text_default_color
)
),
fontSize:
12
,
color:
AppColors
.
text_default_color
),
),
margin:
EdgeInsets
.
all
(
10
),
),
...
...
@@ -220,13 +220,13 @@ class _HomePageState extends State<HomePage> {
"邀请患者"
,
style:
TextStyle
(
fontSize:
16
,
color:
Color
(
AppColors
.
EditTextColor
),
color:
(
AppColors
.
EditTextColor
),
fontWeight:
FontWeight
.
bold
),
),
Text
(
"专属二维码"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
text_default_color
),
color:
(
AppColors
.
text_default_color
),
fontSize:
12
),
)
...
...
@@ -249,13 +249,13 @@ class _HomePageState extends State<HomePage> {
"电子处方权"
,
style:
TextStyle
(
fontSize:
16
,
color:
Color
(
AppColors
.
EditTextColor
)
,
color:
AppColors
.
EditTextColor
,
fontWeight:
FontWeight
.
bold
),
),
Text
(
"建立自己的诊室"
,
style:
TextStyle
(
color:
Color
(
AppColors
.
text_default_color
)
,
color:
AppColors
.
text_default_color
,
fontSize:
12
),
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment