dbhelper
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
import 'pages/login_page.dart';
|
||||
|
||||
void main() {
|
||||
void main() async {
|
||||
await dotenv.load(fileName: 'secrets.env');
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
||||
10
lib/pages/dashboard_page.dart
Normal file
10
lib/pages/dashboard_page.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyWidget extends StatelessWidget {
|
||||
const MyWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Placeholder();
|
||||
}
|
||||
}
|
||||
12
lib/services/dbhelper.dart
Normal file
12
lib/services/dbhelper.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
class DbHelper {
|
||||
static late final SupabaseClient _client;
|
||||
static Future<void> init() async {
|
||||
await Supabase.initialize(
|
||||
url: dotenv.env['SUPABASE_URL'] ?? '',
|
||||
anonKey: dotenv.env['SUPABASE_ANON'] ?? '');
|
||||
_client = Supabase.instance.client;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user