forked from stamp-team/chat-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChangeNotifierの実装(メインページ) #16
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b4aaa0c
ページごとにディレクトリを作成
thoth000 387cca8
ChangeNotifierクラスを定義
thoth000 f72e08d
mainController
thoth000 9044e30
talkController
thoth000 ebdf747
profileController
thoth000 3cafa59
ProfileEditPageのProviderを変更
thoth000 0cf5f17
もろもろ修正
thoth000 abcd197
homeController
thoth000 9179ad5
Providerをdi.dartでセット(仮)
thoth000 02f1e31
Futureの戻り値をvoidに変更
thoth000 e41481e
HomePage修正
thoth000 1ef3712
MainController
thoth000 4959e8f
メインページのコントローラ完成
thoth000 52cdb0c
MultiProviderをmainで作成
thoth000 53080e9
flutter format .
thoth000 61ce4a2
使わないdi.dartを削除
thoth000 7c87aa9
指摘部分の修正
thoth000 1e9cb92
別ファイルへの切り出し
thoth000 6b8e569
flutter format .
thoth000 ab57921
Merge branch 'master' into feature/13/main
thoth000 0002225
不要なaxis.verticalの除去
thoth000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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,50 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import 'package:chat_flutter/config/app_space.dart'; | ||
|
||
import 'package:chat_flutter/ui/molecules/home/list_tile.dart'; | ||
|
||
import 'package:chat_flutter/ui/pages/main/home/home_controller.dart'; | ||
|
||
class FriendTileList extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final friendList = Provider.of<HomeController>(context).friendList; | ||
if (friendList == null) { | ||
return const Center( | ||
child: CircularProgressIndicator(), | ||
); | ||
} else { | ||
return Container( | ||
// ここのラップは適当にサイズ指定しているだけなので、レイアウトに合わせて変更する必要あり | ||
height: 220, | ||
child: SingleChildScrollView( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
SizedBox( | ||
height: AppSpace.small, | ||
), | ||
ListView.builder( | ||
physics: ScrollPhysics(), | ||
scrollDirection: Axis.vertical, | ||
shrinkWrap: true, | ||
itemCount: friendList.length, | ||
itemBuilder: ( | ||
BuildContext context, | ||
int index, | ||
) { | ||
return HomePageListTile( | ||
name: friendList[index].name, | ||
imgUrl: friendList[index].imgUrl, | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} | ||
} |
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,48 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import 'package:chat_flutter/config/app_space.dart'; | ||
|
||
import 'package:chat_flutter/ui/molecules/home/list_tile.dart'; | ||
|
||
import 'package:chat_flutter/ui/pages/main/home/home_controller.dart'; | ||
|
||
class GroupTileList extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final groupList = Provider.of<HomeController>(context).groupList; | ||
if (groupList == null) { | ||
return const Center( | ||
child: CircularProgressIndicator(), | ||
); | ||
} | ||
return Container( | ||
height: 220, | ||
child: SingleChildScrollView( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
SizedBox( | ||
height: AppSpace.small, | ||
), | ||
ListView.builder( | ||
physics: ScrollPhysics(), | ||
scrollDirection: Axis.vertical, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
shrinkWrap: true, | ||
itemCount: groupList.length, | ||
itemBuilder: ( | ||
BuildContext context, | ||
int index, | ||
) { | ||
return HomePageListTile( | ||
name: groupList[index].name, | ||
imgUrl: groupList[index].imgUrl, | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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,23 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import 'package:chat_flutter/ui/molecules/home/list_tile.dart'; | ||
|
||
import 'package:chat_flutter/ui/pages/main/home/home_controller.dart'; | ||
|
||
class MyTile extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final user = Provider.of<HomeController>(context).user; | ||
if (user == null) { | ||
return const Center( | ||
child: CircularProgressIndicator(), | ||
); | ||
} | ||
return HomePageListTile( | ||
name: user.name, | ||
imgUrl: user.imgUrl, | ||
isMe: true, | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://api.flutter.dev/flutter/widgets/ListView/ListView.builder.html
今更で申し訳ないんですけどここは defaultが
Axis.vertical
なのでいらなさそうですね 🆗