easy_app 0.1.10 copy "easy_app: ^0.1.10" to clipboard
easy_app: ^0.1.10 copied to clipboard

A simple flutter package to make app easily. Provides useful functions for app. This package would be used in small-scale app, such as a personal app, or a test app.

example/lib/main.dart

import 'package:easy_app/easy_app.dart';
import 'package:easy_app/screen/base_screen.dart';
import 'package:easy_app/screen/drawer.dart';
import 'package:easy_app/screen/main_screen.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await EasyApp.initialize(homeScreen: HomeScreen(), languages: []);
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Easy App Example',
      home: MainScreen(
        sideMenu: SideMenu(
          title: const Text("Easy App"),
          appIcon: const Icon(Icons.ac_unit),
          backgroundColor: Colors.yellow,
          items: [
            SideMenuItem(
              title: const Text("Home"),
              icon: const Icon(Icons.home),
              onPressed: () {
                if (EasyApp.currentScreen is HomeScreen) return;
                EasyApp.pushPage(context, HomeScreen());
              },
              backgroundColor: Colors.transparent,
            ),
            SideMenuItem(
              title: const Text("Alarm"),
              icon: const Icon(Icons.access_alarm),
              onPressed: () {
                if (EasyApp.currentScreen is AlarmScreen) return;
                EasyApp.pushPage(context, AlarmScreen());
              },
              backgroundColor: Colors.transparent,
            ),
          ],
        ),
      ),
    );
  }
}

class HomeScreen extends BaseScreen {
  HomeScreen()
      : super(
          appBar: AppBar(
            title: const Text('Home'),
          ),
          screen: const Center(
            child: Text('Home Screen'),
          ),
        );
}

class AlarmScreen extends BaseScreen {
  AlarmScreen()
      : super(
          appBar: AppBar(
            title: const Text('Alarm'),
          ),
          screen: const Center(
            child: Text('Alarm Screen'),
          ),
        );
}
5
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A simple flutter package to make app easily. Provides useful functions for app. This package would be used in small-scale app, such as a personal app, or a test app.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

connectivity_plus, flutter, fluttertoast, path_provider, provider, receive_sharing_intent, uuid

More

Packages that depend on easy_app