Skip to content

Commit

Permalink
refactoring - do not clone this branch unless you know whare you are …
Browse files Browse the repository at this point in the history
…doing
  • Loading branch information
sudo-which-qp committed Dec 4, 2024
1 parent e61599e commit 717b335
Show file tree
Hide file tree
Showing 57 changed files with 509 additions and 564 deletions.

This file was deleted.

74 changes: 0 additions & 74 deletions lib/app/resources/home/views/cloud_notes/models/user_model.g.dart

This file was deleted.

47 changes: 0 additions & 47 deletions lib/app/resources/home/views/local_notes/models/note_model.g.dart

This file was deleted.

89 changes: 0 additions & 89 deletions lib/app/router/route_config.dart

This file was deleted.

17 changes: 10 additions & 7 deletions lib/app/src/app.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:flashy_flushbar/flashy_flushbar_provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:note_app/app/router/route_config.dart';
import 'package:note_app/cubits/theme_cubit/theme_cubit.dart';
import 'package:note_app/utils/custom_theme.dart';
import 'package:note_app/config/router/routes.dart';
import 'package:note_app/config/router/routes_name.dart';
import 'package:note_app/state/cubits/theme_cubit/theme_cubit.dart';
import 'package:note_app/utils/themes/custom_theme.dart';
import 'package:provider/provider.dart';

class App extends StatefulWidget {
Expand All @@ -19,13 +20,15 @@ class _AppState extends State<App> {
return ScreenUtilInit(
designSize: const Size(375, 812),
builder: (BuildContext context, Widget? child) {
return MaterialApp.router(
return MaterialApp(
debugShowCheckedModeBanner: false,
theme:
context.watch<ThemeCubit>().state.isDarkTheme == false ? buildLightTheme() : buildDarkTheme(),
theme: context.watch<ThemeCubit>().state.isDarkTheme == false
? buildLightTheme()
: buildDarkTheme(),
title: 'VNotes',
routerConfig: AppNavigation.router,
builder: FlashyFlushbarProvider.init(),
initialRoute: RoutesName.home_screen,
onGenerateRoute: Routes.generateRoute,
);
},
);
Expand Down
35 changes: 35 additions & 0 deletions lib/config/router/navigates_to.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:flutter/material.dart';

Future navigateTo(
BuildContext context, {
required String destination,
Map<String, dynamic>? arguments,
}) {
return Navigator.pushNamed(
context,
destination,
arguments: arguments,
);
}

Future navigateReplaceTo(
BuildContext context, {
required String destination,
Map<String, dynamic>? arguments,
}) {
return Navigator.pushReplacementNamed(context, destination,
arguments: arguments);
}

Future navigateEndTo(
BuildContext context, {
required String destination,
Map<String, dynamic>? arguments,
}) {
return Navigator.pushNamedAndRemoveUntil(
context,
destination,
arguments: arguments,
(route) => false,
);
}
Loading

0 comments on commit 717b335

Please sign in to comment.