Created
July 6, 2022 07:24
-
-
Save velotiotech/79ea2c811b70b0f49ad0e771adb2b235 to your computer and use it in GitHub Desktop.
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:flutter/widgets.dart'; | |
import 'package:get/get.dart'; | |
import 'package:sprinkle_architecture_exp_2/views/counter_page_controller.dart'; | |
class CounterPage extends GetWidget<CounterPageController> { | |
const CounterPage({Key? key, required this.title}) : super(key: key); | |
final String title; | |
CounterPageController get c => Get.put(CounterPageController()); | |
@override | |
Widget build(BuildContext context) { | |
return Obx(() { | |
return Scaffold( | |
appBar: AppBar(title: Text(title)), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
const Text('You have pushed the button this many times:'), | |
Text('${c.manager.getCounter}', | |
style: Theme.of(context).textTheme.headline4), | |
], | |
), | |
), | |
floatingActionButton: FloatingActionButton( | |
onPressed: c.manager.increment, | |
tooltip: 'Increment', | |
child: const Icon(Icons.add), | |
), | |
); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment