Skip to content

Commit cca35a9

Browse files
committed
Updated to latest version of Flutter.
1 parent 4f77ebb commit cca35a9

File tree

6 files changed

+99
-61
lines changed

6 files changed

+99
-61
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
import lldb
6+
7+
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
8+
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
9+
base = frame.register["x0"].GetValueAsAddress()
10+
page_len = frame.register["x1"].GetValueAsUnsigned()
11+
12+
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
13+
# first page to see if handled it correctly. This makes diagnosing
14+
# misconfiguration (e.g. missing breakpoint) easier.
15+
data = bytearray(page_len)
16+
data[0:8] = b'IHELPED!'
17+
18+
error = lldb.SBError()
19+
frame.GetThread().GetProcess().WriteMemory(base, data, error)
20+
if not error.Success():
21+
print(f'Failed to write into {base}[+{page_len}]', error)
22+
return
23+
24+
def __lldb_init_module(debugger: lldb.SBDebugger, _):
25+
target = debugger.GetDummyTarget()
26+
# Caveat: must use BreakpointCreateByRegEx here and not
27+
# BreakpointCreateByName. For some reasons callback function does not
28+
# get carried over from dummy target for the later.
29+
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
30+
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
31+
bp.SetAutoContinue(True)
32+
print("-- LLDB integration loaded --")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
command script import --relative-to-command-file flutter_lldb_helper.py

lib/main.dart

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class FlutterFlipApp extends StatelessWidget {
4040
onGenerateRoute: (settings) {
4141
return PageRouteBuilder<dynamic>(
4242
settings: settings,
43-
pageBuilder:
44-
(context, animation, secondaryAnimation) => const GameScreen(),
43+
pageBuilder: (context, animation, secondaryAnimation) =>
44+
const GameScreen(),
4545
);
4646
},
4747
);
@@ -91,33 +91,34 @@ class GameScreenState extends State<GameScreen> {
9191
// moves, and models with the results of CPU moves. These are fed into the
9292
// StreamBuilder in [build], and used to create the widgets that comprise
9393
// the game's display.
94-
_modelStream = StreamGroup.merge([
95-
_userMovesController.stream,
96-
_restartController.stream,
97-
]).asyncExpand((model) async* {
98-
yield model;
94+
_modelStream =
95+
StreamGroup.merge([
96+
_userMovesController.stream,
97+
_restartController.stream,
98+
]).asyncExpand((model) async* {
99+
yield model;
99100

100-
var newModel = model;
101+
var newModel = model;
101102

102-
while (newModel.player == PieceType.white) {
103-
final finder = MoveFinder(newModel.board);
104-
final moveFuture = finder.findNextMove(newModel.player, 5);
103+
while (newModel.player == PieceType.white) {
104+
final finder = MoveFinder(newModel.board);
105+
final moveFuture = finder.findNextMove(newModel.player, 5);
105106

106-
// Guarantee the move takes at least a second to arrive, giving the UI
107-
// a chance to animate for each move.
108-
final result = await Future.wait([
109-
moveFuture,
110-
Future.delayed(Duration(seconds: 1)),
111-
]);
107+
// Guarantee the move takes at least a second to arrive, giving the UI
108+
// a chance to animate for each move.
109+
final result = await Future.wait([
110+
moveFuture,
111+
Future.delayed(Duration(seconds: 1)),
112+
]);
112113

113-
final move = result[0] as Position?;
114+
final move = result[0] as Position?;
114115

115-
if (move != null) {
116-
newModel = newModel.updateForMove(move.x, move.y);
117-
yield newModel;
118-
}
119-
}
120-
});
116+
if (move != null) {
117+
newModel = newModel.updateForMove(move.x, move.y);
118+
yield newModel;
119+
}
120+
}
121+
});
121122
}
122123

123124
// Thou shalt tidy up thy stream controllers.
@@ -155,16 +156,14 @@ class GameScreenState extends State<GameScreen> {
155156

156157
Widget _buildScoreBox(PieceType player, GameModel model) {
157158
var label = player == PieceType.black ? 'black' : 'white';
158-
var scoreText =
159-
player == PieceType.black
160-
? '${model.blackScore}'
161-
: '${model.whiteScore}';
159+
var scoreText = player == PieceType.black
160+
? '${model.blackScore}'
161+
: '${model.whiteScore}';
162162

163163
return DecoratedBox(
164-
decoration:
165-
(model.player == player)
166-
? Styling.activePlayerIndicator
167-
: Styling.inactivePlayerIndicator,
164+
decoration: (model.player == player)
165+
? Styling.activePlayerIndicator
166+
: Styling.inactivePlayerIndicator,
168167
child: Column(
169168
children: <Widget>[
170169
Text(

lib/thinking_indicator.dart

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ class _ThinkingIndicatorState
3434
height: widget.height,
3535
child: Opacity(
3636
opacity: _opacityTween!.evaluate(animation),
37-
child:
38-
_opacityTween!.evaluate(animation) != 0
39-
? AnimatedCircles(color: widget.color, height: widget.height)
40-
: null,
37+
child: _opacityTween!.evaluate(animation) != 0
38+
? AnimatedCircles(color: widget.color, height: widget.height)
39+
: null,
4140
),
4241
),
4342
);
@@ -73,15 +72,18 @@ class AnimatedCirclesState extends State<AnimatedCircles>
7372
@override
7473
void initState() {
7574
super.initState();
76-
_thinkingController = AnimationController(
77-
duration: const Duration(milliseconds: 500),
78-
vsync: this,
79-
)..addStatusListener((status) {
80-
// This bit ensures that the animation reverses course rather than
81-
// stopping.
82-
if (status == AnimationStatus.completed) _thinkingController.reverse();
83-
if (status == AnimationStatus.dismissed) _thinkingController.forward();
84-
});
75+
_thinkingController =
76+
AnimationController(
77+
duration: const Duration(milliseconds: 500),
78+
vsync: this,
79+
)..addStatusListener((status) {
80+
// This bit ensures that the animation reverses course rather than
81+
// stopping.
82+
if (status == AnimationStatus.completed)
83+
_thinkingController.reverse();
84+
if (status == AnimationStatus.dismissed)
85+
_thinkingController.forward();
86+
});
8587
_thinkingAnimation = Tween(begin: 0.0, end: widget.height).animate(
8688
CurvedAnimation(parent: _thinkingController, curve: Curves.easeOut),
8789
);

pubspec.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ packages:
55
dependency: "direct main"
66
description:
77
name: async
8-
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
8+
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "2.12.0"
11+
version: "2.13.0"
1212
boolean_selector:
1313
dependency: transitive
1414
description:
@@ -45,10 +45,10 @@ packages:
4545
dependency: transitive
4646
description:
4747
name: fake_async
48-
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
48+
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
4949
url: "https://pub.dev"
5050
source: hosted
51-
version: "1.3.2"
51+
version: "1.3.3"
5252
flutter:
5353
dependency: "direct main"
5454
description: flutter
@@ -58,10 +58,10 @@ packages:
5858
dependency: "direct dev"
5959
description:
6060
name: flutter_lints
61-
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
61+
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
6262
url: "https://pub.dev"
6363
source: hosted
64-
version: "5.0.0"
64+
version: "6.0.0"
6565
flutter_test:
6666
dependency: "direct dev"
6767
description: flutter
@@ -71,10 +71,10 @@ packages:
7171
dependency: transitive
7272
description:
7373
name: leak_tracker
74-
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
74+
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
7575
url: "https://pub.dev"
7676
source: hosted
77-
version: "10.0.8"
77+
version: "10.0.9"
7878
leak_tracker_flutter_testing:
7979
dependency: transitive
8080
description:
@@ -95,10 +95,10 @@ packages:
9595
dependency: transitive
9696
description:
9797
name: lints
98-
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
98+
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
9999
url: "https://pub.dev"
100100
source: hosted
101-
version: "5.1.1"
101+
version: "6.0.0"
102102
matcher:
103103
dependency: transitive
104104
description:
@@ -196,10 +196,10 @@ packages:
196196
dependency: transitive
197197
description:
198198
name: vm_service
199-
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
199+
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
200200
url: "https://pub.dev"
201201
source: hosted
202-
version: "14.3.1"
202+
version: "15.0.0"
203203
sdks:
204-
dart: ">=3.7.0 <4.0.0"
204+
dart: ">=3.8.0 <4.0.0"
205205
flutter: ">=3.18.0-18.0.pre.54"

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: flutterflip
22
description: A Reversi game built with Flutter.
33

44
environment:
5-
sdk: '>=3.7.0 <4.0.0'
5+
sdk: '>=3.8.0 <4.0.0'
66

77
dependencies:
8-
async: ^2.12.0
8+
async: ^2.13.0
99
flutter:
1010
sdk: flutter
1111

1212
dev_dependencies:
13-
flutter_lints: ^5.0.0
13+
flutter_lints: ^6.0.0
1414
flutter_test:
1515
sdk: flutter
1616

0 commit comments

Comments
 (0)