Commit 921d4174 authored by laishanqi's avatar laishanqi

定义主体颜色

parent ed94d18a
/// 项目颜色配置 /// 项目颜色配置
class AppColors{ class AppColors{
/// 标题背景颜色
static const titleBackgroundColor = 0xffffffff;
/// 主色 /// 主色
static const mainColor = 0xff2893FF; static const mainColor = 0xff2893FF;
/// hint颜色 /// hint颜色
static const hintText = 0xffb4b4b4; static const hintText = 0xffb4b4b4;
/// 输入框字体颜色 /// 输入框字体颜色
static const EditTextColor = 0xff333333; static const EditTextColor = 0xff333333;
/// 页面背景颜色
static const scaffoldBackgroundColor = 0xffffffff;
/// 分割线颜色
static const dividerColor = 0xffeeeeee;
} }
\ No newline at end of file
import 'dart:ffi'; // import 'dart:ffi';
import 'dart:html'; // import 'dart:html';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
......
...@@ -13,8 +13,7 @@ class _HomePageState extends State { ...@@ -13,8 +13,7 @@ class _HomePageState extends State {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return Scaffold(
home: Scaffold(
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
selectedFontSize: 10, selectedFontSize: 10,
...@@ -37,7 +36,6 @@ class _HomePageState extends State { ...@@ -37,7 +36,6 @@ class _HomePageState extends State {
], ],
), ),
body: showBody(), body: showBody(),
),
); );
} }
......
...@@ -38,11 +38,7 @@ class _RegisterState extends State { ...@@ -38,11 +38,7 @@ class _RegisterState extends State {
} }
Widget registerWidget() { Widget registerWidget() {
return MaterialApp( return Scaffold(
theme: ThemeData(
primaryColor: Colors.white,
),
home: Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
icon: Icon(Icons.arrow_back), icon: Icon(Icons.arrow_back),
...@@ -69,7 +65,6 @@ class _RegisterState extends State { ...@@ -69,7 +65,6 @@ class _RegisterState extends State {
_getTextField("请输入9-16位密码",passwordController), _getTextField("请输入9-16位密码",passwordController),
], ],
),
)), )),
); );
} }
...@@ -77,10 +72,8 @@ class _RegisterState extends State { ...@@ -77,10 +72,8 @@ class _RegisterState extends State {
/// 输入框 /// 输入框
Widget _getTextField(String hintText,TextEditingController controller){ Widget _getTextField(String hintText,TextEditingController controller){
return TextField( return TextField(
style: TextStyle(color: Color(AppColors.EditTextColor),fontSize: 16),
decoration: InputDecoration( decoration: InputDecoration(
hintText: hintText, hintText: hintText,
hintStyle: TextStyle(color: Color(AppColors.hintText)),
), ),
controller: controller, controller: controller,
); );
......
...@@ -31,12 +31,7 @@ class _LoginState extends State<LoginPage> { ...@@ -31,12 +31,7 @@ class _LoginState extends State<LoginPage> {
Fluttertoast.showToast(msg: "global_config 请求成功 "); Fluttertoast.showToast(msg: "global_config 请求成功 ");
}); });
return MaterialApp( return Scaffold(
title: '登陆页',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
...@@ -136,7 +131,6 @@ class _LoginState extends State<LoginPage> { ...@@ -136,7 +131,6 @@ class _LoginState extends State<LoginPage> {
), ),
), ),
), ),
),
); );
} }
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:netrain_flutter_app/common/AppColors.dart';
import 'package:netrain_flutter_app/xuehao/list_page.dart'; import 'package:netrain_flutter_app/xuehao/list_page.dart';
import 'laishanqi/Stateful_page.dart'; import 'laishanqi/Stateful_page.dart';
...@@ -31,7 +32,11 @@ class MyApp extends StatelessWidget { ...@@ -31,7 +32,11 @@ class MyApp extends StatelessWidget {
title: 'Flutter Demo', title: 'Flutter Demo',
initialRoute: "main", initialRoute: "main",
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.blue, primaryColor: Color(AppColors.titleBackgroundColor),
hintColor: Color(AppColors.hintText),
accentColor: Color(AppColors.mainColor),
dividerColor: Color(AppColors.dividerColor),
scaffoldBackgroundColor: Color(AppColors.scaffoldBackgroundColor),
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
), ),
routes: <String, WidgetBuilder>{ routes: <String, WidgetBuilder>{
......
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