添加 默认app theme

hmxc
张萌 4 years ago
parent 237913b22f
commit ca52f3083b

@ -1,4 +1,5 @@
// Flutter imports:
import 'package:aku_community_manager/style/apptheme.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -81,6 +82,7 @@ class MyApp extends StatelessWidget {
builder: () {
return GetMaterialApp(
title: '小蜜蜂管家',
theme: AppTheme.themeData,
home: SplashPage(),
builder: BotToastInit(),
navigatorObservers: [

@ -5,13 +5,20 @@ class InspectionPointSubmitModel {
List<ExecuteCheckList> executeCheckList;
File inspectionFaceImg;
File inspectionSpaceImg;
String inspectionFaceImgPath;
String inspectionSpaceImgPath;
List<String> inspectionFaceImgPath;
List<String> inspectionSpaceImgPath;
InspectionPointSubmitModel(this.executePointId, this.executeCheckList,
{this.inspectionFaceImg,
this.inspectionSpaceImg,
this.inspectionFaceImgPath,
this.inspectionSpaceImgPath});
// Map<String, dynamic> executeCheckListToJson() {
// final Map<String,dynamic>
// if (this.executeCheckList != null) {
// this.executeCheckList.map((e) => e.toJson()).toList();
// return
// } else {}
// }
}
class ExecuteCheckList {
@ -19,4 +26,13 @@ class ExecuteCheckList {
int status;
String remarks;
ExecuteCheckList(this.id, this.status, this.remarks);
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = {
"id": this.id,
"status": this.status,
"remarks": this.remarks,
};
return data;
}
}

@ -0,0 +1,109 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class AppTheme {
static ThemeData get themeData {
return ThemeData(primarySwatch: Colors.blue).copyWith(
primaryColor: Color(0xFFFFD000),
accentColor: Color(0xFFFFD000),
textTheme: TextTheme().copyWith(
headline3: TextStyle(
fontSize: 40.sp,
color: Color(0xFF333333),
fontWeight: FontWeight.bold,
),
subtitle1: TextStyle(
fontSize: 32.sp,
color: Color(0xFF333333),
),
subtitle2: TextStyle(
fontSize: 28.sp,
color: Color(0xFF333333),
),
bodyText1: TextStyle(
fontSize: 24.sp,
color: Color(0xFF333333),
),
),
floatingActionButtonTheme: FloatingActionButtonThemeData().copyWith(
backgroundColor: Color(0xFFFFD000),
),
appBarTheme: AppBarTheme(
elevation: 0,
centerTitle: true,
brightness: Brightness.light,
textTheme: TextTheme(
headline6: TextStyle(
color: Color(0xFF333333),
fontSize: 36.sp,
fontWeight: FontWeight.bold,
),
),
),
tabBarTheme: TabBarTheme(
labelColor: Color(0xFF333333),
labelStyle: TextStyle(
fontSize: 28.sp,
fontWeight: FontWeight.w600,
),
unselectedLabelStyle: TextStyle(
fontSize: 28.sp,
),
indicatorSize: TabBarIndicatorSize.label,
),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
selectedItemColor: Color(0xFF333333),
selectedLabelStyle: TextStyle(
fontWeight: FontWeight.bold,
),
type: BottomNavigationBarType.fixed,
unselectedLabelStyle: TextStyle(),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color>((states) {
if (states.contains(MaterialState.selected)) return Color(0xFFFFD000);
return null;
}),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled))
return Color(0xFFFFF4D7);
return Color(0xFFFFD000);
}),
elevation: MaterialStateProperty.all(0),
foregroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled))
return Color(0xFF666666);
return Color(0xFF333333);
}),
textStyle: MaterialStateProperty.all(TextStyle(
fontSize: 32.sp,
fontWeight: FontWeight.bold,
)),
padding: MaterialStateProperty.all(
EdgeInsets.symmetric(horizontal: 76.w, vertical: 22.w),
),
enableFeedback: true,
),
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled))
return Color(0xFFFFF4D7);
return Color(0xFFFFD000).withOpacity(0.2);
}),
foregroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled))
return Color(0xFF666666);
return Color(0xFF333333);
}),
),
),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
dividerColor: Color(0xFFE8E8E8),
);
}
}

@ -7,7 +7,6 @@ import 'package:aku_community_manager/ui/widgets/app_widgets/aku_pick_image_widg
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:aku_ui/aku_ui.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
@ -80,10 +79,13 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
bottom: AkuButton(
onPressed: canSubmit
? () async {
_submitModel.inspectionFaceImgPath =
await ManageFunc.uploadFace(_submitModel.inspectionFaceImg);
_submitModel.inspectionSpaceImg = await ManageFunc.uploadSpace(
_submitModel.inspectionSpaceImg);
_submitModel.inspectionFaceImgPath.add(
await ManageFunc.uploadFace(
_submitModel.inspectionFaceImg));
_submitModel.inspectionSpaceImgPath.add(
await ManageFunc.uploadSpace(
_submitModel.inspectionSpaceImg));
BaseModel baseModel =
await ManageFunc.getSubmitPoint(_submitModel);
if (baseModel.status) {

@ -74,9 +74,9 @@ class ManageFunc {
BaseModel baseModel =
await NetUtil().post(API.manage.submitPointDetail, params: {
"executePointId": model.executePointId,
"executeCheckList": model.executeCheckList,
"inspectionFaceImg": [],
"inspectionSpaceImg": []
// "executeCheckList": ExecuteCheckList(id, status, remarks).toJson(),
"inspectionFaceImg": model.inspectionFaceImgPath,
"inspectionSpaceImg": model.inspectionSpaceImgPath
});
return baseModel;

Loading…
Cancel
Save