getx_plus 4.7.6
getx_plus: ^4.7.6 copied to clipboard
Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX.
example/lib/main.dart
import 'package:example/bottom_sheet_test.dart';
import 'package:flutter/material.dart';
import 'package:getx_plus/get.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return GetMaterialApp(home: HomePage());
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Home Page')),
body: SizedBox(
width: Get.width,
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Get.to(() => const BottomSheetTest());
},
child: const Text('Go to BottomSheetTest Page'),
),
],
),
),
);
}
}