You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is my code; @entity
class Step { @PrimaryKey
int date;
int step;
int cal;
Step(this.date, this.step, this.cal);
}
@dao
abstract class StepDao { @query("SELECT * FROM Step")
Future<List> all();
@query("SELECT * FROM Step WHERE id = :id")
Future getById(int id);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date >= :begin and date <= :end GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date")
Future<List> getDaySteps(int begin, int end);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date>=:begin and date<=:end GROUP BY strftime('%Y-%m-%d',date) ORDER BY date")
Future<List> getWeekSteps(int begin, int end);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date >= :begin and date <= :end GROUP BY strftime('%Y-%m-%d',date) ORDER BY date")
Future<List> getMonthSteps(int begin, int end);
When I run build_runner ,catch error here:
Error formatting generated source code for package:squirrel/data/db/squirrel_band_database.dartwhich was output to lib/data/db/squirrel_band_database.floor.g.part.
This may indicate an issue in the generated code or in the formatter.
Please check the generated code and file an issue on source_gen if appropriate.
Could not format because the source could not be parsed:
line 89, column 196: Expected an identifier.
╷
89 │ @OverRide Future<List> getDaySteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 89, column 199: Expected an identifier.
╷
89 │ @OverRide Future<List> getDaySteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 89, column 204: Expected to find ','.
╷
89 │ @OverRide Future<List> getDaySteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^^^^^^^^^^^^^^^^^^^^^^
╵
line 90, column 193: Expected an identifier.
╷
90 │ @OverRide Future<List> getWeekSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date>=? and date<=? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 90, column 196: Expected an identifier.
╷
90 │ @OverRide Future<List> getWeekSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date>=? and date<=? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 90, column 198: Expected to find ','.
╷
90 │ @OverRide Future<List> getWeekSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date>=? and date<=? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^^^^^^^^^^^^^^^^^^^^^^
╵
line 91, column 198: Expected an identifier.
╷
91 │ @OverRide Future<List> getMonthSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 91, column 201: Expected an identifier.
╷
91 │ @OverRide Future<List> getMonthSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 91, column 203: Expected to find ','.
╷
91 │ @OverRide Future<List> getMonthSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^^^^^^^^^^^^^^^^^^^^^^
╵
[INFO] Running build completed, took 3.4s
@dao
abstract class StepDao { @query("SELECT * FROM Step")
Future<List> all();
@query("SELECT * FROM Step WHERE id = :id")
Future getById(int id);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date >= :begin and date <= :end GROUP BY strftime(\'%Y-%m-%d %H\',date) ORDER BY date")
Future<List> getDaySteps(int begin, int end);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date>=:begin and date<=:end GROUP BY strftime(\'%Y-%m-%d\',date) ORDER BY date")
Future<List> getWeekSteps(int begin, int end);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date >= :begin and date <= :end GROUP BY strftime(\'%Y-%m-%d\',date) ORDER BY date")
Future<List> getMonthSteps(int begin, int end);
Here is my code;
@entity
class Step {
@PrimaryKey
int date;
int step;
int cal;
Step(this.date, this.step, this.cal);
}
@dao
abstract class StepDao {
@query("SELECT * FROM Step")
Future<List> all();
@query("SELECT * FROM Step WHERE id = :id")
Future getById(int id);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date >= :begin and date <= :end GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date")
Future<List> getDaySteps(int begin, int end);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date>=:begin and date<=:end GROUP BY strftime('%Y-%m-%d',date) ORDER BY date")
Future<List> getWeekSteps(int begin, int end);
@query(
"SELECT sum(step),sum(cal),date FROM Step WHERE date >= :begin and date <= :end GROUP BY strftime('%Y-%m-%d',date) ORDER BY date")
Future<List> getMonthSteps(int begin, int end);
@insert
Future save(Step entity);
}
floor version: floor: ^0.9.0
When I run build_runner ,catch error here:
Error formatting generated source code for package:squirrel/data/db/squirrel_band_database.dartwhich was output to lib/data/db/squirrel_band_database.floor.g.part.
This may indicate an issue in the generated code or in the formatter.
Please check the generated code and file an issue on source_gen if appropriate.
Could not format because the source could not be parsed:
line 89, column 196: Expected an identifier.
╷
89 │ @OverRide Future<List> getDaySteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 89, column 199: Expected an identifier.
╷
89 │ @OverRide Future<List> getDaySteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 89, column 204: Expected to find ','.
╷
89 │ @OverRide Future<List> getDaySteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d %H',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^^^^^^^^^^^^^^^^^^^^^^
╵
line 90, column 193: Expected an identifier.
╷
90 │ @OverRide Future<List> getWeekSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date>=? and date<=? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 90, column 196: Expected an identifier.
╷
90 │ @OverRide Future<List> getWeekSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date>=? and date<=? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 90, column 198: Expected to find ','.
╷
90 │ @OverRide Future<List> getWeekSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date>=? and date<=? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^^^^^^^^^^^^^^^^^^^^^^
╵
line 91, column 198: Expected an identifier.
╷
91 │ @OverRide Future<List> getMonthSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 91, column 201: Expected an identifier.
╷
91 │ @OverRide Future<List> getMonthSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^
╵
line 91, column 203: Expected to find ','.
╷
91 │ @OverRide Future<List> getMonthSteps(int begin, int end) async { return _queryAdapter.queryList('SELECT sum(step),sum(cal),date FROM Step WHERE date >= ? and date <= ? GROUP BY strftime('%Y-%m-%d',date) ORDER BY date', arguments: [begin, end], mapper: _stepMapper); }
│ ^^^^^^^^^^^^^^^^^^^^^^
╵
[INFO] Running build completed, took 3.4s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 87ms
[SEVERE] Failed after 3.5s
pub finished with exit code 1
The text was updated successfully, but these errors were encountered: