Set up Dev and Prod enviroments and updae docker to build prod enviroment
This commit is contained in:
Binary file not shown.
@@ -46,7 +46,7 @@ WORKDIR /app/
|
|||||||
# RUN flutter pub add web:^0.5.0
|
# RUN flutter pub add web:^0.5.0
|
||||||
# RUN flutter pub run pdfx:install_web
|
# RUN flutter pub run pdfx:install_web
|
||||||
RUN flutter upgrade
|
RUN flutter upgrade
|
||||||
RUN flutter build web
|
RUN flutter build web -t ./lib/main_prod.dart
|
||||||
|
|
||||||
# Record the exposed port
|
# Record the exposed port
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
enum Enviroment { dev, prod }
|
||||||
|
|
||||||
|
abstract class AppEnviroment {
|
||||||
|
static late String baseApiUrl;
|
||||||
|
static late Enviroment _enviroment;
|
||||||
|
static Enviroment get enviroment => _enviroment;
|
||||||
|
static setupEnv(Enviroment env) {
|
||||||
|
_enviroment = env;
|
||||||
|
switch (env) {
|
||||||
|
case Enviroment.dev:
|
||||||
|
{
|
||||||
|
baseApiUrl = "http://localhost";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Enviroment.prod:
|
||||||
|
{
|
||||||
|
baseApiUrl = "api";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static String getEnv() {
|
||||||
|
//_enviroment = env;
|
||||||
|
switch (_enviroment) {
|
||||||
|
case Enviroment.dev:
|
||||||
|
{
|
||||||
|
return "Dev";
|
||||||
|
}
|
||||||
|
case Enviroment.prod:
|
||||||
|
{
|
||||||
|
return "Prod";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,22 +1,28 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/router/routeGenerator.dart';
|
import 'package:patient_manager/router/routeGenerator.dart';
|
||||||
import 'package:patient_manager/theme/mihTheme.dart';
|
import 'package:patient_manager/theme/mihTheme.dart';
|
||||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||||
|
|
||||||
void main() async {
|
// void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
// WidgetsFlutterBinding.ensureInitialized();
|
||||||
await Supabase.initialize(
|
// await Supabase.initialize(
|
||||||
url: "https://stzluvsyhbwtfbztarmu.supabase.co",
|
// url: "https://stzluvsyhbwtfbztarmu.supabase.co",
|
||||||
anonKey:
|
// anonKey:
|
||||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN0emx1dnN5aGJ3dGZienRhcm11Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTIwNzUyMTMsImV4cCI6MjAyNzY1MTIxM30.a7VHlk63JJcAotvsqtoqiKwjNK4EbnNgKilAqt1iRio",
|
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN0emx1dnN5aGJ3dGZienRhcm11Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTIwNzUyMTMsImV4cCI6MjAyNzY1MTIxM30.a7VHlk63JJcAotvsqtoqiKwjNK4EbnNgKilAqt1iRio",
|
||||||
);
|
// );
|
||||||
runApp(const MzanziInnovationHub());
|
// runApp(const MzanziInnovationHub());
|
||||||
}
|
// }
|
||||||
|
|
||||||
final client = Supabase.instance.client;
|
final client = Supabase.instance.client;
|
||||||
|
|
||||||
class MzanziInnovationHub extends StatefulWidget {
|
class MzanziInnovationHub extends StatefulWidget {
|
||||||
const MzanziInnovationHub({super.key});
|
//final AppEnviroment appEnv;
|
||||||
|
|
||||||
|
const MzanziInnovationHub({
|
||||||
|
super.key,
|
||||||
|
//required this.appEnv,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MzanziInnovationHub> createState() => _MzanziInnovationHubState();
|
State<MzanziInnovationHub> createState() => _MzanziInnovationHubState();
|
||||||
@@ -62,7 +68,7 @@ class _MzanziInnovationHubState extends State<MzanziInnovationHub> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Mzansi Innovation Hub',
|
title: 'Mzansi Innovation Hub - ${AppEnviroment.getEnv()}',
|
||||||
themeMode: _themeMode,
|
themeMode: _themeMode,
|
||||||
theme: theme.darkMode(),
|
theme: theme.darkMode(),
|
||||||
darkTheme: theme.lightMode(),
|
darkTheme: theme.lightMode(),
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
|
AppEnviroment.setupEnv(Enviroment.dev);
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await Supabase.initialize(
|
await Supabase.initialize(
|
||||||
url: "https://stzluvsyhbwtfbztarmu.supabase.co",
|
url: "https://stzluvsyhbwtfbztarmu.supabase.co",
|
||||||
anonKey:
|
anonKey:
|
||||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN0emx1dnN5aGJ3dGZienRhcm11Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTIwNzUyMTMsImV4cCI6MjAyNzY1MTIxM30.a7VHlk63JJcAotvsqtoqiKwjNK4EbnNgKilAqt1iRio",
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN0emx1dnN5aGJ3dGZienRhcm11Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTIwNzUyMTMsImV4cCI6MjAyNzY1MTIxM30.a7VHlk63JJcAotvsqtoqiKwjNK4EbnNgKilAqt1iRio",
|
||||||
);
|
);
|
||||||
print(String.fromEnvironment('baseURL'));
|
//print(AppEnviroment.baseApiUrl);
|
||||||
runApp(const MzanziInnovationHub());
|
runApp(const MzanziInnovationHub());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:patient_manager/env/env.dart';
|
||||||
|
import 'package:patient_manager/main.dart';
|
||||||
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
AppEnviroment.setupEnv(Enviroment.prod);
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await Supabase.initialize(
|
||||||
|
url: "https://stzluvsyhbwtfbztarmu.supabase.co",
|
||||||
|
anonKey:
|
||||||
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN0emx1dnN5aGJ3dGZienRhcm11Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTIwNzUyMTMsImV4cCI6MjAyNzY1MTIxM30.a7VHlk63JJcAotvsqtoqiKwjNK4EbnNgKilAqt1iRio",
|
||||||
|
);
|
||||||
|
//print(AppEnviroment.baseApiUrl);
|
||||||
|
runApp(const MzanziInnovationHub());
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,5 @@
|
|||||||
4294967294,448
|
4294967294,449
|
||||||
4294967278,398
|
4294967278,389
|
||||||
4294967278,397
|
|
||||||
4294967293,131
|
4294967293,131
|
||||||
4294967293,130
|
4294967293,130
|
||||||
4294967293,129
|
4294967293,129
|
||||||
@@ -267,9 +266,9 @@
|
|||||||
4294967278,280
|
4294967278,280
|
||||||
4294967278,413
|
4294967278,413
|
||||||
4294967278,6
|
4294967278,6
|
||||||
|
4294967278,398
|
||||||
4294967278,258
|
4294967278,258
|
||||||
4294967278,5
|
4294967278,5
|
||||||
4294967278,389
|
|
||||||
4294967278,257
|
4294967278,257
|
||||||
4294967278,4
|
4294967278,4
|
||||||
4294967278,3
|
4294967278,3
|
||||||
@@ -295,3 +294,6 @@
|
|||||||
4294967279,442
|
4294967279,442
|
||||||
4294967279,126
|
4294967279,126
|
||||||
4294967279,441
|
4294967279,441
|
||||||
|
4294967279,256
|
||||||
|
4294967279,125
|
||||||
|
4294967279,440
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user