revanced-manager/lib/main.dart

106 lines
2.8 KiB
Dart
Raw Normal View History

2022-07-30 21:09:59 +02:00
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
2022-07-30 21:20:36 +02:00
import 'package:revanced_manager_flutter/ui/screens/home_screen.dart';
2022-07-31 10:00:11 +02:00
import 'package:revanced_manager_flutter/ui/screens/patcher_screen.dart';
import 'constants.dart';
2022-07-30 21:09:59 +02:00
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
2022-07-31 10:00:11 +02:00
debugShowCheckedModeBanner: false,
2022-07-30 21:20:36 +02:00
title: 'ReVanced Manager',
2022-07-31 10:00:11 +02:00
theme: ThemeData.light().copyWith(
2022-08-01 10:38:22 +02:00
navigationBarTheme: NavigationBarThemeData(
labelTextStyle: MaterialStateProperty.all(
GoogleFonts.roboto(
fontSize: 12,
),
),
),
2022-07-31 10:00:11 +02:00
backgroundColor: Colors.red,
textTheme: GoogleFonts.interTextTheme(
Theme.of(context).textTheme,
),
2022-07-31 10:00:11 +02:00
useMaterial3: true,
colorScheme: const ColorScheme.light(
primary: purple40,
secondary: purpleGrey40,
tertiary: pink40,
background: Colors.red,
),
),
darkTheme: ThemeData.dark().copyWith(
2022-08-01 10:38:22 +02:00
navigationBarTheme: NavigationBarThemeData(
iconTheme: MaterialStateProperty.all(const IconThemeData(
color: Colors.white,
)),
indicatorColor: const Color(0xff223144),
backgroundColor: const Color(0x1b222b6b),
labelTextStyle: MaterialStateProperty.all(
GoogleFonts.roboto(
fontSize: 12,
),
),
),
2022-07-31 10:00:11 +02:00
backgroundColor: Colors.red,
useMaterial3: true,
scaffoldBackgroundColor: const Color(0xff0A0D11),
colorScheme: const ColorScheme.dark(
primary: purple80,
secondary: purpleGrey80,
tertiary: pink80,
background: Colors.red,
),
),
home: const Navigation(),
);
}
}
class Navigation extends StatefulWidget {
const Navigation({Key? key}) : super(key: key);
@override
State<Navigation> createState() => _NavigationState();
}
class _NavigationState extends State<Navigation> {
int currentPageIndex = 0;
final List<Widget> screens = [
HomeScreen(),
PatcherScreen(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: screens[currentPageIndex],
bottomNavigationBar: NavigationBar(
onDestinationSelected: (int index) {
setState(() {
currentPageIndex = index;
});
},
selectedIndex: currentPageIndex,
destinations: const <Widget>[
NavigationDestination(
icon: Icon(Icons.dashboard),
label: "Dashboard",
),
NavigationDestination(
icon: Icon(Icons.build),
label: "Patcher",
),
],
2022-07-30 21:09:59 +02:00
),
);
}
}