Skip to content

build issue #3732

@zulufkoc-bot

Description

@zulufkoc-bot
PS C:\Downloads\untitled> dart run build_runner build                                                  
Building package executable... (5.9s)
Built build_runner:build_runner.
**Built with build_runner/jit in 1s; wrote 0 outputs.**  

pubspect.yaml

environment:
  #sdk: '>=3.0.0 <4.0.0' # Güncel SDK alt sınırı
  sdk: ^3.9.0-44.0.dev

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.8
  flutter_riverpod: ^2.5.1
  android_intent_plus: ^6.0.0
  receive_intent: ^0.2.7
  http: ^1.6.0
  flutter_foreground_task: ^9.2.0

  path: ^1.8.3
  sqlite3: ^2.3.0
  sqlite3_flutter_libs: ^0.5.18
  equatable: ^2.0.5

  drift: ^2.30.0
  drift_flutter: ^0.2.8
  path_provider: ^2.1.5

dev_dependencies:
  flutter_test:
    sdk: flutter

  drift_dev: ^2.30.0
  build_runner: ^2.10.4

lib\data\app_database.dart

import 'package:drift/drift.dart';
import 'package:drift_flutter/drift_flutter.dart';
import 'package:path_provider/path_provider.dart';

part 'database.g.dart';

class TodoItems extends Table {
  IntColumn get id => integer().autoIncrement()();
  TextColumn get title => text().withLength(min: 6, max: 32)();
  TextColumn get content => text().named('body')();
  DateTimeColumn get createdAt => dateTime().nullable()();
}

@DriftDatabase(tables: [TodoItems])
class AppDatabase extends _$AppDatabase {
  // After generating code, this class needs to define a `schemaVersion` getter
  // and a constructor telling drift where the database should be stored.
  // These are described in the getting started guide: https://drift.simonbinder.eu/setup/
  AppDatabase([QueryExecutor? executor]) : super(executor ?? _openConnection());

  @override
  int get schemaVersion => 1;

  static QueryExecutor _openConnection() {
    return driftDatabase(
      name: 'my_database',
      native: const DriftNativeOptions(
        // By default, `driftDatabase` from `package:drift_flutter` stores the
        // database files in `getApplicationDocumentsDirectory()`.
        databaseDirectory: getApplicationSupportDirectory,
      ),
      // If you need web support, see https://drift.simonbinder.eu/platforms/web/
    );
  }
}

I couldn't figure out where the problem is; I would appreciate your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions