Skip to content

Commit

Permalink
Merge pull request #46 from moesaid/Error-on-edit-model
Browse files Browse the repository at this point in the history
Fix - Error on edit model
  • Loading branch information
moesaid authored Jan 7, 2025
2 parents a51bb4c + d1b4942 commit c1cae47
Show file tree
Hide file tree
Showing 84 changed files with 588 additions and 620 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
3 changes: 1 addition & 2 deletions lib/App/Controllers/Dashboard/dashboard_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:flutterpp/App/Services/Auth/profile_services.dart';
import 'package:flutterpp/App/Services/Client/client_services.dart';
import 'package:flutterpp/App/Services/Invoice/invoice_services.dart';
import 'package:flutterpp/App/Services/Project/project_services.dart';
import 'package:flutterpp/App/Services/Project/wiki_services.dart';
import 'package:flutterpp/App/Services/Team/team_member_services.dart';
import 'package:flutterpp/App/Services/Team/team_services.dart';
import 'package:flutterpp/App/Views/Global/build_overlay.dart';
Expand All @@ -31,7 +30,7 @@ class DashboardController extends GetxController {
final _activeProjectStorage = ActiveProjectStorage();
final _teamMemberServices = TeamMemberServices();
final _profileServices = ProfileServices();
final _wikiServices = WikiServices();
// final _wikiServices = WikiServices();
final _clientServices = ClientServices();
final _invoiceServices = InvoiceServices();

Expand Down
2 changes: 1 addition & 1 deletion lib/App/Controllers/Global/app_update_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AppUpdateController extends GetxController {
_fetchApi() async {
final data = await http.get(
Uri.parse(
"https://api.github.com/repos/moesaid/FlutterPP_Public/releases/latest",
"https://api.github.com/repos/moesaid/FlutterPP/releases/latest",
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ class ProjectSingleCodeGenController extends GetxController {
}

// if name already exists
if (_models.any((el) => el.modelName == _tempModel.value.modelName)) {
if (_models.any((el) =>
el.modelName == _tempModel.value.modelName &&
el.id != _tempModel.value.id)) {
FlutterPlatformAlert.playAlertSound();
FlutterPlatformAlert.showAlert(
windowTitle: 'Oops!',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ class ProjectSingleController extends GetxController {
}

// if project id is empty
if (project.id == null || project.id!.isEmpty) return;
if (project.id == null || project.id?.isEmpty == true) return;

Get.showOverlay(
await Get.showOverlay(
asyncFunction: () async {
String? path = await createProjectPathBasedOnState(
type: project.stateManagement,
type: project.stateManagement ?? StateManegmentEnum.getx.name,
);

if (path == null || path.isEmpty) return;

// save project path
await _projectLocalPathStorage.write(
project: ProjectLocalPathModel(
Expand Down
2 changes: 0 additions & 2 deletions lib/App/Enums/background_enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ enum BackgroundEnum {
return 'gradient';
case BackgroundEnum.image:
return 'image';
default:
return 'solid';
}
}
}
3 changes: 0 additions & 3 deletions lib/App/Enums/state_manegment_enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ enum StateManegmentEnum {
case StateManegmentEnum.cubit:
await cubit?.call();
break;
default:
await getx?.call();
break;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,17 @@ class FileGenBlocCounterCase {
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: Colors.grey.withOpacity(0.2),
color: Colors.grey.withValues(alpha:0.2),
),
shape: BoxShape.circle,
color: Colors.black.withOpacity(
color: Colors.black.withValues(alpha:
state / 100,
),
boxShadow: [
BoxShadow(
blurRadius: 20,
spreadRadius: -6,
color: Colors.black.withOpacity(
color: Colors.black.withValues(alpha:
state / 100,
),
offset: const Offset(0, 10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,17 @@ class FileGenGetxCounterCase {
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: Colors.grey.withOpacity(0.2),
color: Colors.grey.withValues(alpha:0.2),
),
shape: BoxShape.circle,
color: Colors.black.withOpacity(
color: Colors.black.withValues(alpha:
controller.count / 100,
),
boxShadow: [
BoxShadow(
blurRadius: 20,
spreadRadius: -6,
color: Colors.black.withOpacity(
color: Colors.black.withValues(alpha:
controller.count / 100,
),
offset: const Offset(0, 10),
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Providers/Network/Error/sentry_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentryProvider {
final entries = feedback?.extra?.entries;
if (entries != null) {
for (final extra in entries) {
scope.setExtra(extra.key, extra.value);
scope.setContexts(extra.key, extra.value);
}
}
scope.setUser(
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Services/Cmd/cmd_read_create_dir_services.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CmdReadCreateDirServices {
String version,
StateManegmentEnum state,
) {
print('❌ state: $state');
AppPrint.print('❌ state: $state');

return {
'owner': 'FlutterPP',
Expand Down
2 changes: 2 additions & 0 deletions lib/App/Services/Invoice/invoice_services.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: depend_on_referenced_packages

import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutterpp/App/Models/client_model.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/App/Views/Global/build_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class BuildLeading extends StatelessWidget {
SizedBox(
height: preferredSize.height,
width: 0,
child: VerticalDivider(color: Colors.grey.withOpacity(0.35)),
child: VerticalDivider(color: Colors.grey.withValues(alpha: 0.35)),
),
if (hasBackButton != null && hasBackButton!)
InkWell(
Expand All @@ -124,7 +124,7 @@ class BuildLeading extends StatelessWidget {
height: preferredSize.height,
width: preferredSize.height,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(0.1),
color: Colors.grey.withValues(alpha: 0.1),
),
child: Icon(
Icons.arrow_back,
Expand All @@ -137,7 +137,7 @@ class BuildLeading extends StatelessWidget {
height: preferredSize.height,
width: 0,
child: VerticalDivider(
color: Colors.grey.withOpacity(0.35),
color: Colors.grey.withValues(alpha: 0.35),
),
),
],
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Views/Global/build_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BuildDialog extends StatelessWidget {
alignment: Alignment.center,
children: [
Container(
color: Get.theme.dialogBackgroundColor.withOpacity(0.5),
color: Get.theme.dialogBackgroundColor.withValues(alpha: 0.5),
child: GestureDetector(
onTap: () => Get.back(),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Views/Global/build_full_page_bottomsheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BuildFullPageBottomSheet extends StatelessWidget {
decoration: decoration ??
BoxDecoration(
color: bgColor ??
Get.theme.scaffoldBackgroundColor.withOpacity(0.9),
Get.theme.scaffoldBackgroundColor.withValues(alpha: 0.9),
),
child: child ??
Text(
Expand Down
14 changes: 8 additions & 6 deletions lib/App/Views/Global/build_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ class BuildAppUpdateWidget extends StatelessWidget {
return GetBuilder<AppUpdateController>(
init: AppUpdateController(),
initState: (_) {},
builder: (_) {
if (_.isLoading || _.currentVersion.isEmpty || _.lastVersion.isEmpty) {
builder: (controller) {
if (controller.isLoading ||
controller.currentVersion.isEmpty ||
controller.lastVersion.isEmpty) {
return const SizedBox.shrink();
}

return UpdatWidget(
currentVersion: _.currentVersion,
getLatestVersion: _.getLatestVersion,
getBinaryUrl: _.getBinaryUrl,
currentVersion: controller.currentVersion,
getLatestVersion: controller.getLatestVersion,
getBinaryUrl: controller.getBinaryUrl,
appName: "FlutterPP",
updateChipBuilder: floatingExtendedChipWithSilentDownload,
);
Expand All @@ -102,7 +104,7 @@ class BuildLayoutAppbar extends StatelessWidget {
height: 28,
width: context.width,
decoration: BoxDecoration(
color: Get.theme.colorScheme.background.withOpacity(0.2),
color: Get.theme.colorScheme.surface.withValues(alpha: 0.2),
border: Border(
bottom: BorderSide(
width: 1,
Expand Down
4 changes: 2 additions & 2 deletions lib/App/Views/Global/build_preeset_gradient_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BuildPresetGradientList

return Scaffold(
backgroundColor:
Get.theme.colorScheme.primaryContainer.withOpacity(0.95),
Get.theme.colorScheme.primaryContainer.withValues(alpha: 0.95),
body: SizedBox(
width: double.infinity,
height: double.infinity,
Expand Down Expand Up @@ -63,7 +63,7 @@ class BuildPresetGradientList
borderRadius: BorderRadius.circular(5),
border: Border.all(
color: Get.theme.colorScheme.onPrimary
.withOpacity(0.1),
.withValues(alpha: 0.1),
),
),
child: Column(
Expand Down
3 changes: 2 additions & 1 deletion lib/App/Views/Global/build_rail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BuildRail extends StatelessWidget {
return Container(
width: AppConfig.rail,
decoration: BoxDecoration(
color: Get.theme.colorScheme.background,
color: Get.theme.colorScheme.surface,
border: Border(
right: BorderSide(
width: 1,
Expand All @@ -47,6 +47,7 @@ class BuildRail extends StatelessWidget {
),
Expanded(
child: NavigationRail(
backgroundColor: Get.theme.colorScheme.surface,
minWidth: AppConfig.rail * 0.7,
selectedIndex: selectedIndex,
onDestinationSelected: (int index) =>
Expand Down
3 changes: 2 additions & 1 deletion lib/App/Views/Global/build_search_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class BuildSearchForm extends StatelessWidget {
),
),
hintStyle: Get.textTheme.bodyMedium?.copyWith(
color: Get.theme.colorScheme.onSurface.withOpacity(0.4),
color:
Get.theme.colorScheme.onSurface.withValues(alpha: 0.4),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Views/Global/build_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BuildSidebar extends StatelessWidget {
width: AppConfig.sidebar,
height: double.infinity,
decoration: BoxDecoration(
color: Get.theme.colorScheme.background.withOpacity(0.7),
color: Get.theme.colorScheme.surface.withValues(alpha: 0.7),
border: Border(
right: BorderSide(
width: 1,
Expand Down
13 changes: 7 additions & 6 deletions lib/App/Views/Global/build_slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ class BuildSlider extends StatelessWidget {
state.controller?.onChange(value: defaultValue ?? 0);
}
},
builder: (_) {
builder: (controller) {
final double localMax = max ?? 100;
final double localMin = min ?? 0;
final double localValue = _.sliderValue > localMax
final double localValue = controller.sliderValue > localMax
? localMax
: _.sliderValue < localMin
: controller.sliderValue < localMin
? localMin
: _.sliderValue;
: controller.sliderValue;

return SliderTheme(
data: SliderTheme.of(context).copyWith(
Expand All @@ -66,7 +66,8 @@ class BuildSlider extends StatelessWidget {
max: localMax,
divisions: divisions ?? 20,
activeColor: Get.theme.primaryColor,
inactiveColor: Get.theme.colorScheme.onBackground.withOpacity(0.1),
inactiveColor:
Get.theme.colorScheme.onSurface.withValues(alpha: 0.1),
thumbColor: Get.theme.primaryColor,
value: localValue,
label: localValue.toStringAsFixed(fractionDigits ?? 0),
Expand All @@ -81,7 +82,7 @@ class BuildSlider extends StatelessWidget {
return;
}

_.onChange(
controller.onChange(
value: value,
callback: onChanged,
);
Expand Down
8 changes: 4 additions & 4 deletions lib/App/Views/Global/build_time_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BuildTimeOverlay extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 200.spa,
width: context.width * 0.5,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Get.theme.colorScheme.surface,
Expand All @@ -22,8 +22,8 @@ class BuildTimeOverlay extends StatelessWidget {
child: Column(
children: [
SizedBox(
width: 200.spa,
height: 80.spa,
width: context.width,
height: context.width * 0.3,
child: Image.asset(
'assets/images/time.gif',
fit: BoxFit.cover,
Expand All @@ -38,7 +38,7 @@ class BuildTimeOverlay extends StatelessWidget {
'Hold tight!',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 6.spa,
fontSize: context.textTheme.titleLarge?.fontSize,
fontWeight: FontWeight.bold,
),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/App/Views/Global/build_windows_buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BuildWindowsButtons extends StatelessWidget {
// },
// afterHoverColor: Colors.green,
// beforeHoverColor:
// Get.theme.colorScheme.onBackground.withOpacity(0.4),
// Get.theme.colorScheme.onBackground.withValues(alpha:0.4),
// ),
// const SizedBox(width: 6),
BuildAppbarPlatformButton(
Expand All @@ -37,7 +37,7 @@ class BuildWindowsButtons extends StatelessWidget {
onTap: () async => await win.minimize(),
afterHoverColor: Colors.yellow,
beforeHoverColor:
Get.theme.colorScheme.onBackground.withOpacity(0.4),
Get.theme.colorScheme.onSurface.withValues(alpha: 0.4),
),
const SizedBox(width: 6),
BuildAppbarPlatformButton(
Expand All @@ -50,7 +50,7 @@ class BuildWindowsButtons extends StatelessWidget {
await systemTray.destroy();
},
beforeHoverColor:
Get.theme.colorScheme.onBackground.withOpacity(0.4),
Get.theme.colorScheme.onSurface.withValues(alpha: 0.4),
),
const SizedBox(width: 6),
],
Expand Down
3 changes: 2 additions & 1 deletion lib/App/Views/Pages/Auth/setup_local_flutter_path_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ class BuildListView extends StatelessWidget {
fontWeight: FontWeight.w300,
color: isFlutter
? Get.theme.colorScheme.onPrimary
: Get.theme.colorScheme.onPrimary.withOpacity(0.5)),
: Get.theme.colorScheme.onPrimary
.withValues(alpha: 0.5)),
),
);
},
Expand Down
Loading

0 comments on commit c1cae47

Please sign in to comment.