Skip to content

Commit

Permalink
Merge pull request #57 from koji-1009/feat/code_upgrade
Browse files Browse the repository at this point in the history
feat: Update code
  • Loading branch information
koji-1009 authored Feb 18, 2024
2 parents 3746c02 + 8c65e23 commit fd5d8a1
Show file tree
Hide file tree
Showing 18 changed files with 148 additions and 155 deletions.
49 changes: 20 additions & 29 deletions lib/view/home/full/full_search_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter_kokkai_gijiroku/view/home/full/part/meeting_widget.dart'
import 'package:flutter_kokkai_gijiroku/view/home/full/part/mode_widget.dart';
import 'package:flutter_kokkai_gijiroku/view/home/full/part/speaker_widget.dart';
import 'package:flutter_kokkai_gijiroku/view/home/full/part/word_widget.dart';
import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

enum _Field {
Expand All @@ -24,38 +25,28 @@ class FullSearchWidget extends ConsumerWidget {
builder: (context, constraints) {
final margin = Breakpoint.fromConstraints(constraints).margin;
return ListView.separated(
padding: const EdgeInsets.only(
padding: EdgeInsets.only(
top: 16,
bottom: 80,
),
separatorBuilder: (context, index) => const SizedBox(
height: 16,
bottom: 80 + MediaQuery.paddingOf(context).bottom,
),
separatorBuilder: (context, index) => const Gap(16),
itemCount: _Field.values.length,
itemBuilder: (context, index) {
final field = _Field.values[index];
switch (field) {
case _Field.mode:
return ModeWidget(
margin: margin,
);
case _Field.date:
return DateWidget(
margin: margin,
);
case _Field.word:
return WordWidget(
margin: margin,
);
case _Field.meeting:
return MeetingWidget(
margin: margin,
);
case _Field.speaker:
return SpeakerWidget(
margin: margin,
);
}
itemBuilder: (context, index) => switch (_Field.values[index]) {
_Field.mode => ModeWidget(
margin: margin,
),
_Field.date => DateWidget(
margin: margin,
),
_Field.word => WordWidget(
margin: margin,
),
_Field.meeting => MeetingWidget(
margin: margin,
),
_Field.speaker => SpeakerWidget(
margin: margin,
)
},
);
},
Expand Down
5 changes: 2 additions & 3 deletions lib/view/home/full/part/date_widget.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_kokkai_gijiroku/presenter/search_state_manager.dart';
import 'package:flutter_kokkai_gijiroku/utils/date_formatter.dart';
import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

class DateWidget extends ConsumerWidget {
Expand Down Expand Up @@ -55,9 +56,7 @@ class DateWidget extends ConsumerWidget {
.updateFrom(selectDate);
},
),
const SizedBox(
height: 8,
),
const Gap(8),
InkWell(
child: Padding(
padding: EdgeInsets.symmetric(
Expand Down
5 changes: 2 additions & 3 deletions lib/view/home/full/part/meeting_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_kokkai_gijiroku/model/entity/search_params.dart';
import 'package:flutter_kokkai_gijiroku/presenter/search_state_manager.dart';
import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

class MeetingWidget extends HookConsumerWidget {
Expand Down Expand Up @@ -41,9 +42,7 @@ class MeetingWidget extends HookConsumerWidget {
.updateNameOfMeeting(value);
},
),
const SizedBox(
height: 8,
),
const Gap(8),
Row(
children: [
Text(
Expand Down
13 changes: 4 additions & 9 deletions lib/view/home/full/part/speaker_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_kokkai_gijiroku/model/entity/search_params.dart';
import 'package:flutter_kokkai_gijiroku/presenter/search_state_manager.dart';
import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

class SpeakerWidget extends HookConsumerWidget {
Expand Down Expand Up @@ -51,9 +52,7 @@ class SpeakerWidget extends HookConsumerWidget {
.updateSpeaker(value);
},
),
const SizedBox(
height: 8,
),
const Gap(8),
TextField(
controller: speakerPositionController,
keyboardType: TextInputType.text,
Expand All @@ -68,9 +67,7 @@ class SpeakerWidget extends HookConsumerWidget {
.updateSpeakerPosition(value);
},
),
const SizedBox(
height: 8,
),
const Gap(8),
TextField(
controller: speakerGroupController,
keyboardType: TextInputType.text,
Expand All @@ -85,9 +82,7 @@ class SpeakerWidget extends HookConsumerWidget {
.updateSpeakerGroup(value);
},
),
const SizedBox(
height: 8,
),
const Gap(8),
Row(
children: [
Text(
Expand Down
9 changes: 3 additions & 6 deletions lib/view/home/full/part/word_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_kokkai_gijiroku/model/entity/search_params.dart';
import 'package:flutter_kokkai_gijiroku/presenter/search_state_manager.dart';
import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

class WordWidget extends HookConsumerWidget {
Expand Down Expand Up @@ -40,9 +41,7 @@ class WordWidget extends HookConsumerWidget {
},
),
),
const SizedBox(
height: 8,
),
const Gap(8),
Padding(
padding: EdgeInsets.symmetric(
horizontal: margin,
Expand Down Expand Up @@ -70,9 +69,7 @@ class WordWidget extends HookConsumerWidget {
],
),
),
const SizedBox(
height: 8,
),
const Gap(8),
SwitchListTile(
title: const Text('追録・附録指定'),
contentPadding: EdgeInsets.symmetric(
Expand Down
13 changes: 4 additions & 9 deletions lib/view/home/history/history_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter_kokkai_gijiroku/model/hive/search_history.dart';
import 'package:flutter_kokkai_gijiroku/view/router.dart';
import 'package:flutter_kokkai_gijiroku/view/widget/memo_edit_dialog.dart';
import 'package:flutter_kokkai_gijiroku/view/widget/search_params_list.dart';
import 'package:gap/gap.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:intl/intl.dart';
Expand Down Expand Up @@ -62,9 +63,7 @@ class HistoryWidget extends ConsumerWidget {
SearchParamsList(
params: history.params,
),
const SizedBox(
height: 8,
),
const Gap(8),
Text(
'検索日時',
style: Theme.of(context).textTheme.titleMedium,
Expand All @@ -73,9 +72,7 @@ class HistoryWidget extends ConsumerWidget {
_formatter.format(history.updatedAt),
),
if (history.memo.isNotEmpty) ...[
const SizedBox(
height: 8,
),
const Gap(8),
Text(
'メモ',
style: Theme.of(context).textTheme.titleMedium,
Expand Down Expand Up @@ -117,9 +114,7 @@ class HistoryWidget extends ConsumerWidget {
},
icon: const Icon(Icons.edit),
),
const SizedBox(
height: 8,
),
const Gap(8),
IconButton(
tooltip: '履歴の削除',
onPressed: () async {
Expand Down
78 changes: 48 additions & 30 deletions lib/view/home/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:breakpoints_mq/breakpoints_mq.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_kokkai_gijiroku/model/entity/search_params.dart';
import 'package:flutter_kokkai_gijiroku/model/entity/search_state.dart';
Expand Down Expand Up @@ -143,37 +144,54 @@ class HomeScreen extends ConsumerWidget {
HomeAppBarAction(),
],
),
body: Row(
children: [
NavigationRail(
extended: isExtended,
labelType: isExtended ? null : NavigationRailLabelType.selected,
destinations: const [
NavigationRailDestination(
icon: Icon(Icons.search),
label: Text('キーワード'),
),
NavigationRailDestination(
icon: Icon(Icons.manage_search),
label: Text('条件'),
),
NavigationRailDestination(
icon: Icon(Icons.history),
label: Text('検索'),
body: SafeArea(
bottom: false,
child: Row(
children: [
LayoutBuilder(
builder: (context, constraints) => SingleChildScrollView(
primary: false,
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.maxHeight,
),
child: IntrinsicHeight(
child: NavigationRail(
extended: isExtended,
labelType: isExtended
? NavigationRailLabelType.none
: NavigationRailLabelType.selected,
destinations: const [
NavigationRailDestination(
icon: Icon(Icons.search),
label: Text('キーワード'),
),
NavigationRailDestination(
icon: Icon(Icons.manage_search),
label: Text('条件'),
),
NavigationRailDestination(
icon: Icon(Icons.history),
label: Text('検索'),
),
],
selectedIndex: index,
onDestinationSelected: (index) {
_navigate(
context: context,
index: index,
);
},
),
),
),
),
],
selectedIndex: index,
onDestinationSelected: (index) {
_navigate(
context: context,
index: index,
);
},
),
Expanded(
child: child,
),
],
),
Expanded(
child: child,
),
],
),
),
floatingActionButton: actionButton,
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
Expand Down
1 change: 1 addition & 0 deletions lib/view/search/search_meeting_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class SearchMeetingDetailScreen extends HookConsumerWidget {
),
),
body: SafeArea(
bottom: false,
child: OverBottomSheet(
sizeOption: bottomSheetSizeOption,
header: const BottomSheetDivider(),
Expand Down
1 change: 1 addition & 0 deletions lib/view/search/search_meeting_summary_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class SearchMeetingSummaryScreen extends HookConsumerWidget {
),
),
body: SafeArea(
bottom: false,
child: OverBottomSheet(
sizeOption: bottomSheetSizeOption,
header: const BottomSheetDivider(),
Expand Down
1 change: 1 addition & 0 deletions lib/view/search/search_speech_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class SearchSpeechScreen extends ConsumerWidget {
),
),
body: SafeArea(
bottom: false,
child: OverBottomSheet(
sizeOption: bottomSheetSizeOption,
header: const BottomSheetDivider(),
Expand Down
1 change: 1 addition & 0 deletions lib/view/status/issue_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class IssueDetailScreen extends ConsumerWidget {
title: const Text('会議録詳細'),
),
body: SafeArea(
bottom: false,
child: PagingList<int, SpeechRecord>(
dataSource: dataSource,
builder: (context, element, index) => InkWell(
Expand Down
Loading

0 comments on commit fd5d8a1

Please sign in to comment.