Skip to content
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

Fix/reverse order #121

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutter": "3.7.8",
"flavors": {}
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ app.*.map.json
# private
lib/firebase_options.dart
/android/
/ios/
/ios/*
!/ios/Runner/
/linux/
/macos/
/windows/
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ SPEC CHECKSUMS:
FirebaseSessions: f06853e30f99fe42aa511014d7ee6c8c319f08a3
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_pdfview: 25f53dd6097661e6395b17de506e6060585946bd
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: d053d902a8edaa9904e1bd00c37535385b8ed152
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
Expand All @@ -178,4 +178,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: fc3db2f9f5ceae2fafe56a753ba65bbc08579976

COCOAPODS: 1.12.0
COCOAPODS: 1.16.2
34 changes: 22 additions & 12 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -357,6 +357,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -396,7 +397,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos;
Expand All @@ -413,9 +414,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 1.1.2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HMSBNA6XJL;
ENABLE_BITCODE = NO;
Expand All @@ -429,7 +431,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.gussuri.beta;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GUSSSURI_IOS_AppStore_Provisioning_Profile;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GUSSSURI_IOS_AppStore_Provisioning_Profile_2;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand All @@ -445,6 +447,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -490,7 +493,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos;
Expand All @@ -502,6 +505,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -541,7 +545,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = NO;
SDKROOT = iphoneos;
Expand All @@ -560,9 +564,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = HMSBNA6XJL;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1.1.2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HMSBNA6XJL;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -574,7 +580,8 @@
MARKETING_VERSION = 0.6.1;
PRODUCT_BUNDLE_IDENTIFIER = com.gussuri.beta;
PRODUCT_NAME = "$(TARGET_NAME)";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GUSSSURI_IOS_AppStore_Provisioning_Profile;
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GUSSSURI_IOS_AppStore_Provisioning_Profile_2;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand All @@ -594,9 +601,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = HMSBNA6XJL;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1.1.2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = HMSBNA6XJL;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -608,7 +617,8 @@
MARKETING_VERSION = 0.6.1;
PRODUCT_BUNDLE_IDENTIFIER = com.gussuri.beta;
PRODUCT_NAME = "$(TARGET_NAME)";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GUSSSURI_IOS_AppStore_Provisioning_Profile;
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GUSSSURI_IOS_AppStore_Provisioning_Profile_2;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions ios/Runner/GoogleService-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>832218827991-vpqhq3rm8dg2a52ng80i8nklvech5v4s.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.832218827991-vpqhq3rm8dg2a52ng80i8nklvech5v4s</string>
<key>API_KEY</key>
<string>AIzaSyAwvnGstXArW3t6P86Kt7pMsu6zsh360xc</string>
<key>GCM_SENDER_ID</key>
<string>832218827991</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.gussuri</string>
<key>PROJECT_ID</key>
<string>gussuri-7bb52</string>
<key>STORAGE_BUCKET</key>
<string>gussuri-7bb52.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:832218827991:ios:bf6fbf2669866e61af7492</string>
</dict>
</plist>
5 changes: 5 additions & 0 deletions ios/Runner/RunnerProfile.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
5 changes: 5 additions & 0 deletions ios/Runner/RunnerRelease.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
1 change: 1 addition & 0 deletions ios/Runner/ja.lproj/LaunchScreen.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions ios/Runner/ja.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file added lib/component/IconBtn.dart
Empty file.
141 changes: 94 additions & 47 deletions lib/component/slide_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,114 @@ class SlideButton extends StatefulWidget {

class SlideButtonState extends State<SlideButton>
with TickerProviderStateMixin {
List<bool> isSelected = List.generate(11, (i) => false);
List<bool> isSelected = List.generate(11, (_) => false);
late final Function(int?) submitOnChanged;

// todo ここを動的に動かしたい
final ScrollController _scrollController =
ScrollController(initialScrollOffset: 140.w);
final ScrollController _scrollController = ScrollController();

@override
void initState() {
super.initState();
if (widget.onChanged != null) {
submitOnChanged = widget.onChanged!;
}
setState(() {
isSelected[widget.value] = true;
submitOnChanged = widget.onChanged ?? (_) {};

int reversedIndex = 10 - widget.value;
isSelected[reversedIndex] = true;

WidgetsBinding.instance.addPostFrameCallback((_) {
_scrollController.jumpTo((reversedIndex * 40).w);
});
}

void scrollToIndex(int index) {
double position = index * 40.w;
_scrollController.animateTo(
position,
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}

void scrollLeft() {
double newOffset = (_scrollController.offset - 40.w).clamp(0, _scrollController.position.maxScrollExtent);
_scrollController.animateTo(
newOffset,
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}

void scrollRight() {
double newOffset = (_scrollController.offset + 40.w).clamp(0, _scrollController.position.maxScrollExtent);
_scrollController.animateTo(
newOffset,
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}

@override
Widget build(BuildContext context) {
final localizations = AppLocalizations.of(context)!;

return InputCard(
title: localizations.inputLastnight,
form: SizedBox(
height: 70.h,
child: ListView.builder(
shrinkWrap: true,
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: isSelected.length,
itemBuilder: (context, index) {
return Column(
children: [
ElevatedButton(
onPressed: () {
setState(() {
isSelected = List.generate(11, (index) => false);
isSelected[index] = true;
submitOnChanged(index);
});
},
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
backgroundColor: Colors.white),
child: ClipOval(
child: Opacity(
opacity: isSelected[index] ? 1 : 0.5,
child: Image.asset('images/evaluation_$index.jpg'),
)),
),
Text(
'${localizations.rate} ${index + 1}',
style: TextStyle(
color: isSelected[index]
? Colors.black.withOpacity(1)
: Colors.black.withOpacity(0.4)),
)
],
);
}),
form: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
IconButton(
icon: const Icon(Icons.arrow_left, size: 32),
onPressed: scrollLeft,
),

Expanded(
child: SizedBox(
height: 70.h,
child: ListView.builder(
shrinkWrap: true,
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: isSelected.length,
itemBuilder: (context, index) {
return Column(
children: [
ElevatedButton(
onPressed: () {
setState(() {
isSelected.fillRange(0, isSelected.length, false);
isSelected[index] = true;
submitOnChanged(10 - index);
scrollToIndex(index);
});
},
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
backgroundColor: Colors.white),
child: ClipOval(
child: Opacity(
opacity: isSelected[index] ? 1 : 0.5,
child: Image.asset('images/evaluation_${10 - index}.jpg'),
),
),
),
Text(
'${localizations.rate} $index',
style: TextStyle(
color: isSelected[index]
? Colors.black
: Colors.black.withOpacity(0.4)),
)
],
);
},
),
),
),

IconButton(
icon: const Icon(Icons.arrow_right, size: 32),
onPressed: scrollRight,
),
],
),
);
}
Expand Down