-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat/#9 add meeting
- Loading branch information
Showing
9 changed files
with
620 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import 'package:app/model/meeting_form_model.dart'; | ||
import 'package:app/model/meeting.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class AddMettingViewModel { | ||
Meeting? meeting; | ||
Meeting_Form_Model addMeetingModel = Meeting_Form_Model(); | ||
|
||
TextEditingController titleController = TextEditingController(); | ||
TextEditingController contentController = TextEditingController(); | ||
TextEditingController searchController = TextEditingController(); | ||
|
||
GlobalKey<FormState> formKey = GlobalKey<FormState>(); //폼검사를 위한 키 | ||
|
||
void minusHour() { | ||
var endi = addMeetingModel.endList.indexOf(addMeetingModel.end) - 2; | ||
print(endi); | ||
if (endi < 0) endi = 48 + endi; | ||
addMeetingModel.end = addMeetingModel.endList[endi]; | ||
} | ||
|
||
void minusMinute() { | ||
var endi = addMeetingModel.endList.indexOf(addMeetingModel.end) - 1; | ||
print(endi); | ||
if (endi < 0) endi = 48 + endi; | ||
addMeetingModel.end = addMeetingModel.endList[endi]; | ||
} | ||
|
||
void plusMinute() { | ||
var endi = addMeetingModel.endList.indexOf(addMeetingModel.end) + 1; | ||
if (endi > 47) endi = endi - 48; | ||
addMeetingModel.end = addMeetingModel.endList[endi]; | ||
} | ||
|
||
void plusHour() { | ||
var endi = addMeetingModel.endList.indexOf(addMeetingModel.end) + 2; | ||
if (endi > 47) endi = endi - 48; | ||
addMeetingModel.end = addMeetingModel.endList[endi]; | ||
} | ||
|
||
bool addMeeting() { | ||
var meetingId = 6; | ||
var roomId = addMeetingModel.roomList.indexOf(addMeetingModel.room); | ||
var date = addMeetingModel.date; | ||
var startTime = addMeetingModel.start; | ||
var endTime = addMeetingModel.end; | ||
var title = titleController.text; | ||
var content = contentController.text; | ||
var repeat = addMeetingModel.repeat; | ||
if (title == "" || content == "") { | ||
return false; | ||
} | ||
//해당 시간에 등록 가능한가 체크 | ||
meeting = Meeting( | ||
meetingId, roomId, date, startTime, endTime, title, content, repeat); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class WidgetStyle { | ||
InputDecoration textFieldDeco(labeltext) { | ||
return InputDecoration( | ||
contentPadding: EdgeInsets.fromLTRB(0, 16, 0, 0), | ||
labelText: labeltext, | ||
filled: true, | ||
fillColor: Colors.grey[200], | ||
focusedBorder: const OutlineInputBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(10.0)), | ||
borderSide: BorderSide(width: 0, color: Colors.grey), | ||
), | ||
enabledBorder: const OutlineInputBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(10.0)), | ||
borderSide: BorderSide(width: 0, color: Colors.grey), | ||
), | ||
border: const OutlineInputBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(10.0)), | ||
borderSide: BorderSide(width: 0, color: Colors.grey), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters