Skip to content

Instantly share code, notes, and snippets.

View ProZhar's full-sized avatar
🏠
Working from home

ProZhar

🏠
Working from home
View GitHub Profile
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:18 — forked from eduardoflorence/main.dart
GetX - Sample StateManager without GetMaterialApp
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(MaterialApp(home: HomePage()));
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:18 — forked from eduardoflorence/main.dart
Getx - Sample SuperController and FullLifeCycleController
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
page: () => HomePage(),
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:18 — forked from eduardoflorence/main.dart
GetX - Sample GetMiddleware
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class GlobalMiddleware extends GetMiddleware {
final authController = Get.find<AuthController>();
@override
RouteSettings redirect(String route) {
return authController.authenticated || route == '/login'
? null
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:17 — forked from eduardoflorence/main.dart
GetX - Sample Translation with GetStorage, GetxService, DropDownButton and PopMenuButton
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await initialConfig();
final storage = Get.find<StorageService>();
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:17 — forked from eduardoflorence/main.dart
GetX - Sample BottomNavigationBar
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
debugShowCheckedModeBanner: false,
initialRoute: '/home',
defaultTransition: Transition.fade,
getPages: [
GetPage(
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:17 — forked from eduardoflorence/main.dart
GetX - Sample ScrollMixin and Pagination
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
page: () => HomePage(),
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:17 — forked from eduardoflorence/main.dart
GetX - Sample MixinBuilder
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(home: HomePage()));
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:17 — forked from eduardoflorence/main.dart
Flutter Modular with pushNamed/pushReplacementNamed and RouterOutlet
import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
void main() {
runApp(ModularApp(module: AppModule(), child: AppWidget()));
}
class AppModule extends Module {
@override
List<ModularRoute> get routes => [
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:17 — forked from eduardoflorence/main.dart
Clear text field
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
@ProZhar
ProZhar / main.dart
Created February 18, 2023 13:17 — forked from eduardoflorence/main.dart
Getx - Sample Form
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/login',
getPages: [
GetPage(
name: '/login',
page: () => LoginPage(),