Skip to content

Commit d218104

Browse files
committed
Update next-gen-ui rebuild script
1 parent 7051ba9 commit d218104

File tree

1 file changed

+44
-43
lines changed

1 file changed

+44
-43
lines changed

next-gen-ui/codelab_rebuild.yaml

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,8 +1582,9 @@ steps:
15821582
return ListenableBuilder(
15831583
listenable: _heartbeatAnim,
15841584
builder: (_, __) {
1585-
final heartbeatEnergy =
1586-
_heartbeatAnim.drive(_heartbeatSequence).value;
1585+
final heartbeatEnergy = _heartbeatAnim
1586+
.drive(_heartbeatSequence)
1587+
.value;
15871588
return TweenAnimationBuilder(
15881589
tween: Tween<double>(
15891590
begin: widget.minEnergy,
@@ -2566,7 +2567,7 @@ steps:
25662567
patch-u: |
25672568
--- b/next-gen-ui/step_04_c/lib/title_screen/title_screen_ui.dart
25682569
+++ a/next-gen-ui/step_04_c/lib/title_screen/title_screen_ui.dart
2569-
@@ -228,33 +228,40 @@ class _StartBtnState extends State<_StartBtn> {
2570+
@@ -228,33 +228,41 @@ class _StartBtnState extends State<_StartBtn> {
25702571
}
25712572
_wasHovered = (state.isHovered || state.isFocused);
25722573
return SizedBox(
@@ -2589,43 +2590,45 @@ steps:
25892590
- style: TextStyles.btn.copyWith(
25902591
- fontSize: 24,
25912592
- letterSpacing: 18,
2592-
+ width: 520,
2593-
+ height: 100,
2594-
+ child: Stack(
2595-
+ children: [
2596-
+ Positioned.fill(
2597-
+ child: Image.asset(AssetPaths.titleStartBtn),
2598-
),
2593+
- ),
25992594
- ),
26002595
- ],
26012596
- ),
26022597
- ),
26032598
- ],
26042599
- ),
26052600
- );
2606-
+ if (state.isHovered || state.isFocused) ...[
2607-
+ Positioned.fill(
2608-
+ child: Image.asset(AssetPaths.titleStartBtnHover),
2609-
+ ),
2610-
+ ],
2611-
+ Center(
2612-
+ child: Row(
2613-
+ mainAxisAlignment: MainAxisAlignment.end,
2614-
+ children: [
2615-
+ Text(
2616-
+ 'START MISSION',
2617-
+ style: TextStyles.btn.copyWith(
2618-
+ fontSize: 24,
2619-
+ letterSpacing: 18,
2620-
+ ),
2601+
+ width: 520,
2602+
+ height: 100,
2603+
+ child:
2604+
+ Stack(
2605+
+ children: [
2606+
+ Positioned.fill(
2607+
+ child: Image.asset(AssetPaths.titleStartBtn),
2608+
+ ),
2609+
+ if (state.isHovered || state.isFocused) ...[
2610+
+ Positioned.fill(
2611+
+ child: Image.asset(AssetPaths.titleStartBtnHover),
26212612
+ ),
26222613
+ ],
2623-
+ ),
2624-
+ ),
2625-
+ ],
2626-
+ )
2627-
+ .animate(autoPlay: false, onInit: (c) => _btnAnim = c)
2628-
+ .shimmer(duration: .7.seconds, color: Colors.black),
2614+
+ Center(
2615+
+ child: Row(
2616+
+ mainAxisAlignment: MainAxisAlignment.end,
2617+
+ children: [
2618+
+ Text(
2619+
+ 'START MISSION',
2620+
+ style: TextStyles.btn.copyWith(
2621+
+ fontSize: 24,
2622+
+ letterSpacing: 18,
2623+
+ ),
2624+
+ ),
2625+
+ ],
2626+
+ ),
2627+
+ ),
2628+
+ ],
2629+
+ )
2630+
+ .animate(autoPlay: false, onInit: (c) => _btnAnim = c)
2631+
+ .shimmer(duration: .7.seconds, color: Colors.black),
26292632
+ )
26302633
+ .animate()
26312634
+ .fadeIn(delay: 2.3.seconds)
@@ -2655,7 +2658,7 @@ steps:
26552658
patch-u: |
26562659
--- b/next-gen-ui/step_04_d/lib/title_screen/title_screen_ui.dart
26572660
+++ a/next-gen-ui/step_04_d/lib/title_screen/title_screen_ui.dart
2658-
@@ -169,10 +169,17 @@ class _DifficultyBtn extends StatelessWidget {
2661+
@@ -169,10 +169,16 @@ class _DifficultyBtn extends StatelessWidget {
26592662
child: Stack(
26602663
children: [
26612664
/// Bg with fill and outline
@@ -2664,10 +2667,9 @@ steps:
26642667
- color: const Color(0xFF00D1FF).withAlpha(25),
26652668
- border: Border.all(color: Colors.white, width: 5),
26662669
+ AnimatedOpacity(
2667-
+ opacity:
2668-
+ (!selected && (state.isHovered || state.isFocused))
2669-
+ ? 1
2670-
+ : 0,
2670+
+ opacity: (!selected && (state.isHovered || state.isFocused))
2671+
+ ? 1
2672+
+ : 0,
26712673
+ duration: .3.seconds,
26722674
+ child: Container(
26732675
+ decoration: BoxDecoration(
@@ -3069,7 +3071,7 @@ steps:
30693071
Color get _emitColor =>
30703072
AppColors.emitColors[_difficultyOverride ?? _difficulty];
30713073
Color get _orbColor =>
3072-
@@ -27,88 +48,190 @@ class _TitleScreenState extends State<TitleScreen> {
3074+
@@ -27,88 +48,189 @@ class _TitleScreenState extends State<TitleScreen> {
30733075

30743076
/// Currently focused difficulty (if any)
30753077
int? _difficultyOverride;
@@ -3259,10 +3261,9 @@ steps:
32593261
+ materialColor: orbColor,
32603262
+ lightColor: orbColor,
32613263
+ ),
3262-
+ onUpdate:
3263-
+ (energy) => setState(() {
3264-
+ _orbEnergy = energy;
3265-
+ }),
3264+
+ onUpdate: (energy) => setState(() {
3265+
+ _orbEnergy = energy;
3266+
+ }),
32663267
+ ),
32673268
+ ],
32683269
+ ),
@@ -3327,7 +3328,7 @@ steps:
33273328
),
33283329
),
33293330
);
3330-
@@ -119,19 +242,26 @@ class _LitImage extends StatelessWidget {
3331+
@@ -119,19 +241,26 @@ class _LitImage extends StatelessWidget {
33313332
const _LitImage({
33323333
required this.color,
33333334
required this.imgSrc,
@@ -3460,7 +3461,7 @@ steps:
34603461
import 'title_screen_ui.dart';
34613462

34623463
class TitleScreen extends StatefulWidget {
3463-
@@ -200,6 +201,16 @@ class _TitleScreenState extends State<TitleScreen>
3464+
@@ -199,6 +200,16 @@ class _TitleScreenState extends State<TitleScreen>
34643465
lightAmt: _finalEmitLightAmt,
34653466
),
34663467

0 commit comments

Comments
 (0)