tecfy_basic_package 1.5.15 tecfy_basic_package: ^1.5.15 copied to clipboard
Package includes all components and services used on most applications.
import 'package:example/employee/employee_form.page.dart';
import 'package:example/employee/employee_list.page.dart';
import 'package:flutter/material.dart';
import 'package:tecfy_basic_package/tecfy_basic_package.dart';
import 'package:lifecycle/lifecycle.dart';
void main() {
TecfyBasicApp.themeConfig = ThemeConfigMock();
BeamerService.pages = [
EmployeeListPage().beamer,
EmployeeFormPage().beamer,
];
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorObservers: [defaultLifecycleObserver],
title: 'My Application',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'My Application'),
);
}
}
class MyHomePage extends StatefulWidget {
final String? title;
MyHomePage({Key? key, this.title}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title ?? "Default"),
),
body: Center(
child: Column(
children: <Widget>[
AppButtonIconText(
icon: Icon(Icons.add),
label: 'Employees Page',
onPressed: () async {
AppNavigator.navigateTo(context, () => EmployeeListPage());
},
)
],
),
),
);
}
}