Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment and release #269

Closed
jmakinin opened this issue Sep 28, 2023 · 5 comments
Closed

Deployment and release #269

jmakinin opened this issue Sep 28, 2023 · 5 comments

Comments

@jmakinin
Copy link

jmakinin commented Sep 28, 2023

I have been facing issues building a workable release version of my application running the Prisma client with SQLite database.
The built release app cannot establish a connection to the SQLite database I am using.

My system is Windows 11

Flutter version

$ flutter --version
Flutter 3.10.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f468f3366c (3 months ago) • 2023-07-12 15:19:05 -0700
Engine • revision cdbeda788a
Tools • Dart 3.0.6 • DevTools 2.23.1

Dart version

$ dart --version
Dart SDK version: 3.0.6 (stable) (Tue Jul 11 18:49:07 2023 +0000) on "windows_x64"

And I am targeting deployment to the Windows platform.

this is the database connection class

import 'dart:io';
import 'package:orm/logger.dart';
import 'generated/prisma_client.dart';

class PrismaConnect {
static final databaseUrl =
Platform.script.resolve('assets/database/source.sqlite').toFilePath();
late final PrismaClient prisma;

PrismaConnect() {
_connect();
}

Future _connect() async {
prisma = PrismaClient(
stdout: Event.values,
datasources: Datasources(db: 'file:$databaseUrl'),
);
await prisma.$connect(); // Await the connection
}

Future close() async {
await prisma.$disconnect(); // Close the connection
}
}

this is the main application instance

import 'package:class_wise/core/utils/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:window_size/window_size.dart';
//routes
import 'package:class_wise/routes/router.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
setWindowTitle("CLassWise");
setWindowMinSize(const Size(1500, 900));
setWindowMaxSize(Size.infinite);

runApp(ProviderScope(
child: MyApp(),
));
}

class MyApp extends StatelessWidget {
final GoRouter _router = createRouter();
@OverRide
Widget build(BuildContext context) {
return MaterialApp.router(
debugShowCheckedModeBanner: false,
title: 'ClassWise',
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: bgColor,
textTheme: GoogleFonts.robotoFlexTextTheme(Theme.of(context).textTheme)
.apply(bodyColor: Colors.white),
canvasColor: secondaryColor,
),
routerConfig: _router,
);
}
}

I'm pretty new to this, and I have so far not seen a Flutter desktop application in production (I don't know of any at the moment that uses the stack I am using)
Any help will be much appreciated.

#Windows #Deployment #Production #BuildRelease #DatabaseConnection #Flutter #Dart

@medz
Copy link
Owner

medz commented Sep 30, 2023

At present, Flutter (native) is not supported and can only be used for the data proxy engine. It will take me about two months to solve this problem.

@jmakinin
Copy link
Author

okay, sure. I'm deadlocked in a project I'm currently working on, and the alternative is to change the entire stack if it can not be implemented as needed.

How can I help speed things up?

@medz
Copy link
Owner

medz commented Oct 2, 2023

okay, sure. I'm deadlocked in a project I'm currently working on, and the alternative is to change the entire stack if it can not be implemented as needed.

How can I help speed things up?

@jmakinin Can you help me speed up the implementation of this? There are many problems I have to deal with now. The first is debt, and the other is the adaptation of the new protocol of Prisma 5 (this will almost cause the entire project to be rewritten). I also need Prisma to dynamic library. It is really difficult to write. I am the only one maintaining the project from its inception to the present. I really have a lot of things that need to be done.

@medz
Copy link
Owner

medz commented Oct 16, 2023

I'm actively developing a new version to adapt to Prisma 5

@medz
Copy link
Owner

medz commented Jan 25, 2024

#328

@medz medz closed this as completed Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants