Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
committed Jan 13, 2025
1 parent 680ed02 commit 040da36
Show file tree
Hide file tree
Showing 178 changed files with 126 additions and 13,835 deletions.
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies:
flutter:
sdk: 'flutter'
path: '^1.9.0'
database_universe: '^0.0.15'
database_universe_flutter_libs: '^0.0.15'
database_universe: '^0.0.16'
database_universe_flutter_libs: '^0.0.16'
general_lib: '^0.0.58'
general_lib_flutter: '^0.0.39'
dev_dependencies:
Expand Down
5 changes: 5 additions & 0 deletions library/database_universe/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.16

- New Version 0.0.16


## 0.0.15

- New Version 0.0.15
Expand Down
4 changes: 2 additions & 2 deletions library/database_universe/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'database_universe'
description: 'Database Universe Library for help you save any data in anywhere with high performance speed, easy feature and ready for scala business'
version: '0.0.15'
version: '0.0.16'
homepage: 'https://youtube.com/@azkadev'
repository: 'https://github.com/azkadev/database_universe.git'
issue_tracker: 'https://t.me/DEVELOPER_GLOBAL_PUBLIC'
Expand All @@ -26,7 +26,7 @@ environment:
dependencies:
analyzer: '>=7.1.0 <8.0.0'
build: '^2.4.2'
database_universe_flutter_libs: '^0.0.15'
database_universe_flutter_libs: '^0.0.16'
ffi: '>=2.1.3 <3.0.0'
flutter:
sdk: 'flutter'
Expand Down
5 changes: 5 additions & 0 deletions library/database_universe_flutter_libs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.16

- New Version 0.0.16


## 0.0.15

- New Version 0.0.15
Expand Down
3 changes: 2 additions & 1 deletion library/database_universe_flutter_libs/dev/install.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import 'dart:io';
import 'package:general_lib/general_lib.dart';

void main() {
print(Dart.pub.installFromDirectoryFresh(directoryPackage: Directory.current));
print(
Dart.pub.installFromDirectoryFresh(directoryPackage: Directory.current));
}
2 changes: 1 addition & 1 deletion library/database_universe_flutter_libs/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'database_universe_flutter_libs'
description: 'Database Universe Library for help you save any data in anywhere with high performance speed, easy feature and ready for scala business'
version: '0.0.15'
version: '0.0.16'
homepage: 'https://youtube.com/@azkadev'
repository: 'https://github.com/azkadev/database_universe.git'
issue_tracker: 'https://t.me/DEVELOPER_GLOBAL_PUBLIC'
Expand Down
12 changes: 1 addition & 11 deletions library/database_universe_inspector/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
include: package:very_good_analysis/analysis_options.yaml

analyzer:
errors:
cascade_invocations: ignore
avoid_positional_boolean_parameters: ignore
parameter_assignments: ignore
public_member_api_docs: ignore
use_string_buffers: ignore
use_string_in_part_of_directives: ignore
lines_longer_than_80_chars: ignore
include: package:flutter_lints/flutter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'dart:convert';
// import 'dart:html';
import 'dart:math';

import 'package:clickup_fading_scroll/clickup_fading_scroll.dart';
// import 'package:clickup_fading_scroll/clickup_fading_scroll.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:database_universe/database_universe.dart';
Expand Down Expand Up @@ -95,37 +95,32 @@ class _CollectionAreaState extends State<CollectionArea> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: FadingScroll(
child: CustomScrollView(
controller: controller,
builder: (context, controller) {
return CustomScrollView(
controller: controller,
slivers: [
SliverToBoxAdapter(
child: QueryGroup(
key: Key('${widget.schema.name}-filter'),
schema: widget.schema,
group: filter,
level: 0,
onChanged: (group) {
setState(() {
filter = group;
});
_runQuery();
},
),
),
ObjectsListSliver(
instance: widget.instance,
collection: widget.collection,
schemas: widget.schemas,
objects: objects,
onUpdate: _onUpdate,
onDelete: _onDelete,
),
],
);
},
slivers: [
SliverToBoxAdapter(
child: QueryGroup(
key: Key('${widget.schema.name}-filter'),
schema: widget.schema,
group: filter,
level: 0,
onChanged: (group) {
setState(() {
filter = group;
});
_runQuery();
},
),
),
ObjectsListSliver(
instance: widget.instance,
collection: widget.collection,
schemas: widget.schemas,
objects: objects,
onUpdate: _onUpdate,
onDelete: _onDelete,
),
],
),
),
const SizedBox(height: 20),
Expand Down
3 changes: 2 additions & 1 deletion library/database_universe_inspector/lib/connect_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class ConnectClient {
final _queryChangedController = StreamController<void>.broadcast();

Stream<void> get instancesChanged => _instancesChangedController.stream;
Stream<void> get collectionInfoChanged => _collectionInfoChangedController.stream;
Stream<void> get collectionInfoChanged =>
_collectionInfoChangedController.stream;
Stream<void> get queryChanged => _queryChangedController.stream;

static Future<ConnectClient> connect(String port, String secret) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class _ConnectedLayoutState extends State<ConnectedLayout> {
if (mounted && selectedInstance == instance) {
setState(() {
schemas.addAll(newSchemas);
selectedCollection = schemas.where((e) => !e.embedded).firstOrNull?.name;
selectedCollection =
schemas.where((e) => !e.embedded).firstOrNull?.name;
});
}
});
Expand Down
4 changes: 1 addition & 3 deletions library/database_universe_inspector/lib/error_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ class ErrorScreen extends StatelessWidget {
const Text('Please make sure your Isar instance is running.'),
const SizedBox(height: 40),
ElevatedButton(
onPressed: (){

},
onPressed: () {},
child: const Text('Retry Connection'),
),
],
Expand Down
4 changes: 3 additions & 1 deletion library/database_universe_inspector/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ class App extends StatelessWidget {
theme: ThemeData.from(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF9FC9FF),
brightness: DarkMode.of(context).darkMode ? Brightness.dark : Brightness.light,
brightness: DarkMode.of(context).darkMode
? Brightness.dark
: Brightness.light,
),
useMaterial3: true,
),
Expand Down
16 changes: 11 additions & 5 deletions library/database_universe_inspector/lib/object/property_value.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class PropertyValue extends StatelessWidget {
if (enumMap != null) {
return _EnumValue(
value: value,
isByte: type == DatabaseUniverseType.byte || type == DatabaseUniverseType.byteList,
isByte: type == DatabaseUniverseType.byte ||
type == DatabaseUniverseType.byteList,
enumMap: enumMap!,
onUpdate: onUpdate,
);
Expand Down Expand Up @@ -109,7 +110,8 @@ class _EnumValue extends StatelessWidget {
);

if (newValue != null) {
onUpdate?.call(!identical(newValue, nullValue) ? newValue : null);
onUpdate
?.call(!identical(newValue, nullValue) ? newValue : null);
}
},
child: Text(
Expand Down Expand Up @@ -163,7 +165,8 @@ class _BoolValue extends StatelessWidget {
],
);
if (newValue != null) {
onUpdate?.call(!identical(newValue, nullValue) ? newValue : null);
onUpdate
?.call(!identical(newValue, nullValue) ? newValue : null);
}
},
child: Text(
Expand Down Expand Up @@ -232,7 +235,8 @@ class _DateValue extends StatelessWidget {

@override
Widget build(BuildContext context) {
final date = value != null ? DateTime.fromMicrosecondsSinceEpoch(value!) : null;
final date =
value != null ? DateTime.fromMicrosecondsSinceEpoch(value!) : null;
return GestureDetector(
onTap: onUpdate == null
? null
Expand Down Expand Up @@ -273,7 +277,9 @@ class _StringValue extends StatefulWidget {

class _StringValueState extends State<_StringValue> {
late final controller = TextEditingController(
text: widget.value != null ? '"${widget.value.toString().replaceAll('\n', '⤵')}"' : '',
text: widget.value != null
? '"${widget.value.toString().replaceAll('\n', '⤵')}"'
: '',
);

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class QueryFilter extends StatelessWidget {
isDense: true,
items: [
for (final property in schema.idAndProperties)
if (property.type != DatabaseUniverseType.object && property.type != DatabaseUniverseType.objectList)
if (property.type != DatabaseUniverseType.object &&
property.type != DatabaseUniverseType.objectList)
DropdownMenuItem(
value: property.name,
child: Text(property.name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class FilterGroup extends FilterOperation {
@override
Filter? toIsarFilter() {
if (filters.isEmpty) return null;
final isarFilters = filters.map((e) => e.toIsarFilter()).whereType<Filter>().toList();
final isarFilters =
filters.map((e) => e.toIsarFilter()).whereType<Filter>().toList();
return and ? AndGroup(isarFilters) : OrGroup(isarFilters);
}
}
Expand All @@ -35,7 +36,28 @@ class FilterCondition extends FilterOperation {

@override
Filter toIsarFilter() {
return switch (type) { FilterType.equalTo => EqualCondition(property: property, value: value1), FilterType.greaterThan => GreaterCondition(property: property, value: value1), FilterType.lessThan => LessCondition(property: property, value: value1), FilterType.between => BetweenCondition(property: property, lower: value1, upper: value2), FilterType.startsWith => StartsWithCondition(property: property, value: value1! as String), FilterType.endsWith => EndsWithCondition(property: property, value: value1! as String), FilterType.contains => ContainsCondition(property: property, value: value1! as String), FilterType.matches => MatchesCondition(property: property, wildcard: value1! as String), FilterType.isNull => IsNullCondition(property: property), FilterType.isNotNull => NotGroup(IsNullCondition(property: property)), FilterType.elementIsNull => EqualCondition(property: property, value: null), FilterType.elementIsNotNull => GreaterCondition(property: property, value: null) };
return switch (type) {
FilterType.equalTo => EqualCondition(property: property, value: value1),
FilterType.greaterThan =>
GreaterCondition(property: property, value: value1),
FilterType.lessThan => LessCondition(property: property, value: value1),
FilterType.between =>
BetweenCondition(property: property, lower: value1, upper: value2),
FilterType.startsWith =>
StartsWithCondition(property: property, value: value1! as String),
FilterType.endsWith =>
EndsWithCondition(property: property, value: value1! as String),
FilterType.contains =>
ContainsCondition(property: property, value: value1! as String),
FilterType.matches =>
MatchesCondition(property: property, wildcard: value1! as String),
FilterType.isNull => IsNullCondition(property: property),
FilterType.isNotNull => NotGroup(IsNullCondition(property: property)),
FilterType.elementIsNull =>
EqualCondition(property: property, value: null),
FilterType.elementIsNotNull =>
GreaterCondition(property: property, value: null)
};
}
}

Expand Down Expand Up @@ -88,7 +110,8 @@ class QueryGroup extends StatelessWidget {
'Add a filter or nested group to limit the results.\n'
'Click the group type to change it.',
style: TextStyle(
color: theme.colorScheme.onPrimaryContainer.withOpacity(0.5),
color: theme.colorScheme.onPrimaryContainer
.withOpacity(0.5),
),
),
),
Expand All @@ -98,7 +121,8 @@ class QueryGroup extends StatelessWidget {
schema: schema,
group: filter,
level: level + 1,
onChanged: (updated) => _performUpdate(add: updated, remove: filter),
onChanged: (updated) =>
_performUpdate(add: updated, remove: filter),
onDelete: () => _performUpdate(remove: filter),
)
else
Expand All @@ -107,7 +131,8 @@ class QueryGroup extends StatelessWidget {
QueryFilter(
schema: schema,
condition: filter as FilterCondition,
onChanged: (updated) => _performUpdate(add: updated, remove: filter),
onChanged: (updated) =>
_performUpdate(add: updated, remove: filter),
),
const SizedBox(width: 5),
IconButton(
Expand Down
4 changes: 3 additions & 1 deletion library/database_universe_inspector/lib/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class Sidebar extends StatelessWidget {
IconButton(
padding: const EdgeInsets.all(20),
icon: Icon(
theme.brightness == Brightness.light ? Icons.dark_mode_rounded : Icons.light_mode_rounded,
theme.brightness == Brightness.light
? Icons.dark_mode_rounded
: Icons.light_mode_rounded,
),
onPressed: DarkMode.of(context).toggle,
),
Expand Down
4 changes: 3 additions & 1 deletion library/database_universe_inspector/lib/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import 'package:database_universe/database_universe.dart';
extension CollectionInfoX on DatabaseUniverseSchema {
List<DatabaseUniversePropertySchema> get idAndProperties {
final props = [
if (!this.embedded && !properties.any((e) => e.name == idName)) DatabaseUniversePropertySchema(name: idName!, type: DatabaseUniverseType.long),
if (!this.embedded && !properties.any((e) => e.name == idName))
DatabaseUniversePropertySchema(
name: idName!, type: DatabaseUniverseType.long),
...properties,
];
props.sort((a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@

#include "generated_plugin_registrant.h"

#include <media_kit_video/media_kit_video_plugin.h>
#include <database_universe_flutter_libs/database_universe_flutter_libs_plugin.h>
#include <media_kit_video_fork/media_kit_video_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) media_kit_video_registrar =
g_autoptr(FlPluginRegistrar) database_universe_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DatabaseUniverseFlutterLibsPlugin");
database_universe_flutter_libs_plugin_register_with_registrar(database_universe_flutter_libs_registrar);
g_autoptr(FlPluginRegistrar) media_kit_video_fork_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitVideoPlugin");
media_kit_video_plugin_register_with_registrar(media_kit_video_registrar);
media_kit_video_plugin_register_with_registrar(media_kit_video_fork_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
media_kit_video
database_universe_flutter_libs
media_kit_video_fork
url_launcher_linux
)

Expand Down
Loading

0 comments on commit 040da36

Please sign in to comment.