Browse Source

reduce size action button

master
daivph 5 years ago
parent
commit
52d1be935a
4 changed files with 39 additions and 74 deletions
  1. +1
    -1
      ios/Flutter/.last_build_id
  2. +3
    -3
      ios/Runner.xcodeproj/project.pbxproj
  3. +1
    -1
      lib/presentation/screens/actions/nursery/sc_edit_action_nursery.dart
  4. +34
    -69
      lib/presentation/screens/plot_detail/sc_plot_action.dart

+ 1
- 1
ios/Flutter/.last_build_id View File

@@ -1 +1 @@
82c40f0e586e955df1aed37a310a3b7b
440505e9ea1eee7043d2cbfeb318f6bc

+ 3
- 3
ios/Runner.xcodeproj/project.pbxproj View File

@@ -382,7 +382,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -524,7 +524,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -558,7 +558,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

+ 1
- 1
lib/presentation/screens/actions/nursery/sc_edit_action_nursery.dart View File

@@ -237,7 +237,7 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> {
ThousandsFormatter(
formatter: NumberFormat("#,###.##", "es"), allowFraction: true)
],
decoration: InputDecoration(labelText: "Chiều dài mần"),
decoration: InputDecoration(labelText: "Chiều dài mầm"),
controller: _seedLengthController,
onSaved: (newValue) {
_nursery.seedLength = newValue.parseDoubleThousand();

+ 34
- 69
lib/presentation/screens/plot_detail/sc_plot_action.dart View File

@@ -47,69 +47,63 @@ class _PlotActionScreenState extends State<PlotActionScreen> {
}

_initActionButtons() {
actions.add(ActionType(
plot_action_nursery,
null,
EditActionNurseryScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_plant,
null,
EditActionPlantScreen(
cropId: widget.cropId,
)));
//TODO: Check is nursery
if (1 == 1) {
actions.add(ActionType(
plot_action_nursery,
EditActionNurseryScreen(
cropId: widget.cropId,
)));
} else {
actions.add(ActionType(
plot_action_plant,
EditActionPlantScreen(
cropId: widget.cropId,
)));
}

actions.add(ActionType(
plot_action_crop_status,
null,
EditActionCropStatusScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_environment_update,
null,
EditActionEnvironmentUpdate(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_dung,
null,
EditActionDungScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_spraying,
null,
EditActionSprayingScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_disease,
null,
EditActionDiseaseScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_use_water,
null,
EditActionUseWaterScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_other,
null,
EditActionOtherScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_harvest,
null,
EditActionHarvestScreen(
cropId: widget.cropId,
)));
actions.add(ActionType(
plot_action_finish,
null,
EditActionEndScreen(
cropId: widget.cropId,
)));
@@ -134,61 +128,34 @@ class _PlotActionScreenState extends State<PlotActionScreen> {
});
},
child: Container(
height: 75,
margin: EdgeInsets.all(4.0),
padding: EdgeInsets.all(0.0),
margin: EdgeInsets.all(2.5),
decoration: BoxDecoration(
color: COLOR_CONST.WHITE,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8.0),
bottomLeft: Radius.circular(8.0),
bottomRight: Radius.circular(8.0),
topRight: Radius.circular(8.0)),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
boxShadow: <BoxShadow>[
BoxShadow(
color: COLOR_CONST.GRAY1.withOpacity(0.2),
offset: Offset(1.1, 1.1),
blurRadius: 10.0),
],
),
child: Stack(
children: <Widget>[
Positioned(
top: -10,
right: -3,
child: (actionType.addScreen == null)
? Container()
: IconButton(
icon: Icon(
Icons.add_circle,
size: 40,
color: Colors.green,
),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => actionType.addScreen));
})),
Positioned.fill(
child: Align(
alignment: Alignment.center,
child: Text(
actionType.actionName,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 13,
color: COLOR_CONST.BLACK2,
),
)),
),
blurRadius: 4.0),
],
),
child: Align(
alignment: Alignment.center,
child: Text(
actionType.actionName,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 11,
color: COLOR_CONST.BLACK2,
),
)),
)),
);
}

bool _showTitle(BuildContext context) {
var kExpandedHeight = MediaQuery.of(context).size.width * 1.125 + 32;
var kExpandedHeight = MediaQuery.of(context).size.width * 0.625 + 24;
return _scrollController.hasClients &&
_scrollController.offset > kExpandedHeight - kToolbarHeight;
}
@@ -205,8 +172,8 @@ class _PlotActionScreenState extends State<PlotActionScreen> {
leading: Container(),
title: null,
// title: _showTitle(context) ? Text(plot_detail_title) : null,
//Height flexibleSpace : WidthScreen /2 * 6/16 * 6(row) + 8(space) *4
expandedHeight: MediaQuery.of(context).size.width * 1.125 + 32,
//Height flexibleSpace : WidthScreen /2 * 4/16 * 5(row) + 8(space) *3
expandedHeight: MediaQuery.of(context).size.width * 0.625 + 24,
flexibleSpace: _showTitle(context)
? null
: BlocProvider<PlotDetailBloc>(
@@ -218,7 +185,7 @@ class _PlotActionScreenState extends State<PlotActionScreen> {
title: GridView.count(
shrinkWrap: true,
crossAxisCount: 2,
childAspectRatio: 16 / 6,
childAspectRatio: 16 / 4,
children: actions.map(
(item) {
return _createActionButtons(item, contextB);
@@ -496,12 +463,10 @@ class ItemInfinityWidget extends StatelessWidget {
}

class ActionType {
Widget addScreen;
Widget listScreen;
String actionName;
ActionType(String actionName, Widget addScreen, Widget listScreen) {
ActionType(String actionName, Widget listScreen) {
this.actionName = actionName;
this.addScreen = addScreen;
this.listScreen = listScreen;
}
}

Loading…
Cancel
Save