Skip to content

Commit

Permalink
优化焦点效果
Browse files Browse the repository at this point in the history
  • Loading branch information
富丽饼干 authored and 富丽饼干 committed Jan 9, 2023
1 parent b2cad31 commit b733476
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 52 deletions.
2 changes: 1 addition & 1 deletion lib/app/modules/countries/views/countries_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CountriesView extends GetView<CountriesController> {
itemBuilder: (BuildContext context, int index) {
final item = controller.countries[index];
return Obx(() => DPadDetector(
focusColor: Colors.red,
focusColor: Colors.blue,
onMenuTap: () {},
onTap: () {
controller.selectItem(index);
Expand Down
30 changes: 19 additions & 11 deletions lib/utils/widget/dpad_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,29 @@ class _DPadDetectorState extends State<DPadDetector> {
onLongPress: () {
widget.onMenuTap?.call();
},
child: CustomAnimation<double>(
control: hasFocus
? CustomAnimationControl.playReverse
: CustomAnimationControl.play,
tween: Tween(begin: 0, end: 1),
duration: const Duration(milliseconds: 250),
builder: (context, child, value) {
child: PlayAnimationBuilder<double>(
tween: Tween(begin: 2.0, end: 1.0),
duration: const Duration(seconds: 1),
child: widget.child,
// builder: (context, value, child) {
// return Container(
// width: value,
// height: value,
// color: Colors.green,
// child: child, // use child inside the animation
// );
// },
builder: (context, value, child) {
return Container(
margin: EdgeInsets.all(value * 8),
margin: EdgeInsets.all(value * 2),
// color: Colors.transparent,
decoration: BoxDecoration(
color: hasFocus?widget.focusColor.withOpacity(value):Colors.transparent,
color: hasFocus
? widget.focusColor.withOpacity(value * 0.4)
: Colors.transparent,
border: Border.all(
color: widget.focusColor.withOpacity(value * 0.2),
width: value,
color: widget.focusColor.withOpacity(value * 0.1),
width: hasFocus ? value * 4 : value,
),
borderRadius: BorderRadius.circular(widget.focusRadius),
),
Expand Down
2 changes: 1 addition & 1 deletion macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.11'
platform :osx, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
2 changes: 1 addition & 1 deletion macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ SPEC CHECKSUMS:
path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
shared_preferences_macos: 8b221d457159a85f478c0b9d2f19aeae9feff475

PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
PODFILE CHECKSUM: 8d40c19d3cbdb380d870685c3a564c989f1efa52

COCOAPODS: 1.11.3
37 changes: 1 addition & 36 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_hls_parser:
dependency: "direct main"
description:
name: flutter_hls_parser
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -345,13 +338,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.11.1"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -387,13 +373,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.1"
rational:
dependency: transitive
description:
Expand Down Expand Up @@ -491,7 +470,7 @@ packages:
name: simple_animations
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.1"
version: "5.0.0+3"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -546,20 +525,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
supercharged:
dependency: transitive
description:
name: supercharged
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
supercharged_dart:
dependency: transitive
description:
name: supercharged_dart
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
synchronized:
dependency: transitive
description:
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ environment:
dependencies:
cupertino_icons: ^1.0.2
get: ^4.6.5
flutter_hls_parser: ^2.0.0
dio: ^4.0.6
flustars: ^2.0.1
logger: ^1.1.0
simple_animations: ^3.1.1
simple_animations: ^5.0.0+3
m3u_nullsafe: ^1.0.4
file_saver: ^0.1.1
flutter:
Expand Down

0 comments on commit b733476

Please sign in to comment.