Last active
October 8, 2024 11:34
-
-
Save JannieT/1f214b4142bbc5b5eb3152f99421cef5 to your computer and use it in GitHub Desktop.
Signal Issue
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
import 'package:flutter/material.dart'; | |
import 'package:signals/signals_flutter.dart'; | |
void main() { | |
runApp(const CheckApp()); | |
} | |
class CheckApp extends StatelessWidget { | |
const CheckApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return const MaterialApp( | |
home: WatchDemo(), | |
); | |
} | |
} | |
class WatchDemo extends StatefulWidget { | |
const WatchDemo({super.key}); | |
@override | |
State<WatchDemo> createState() => _WatchDemoState(); | |
} | |
class _WatchDemoState extends State<WatchDemo> { | |
int _count = 0; | |
@override | |
Widget build(BuildContext context) { | |
return Watch( | |
(_) => Scaffold( | |
body: Center( | |
child: ElevatedButton( | |
onPressed: () { | |
setState(() { | |
_count++; | |
}); | |
}, | |
child: Text('$_count'), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment