Skip to content

Commit

Permalink
Merge branch 'surrealdb_console'
Browse files Browse the repository at this point in the history
  • Loading branch information
limcheekin committed Dec 13, 2023
2 parents 9299d1e + 127a715 commit 85b4e3b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
27 changes: 7 additions & 20 deletions surrealdb_console/lib/surrealdb_console_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:showcase_view/showcase_view.dart';
import 'package:surrealdb_console/surrealdb_console_widget.dart';
import 'package:surrealdb_console/surrealdb_console_widget_mobile.dart'
if (dart.library.html) 'package:surrealdb_console/surrealdb_console_widget_web.dart';

class SurrealdbConsoleScreen extends StatelessWidget {
const SurrealdbConsoleScreen({Key? key}) : super(key: key);
Expand All @@ -19,13 +19,11 @@ class SurrealdbConsoleScreen extends StatelessWidget {
Widget build(BuildContext context) {
return const ShowcaseView(
title: 'SurrealDB Console',
widget: kIsWeb
? SurrealdbConsoleWidget(
endpoint: 'indxdb://test',
ns: 'test',
db: 'test',
)
: SurrealdbConsoleWebOnly(),
widget: SurrealdbConsoleWidget(
endpoint: 'indxdb://test',
ns: 'test',
db: 'test',
),
owner: owner,
repository: repository,
ref: branch,
Expand All @@ -41,14 +39,3 @@ class SurrealdbConsoleScreen extends StatelessWidget {
);
}
}

class SurrealdbConsoleWebOnly extends StatelessWidget {
const SurrealdbConsoleWebOnly({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return const Center(
child: Text('Surrealdb Console is working in web only!'),
);
}
}
21 changes: 21 additions & 0 deletions surrealdb_console/lib/surrealdb_console_widget_mobile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';

class SurrealdbConsoleWidget extends StatelessWidget {
const SurrealdbConsoleWidget({
required this.endpoint,
this.ns,
this.db,
super.key,
});

final String endpoint;
final String? ns;
final String? db;

@override
Widget build(BuildContext context) {
return const Center(
child: Text('Surrealdb Console is working in web only!'),
);
}
}

1 comment on commit 85b4e3b

@limcheekin
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.