-
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.
Merge pull request #1 from tofylion/improvement/organization
Improvement/organization
- Loading branch information
Showing
42 changed files
with
198 additions
and
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ migrate_working_dir/ | |
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
pubspec.lock | ||
.pub/ | ||
/build/ | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,27 @@ | ||
{ | ||
"48dcd3_00-06-00": "C51M5R2NBBA", | ||
"48dcd3_00-15-00": "Og6BSeZIL3s", | ||
"48dcd3_00-25-00": "ZgupBRtBWjs", | ||
"48dcd3_01-05-00": "XuSbsjphvJA", | ||
"48dcd3_01-10-00": "2ivnkuewxKM", | ||
"ad969d_00-00-30": "Pg1sWkt-YWg", | ||
"ad969d_00-15-00": "SQrTn2gmqps", | ||
"ad969d_00-43-00": "38hitgoLLQs", | ||
"ad969d_01-11-00": "P_o90PO12Tw", | ||
"ad969d_01-35-00": "Eb6y-SnGvKE", | ||
"e0e547_00-00-00": "gU5IdCxgI1k", | ||
"e0e547_00-08-00": "G2dgLw9Gsw0", | ||
"e0e547_00-15-00": "mHbe2YpsN8s", | ||
"e0e547_00-50-00": "IzCrrWyhDGU", | ||
"e0e547_01-00-00": "j14fZMQRkC0", | ||
"e8a35a_00-02-00": "dS5L-4ibJf0", | ||
"e8a35a_00-07-00": "BaunHoekZYw", | ||
"e8a35a_00-14-00": "sb0wimGysUY", | ||
"e8a35a_01-05-00": "7-Y-Z4kcJvo", | ||
"e8a35a_01-14-00": "7kk4NRfAff4", | ||
"ec7a6a_00-30-00": "ta7R86C2aqI", | ||
"ec7a6a_00-53-00": "-Q1mXZFole8", | ||
"ec7a6a_01-19-00": "rwHyDwB04-4", | ||
"ec7a6a_01-30-00": "lznuZ1bPlrs", | ||
"ec7a6a_01-40-00": "gcFLTwbAncE" | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
class Timing { | ||
static const Duration zero = Duration.zero; | ||
static const Duration inputShadowDuration = Duration(milliseconds: 100); | ||
static const Duration mainTransitionDuration = Duration(milliseconds: 750); | ||
} |
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 |
---|---|---|
@@ -1,27 +1,6 @@ | ||
const videoIds = { | ||
'48dcd3_00-06-00': 'C51M5R2NBBA', | ||
'48dcd3_00-15-00': 'Og6BSeZIL3s', | ||
'48dcd3_00-25-00': 'ZgupBRtBWjs', | ||
'48dcd3_01-05-00': 'XuSbsjphvJA', | ||
'48dcd3_01-10-00': '2ivnkuewxKM', | ||
'ad969d_00-00-30': 'Pg1sWkt-YWg', | ||
'ad969d_00-15-00': 'SQrTn2gmqps', | ||
'ad969d_00-43-00': '38hitgoLLQs', | ||
'ad969d_01-11-00': 'P_o90PO12Tw', | ||
'ad969d_01-35-00': 'Eb6y-SnGvKE', | ||
'e0e547_00-00-00': 'gU5IdCxgI1k', | ||
'e0e547_00-08-00': 'G2dgLw9Gsw0', | ||
'e0e547_00-15-00': 'mHbe2YpsN8s', | ||
'e0e547_00-50-00': 'IzCrrWyhDGU', | ||
'e0e547_01-00-00': 'j14fZMQRkC0', | ||
'e8a35a_00-02-00': 'dS5L-4ibJf0', | ||
'e8a35a_00-07-00': 'BaunHoekZYw', | ||
'e8a35a_00-14-00': 'sb0wimGysUY', | ||
'e8a35a_01-05-00': '7-Y-Z4kcJvo', | ||
'e8a35a_01-14-00': '7kk4NRfAff4', | ||
'ec7a6a_00-30-00': 'ta7R86C2aqI', | ||
'ec7a6a_00-53-00': '-Q1mXZFole8', | ||
'ec7a6a_01-19-00': 'rwHyDwB04-4', | ||
'ec7a6a_01-30-00': 'lznuZ1bPlrs', | ||
'ec7a6a_01-40-00': 'gcFLTwbAncE' | ||
}; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:annotations_helper/services/json_utils.dart'; | ||
|
||
final videoIdsProvider = FutureProvider<Map<String, dynamic>>((ref) async { | ||
return loadJson('youtube_ids.json', assetPath: 'video_ids'); | ||
}); |
File renamed without changes.
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,62 @@ | ||
import 'package:annotations_helper/constants/dimensions.dart'; | ||
import 'package:annotations_helper/constants/timing.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:sprung/sprung.dart'; | ||
|
||
class MainScreenAnimator extends AnimationController { | ||
MainScreenAnimator({required TickerProvider vsync}) : super(vsync: vsync) { | ||
duration = Timing.mainTransitionDuration; | ||
_initAnimations(); | ||
} | ||
|
||
late CurvedAnimation _curvedAnimationController; | ||
late Animation<double> _inputBoxMoveAnimation; | ||
late Animation<double> _mainActionButtonMoveAnimation; | ||
late Animation<double> _mainActionButtonWidthAnimation; | ||
late Animation<double> _mainActionButtonHeightAnimation; | ||
late Animation<double> _backButtonAnimation; | ||
|
||
final videoExpandedProvider = StateProvider<bool>((ref) => false); | ||
|
||
void _initAnimations() { | ||
_curvedAnimationController = CurvedAnimation( | ||
parent: this, | ||
curve: Sprung.overDamped, | ||
reverseCurve: Sprung.overDamped.flipped); | ||
_inputBoxMoveAnimation = Tween<double>( | ||
begin: Dimensions.inputBoxLocation, | ||
end: -Dimensions.inputBoxHeight - 10.sp) | ||
.animate(_curvedAnimationController); | ||
_mainActionButtonMoveAnimation = Tween<double>( | ||
begin: Dimensions.actionButtonLocation, | ||
end: Dimensions.videoPlayerLocation) | ||
.animate(_curvedAnimationController); | ||
_mainActionButtonWidthAnimation = Tween<double>( | ||
begin: Dimensions.actionButtonWidth, | ||
end: Dimensions.videoPlayerWidth) | ||
.animate(_curvedAnimationController); | ||
_mainActionButtonHeightAnimation = Tween<double>( | ||
begin: Dimensions.actionButtonHeight, | ||
end: Dimensions.videoPlayerHeight) | ||
.animate(_curvedAnimationController); | ||
_backButtonAnimation = | ||
Tween<double>(begin: -Dimensions.backButtonHeight - 10.sp, end: 0) | ||
.animate(_curvedAnimationController); | ||
} | ||
|
||
double get animationValue => _curvedAnimationController.value; | ||
|
||
double get inputBoxValue => _inputBoxMoveAnimation.value; | ||
|
||
double get mainActionButtonMoveValue => _mainActionButtonMoveAnimation.value; | ||
|
||
double get mainActionButtonWidthValue => | ||
_mainActionButtonWidthAnimation.value; | ||
|
||
double get mainActionButtonHeightValue => | ||
_mainActionButtonHeightAnimation.value; | ||
|
||
double get backButtonValue => _backButtonAnimation.value; | ||
} |
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
Oops, something went wrong.