simple_getx_folder_create 0.0.7
simple_getx_folder_create: ^0.0.7 copied to clipboard
A Dart CLI tool that scaffolds a complete GetX Flutter project structure, including pages, network layer, utils, widgets, and a wired main.dart with GetStorage and light/dark theme support out of the box.
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'network/api_service.dart';
import 'pages/splash/view/splash_page.dart';
import 'utils/routes.dart';
import 'utils/theme.dart';
import 'utils/theme_controller.dart';
void main() async {
await GetStorage.init();
Get.lazyPut(() => ThemeController());
Get.put(ApiService());
Get.put(const MaterialTheme(TextTheme()));
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return GetMaterialApp(
themeMode: Get.find<ThemeController>().isDarkMode.value
? ThemeMode.dark
: ThemeMode.light,
theme: MaterialTheme.constant.light(),
darkTheme: MaterialTheme.constant.dark(),
highContrastDarkTheme: MaterialTheme.constant.darkHighContrast(),
highContrastTheme: MaterialTheme.constant.lightHighContrast(),
getPages: getpages,
initialRoute: Splash.route,
);
}
}