Skip to content

Instantly share code, notes, and snippets.

View eduardoflorence's full-sized avatar

Eduardo Florence eduardoflorence

View GitHub Profile
@eduardoflorence
eduardoflorence / main.dart
Created October 30, 2023 18:44
Modular 6 - BottomNavigationBar - RouterOutlet
import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
void main() {
runApp(ModularApp(module: AppModule(), child: const AppWidget()));
}
class AppWidget extends StatelessWidget {
const AppWidget({super.key});
@eduardoflorence
eduardoflorence / main.dart
Created November 29, 2022 14:13
Flutter StreamBuilder Shared
import 'package:flutter/material.dart';
import 'dart:async';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@eduardoflorence
eduardoflorence / main.dart
Created October 15, 2022 20:08
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(
@eduardoflorence
eduardoflorence / main.dart
Last active December 28, 2023 16:09
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 => [
@eduardoflorence
eduardoflorence / main.dart
Created April 5, 2021 20:06
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) {
@eduardoflorence
eduardoflorence / main.dart
Created April 1, 2021 00:10
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(),
@eduardoflorence
eduardoflorence / main.dart
Created March 23, 2021 19:12
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(
@eduardoflorence
eduardoflorence / main.dart
Created March 3, 2021 01:36
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>();
@eduardoflorence
eduardoflorence / main.dart
Created February 24, 2021 11:35
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
@eduardoflorence
eduardoflorence / main.dart
Last active November 14, 2024 06:21
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(),