mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-13 13:07:38 +02:00
feat: navigation setup.
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:revanced_manager_flutter/ui/screens/home_screen.dart';
|
||||
import 'package:revanced_manager_flutter/ui/screens/patcher_screen.dart';
|
||||
import 'constants.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
@ -11,11 +13,70 @@ class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'ReVanced Manager',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
theme: ThemeData.light().copyWith(
|
||||
backgroundColor: Colors.red,
|
||||
useMaterial3: true,
|
||||
colorScheme: const ColorScheme.light(
|
||||
primary: purple40,
|
||||
secondary: purpleGrey40,
|
||||
tertiary: pink40,
|
||||
background: Colors.red,
|
||||
),
|
||||
),
|
||||
darkTheme: ThemeData.dark().copyWith(
|
||||
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",
|
||||
),
|
||||
],
|
||||
),
|
||||
home: const HomeScreen(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user