rixa 0.0.7 rixa: ^0.0.7 copied to clipboard
Easy and simple way to design your application
import 'package:flutter/material.dart';
import 'package:rixa/rixa.dart';
import 'pages/widgets.dart';
import '/pages/login_page.dart';
import '/pages/page1.dart';
import '/pages/settings.dart';
import 'pages/app_design/page_control_panel.dart';
late AppColors appColors;
late AppFonts appFonts;
late AppSettings appSettings;
late PageManager pageManager;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
Rixa.setup(
pages: AppPages(
pages: [
NestedPage(
fonts: PageFonts(text_small: 10),
builder: (context, properties, child) => MyNestedPage(child: child),
children: [
RixaPage(
name: "page1",
fonts: PageFonts(text_small: 15),
builder: (context, properties) => const Page1(),
route: "/page1"),
RixaPage(
name: "page2",
route: "/page2",
redirectedChild: (properties) => "/a1",
children: [
NestedPage(
builder: (context, properties, child) =>
MyNestedPage(child: child),
children: [
RixaPage(
name: "a1",
builder: (context, properties) =>
const Settings(),
route: "/a1"),
]),
RixaPage(
route: "/b1",
name: "b1",
builder: (context, properties) => const Page1(),
children: [
RixaPage(route: "/c1", name: "b1c1"),
],
),
]),
RixaPage(
name: "settings",
builder: (context, properties) => const Settings(),
route: "/settings"),
RixaPage(
name: "widgets",
builder: (context, properties) => const Widgets(),
route: "/widgets"),
]),
RixaPage(
name: "login",
builder: (context, properties) => const LoginPage(),
route: "/login"),
RixaPage(
name: "lol",
route: "/",
redirect: (properties) => "/login",
)
],
initialRoute: "/login",
),
languages: AppLanguages(
languages: ["English", "Turkish"],
initLanguge: "English",
),
appearances: AppAppearances(
appearances: [
Appearance.dark(),
Appearance.light(),
],
initAppearance: Appearance.dark(),
),
);
appColors = Rixa.appColors;
appFonts = Rixa.appFonts;
appSettings = Rixa.appSettings;
pageManager = Rixa.pageManager;
pageManager = Rixa.pageManager;
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return RixaMaterial();
}
}