Skip to content

Commit f855317

Browse files
committed
dart format
1 parent c90c66c commit f855317

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

demos/django-todolist/lib/api_client.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class ApiClient {
99

1010
ApiClient(this.baseUrl);
1111

12-
Future<Map<String, dynamic>> authenticate(String username, String password) async {
12+
Future<Map<String, dynamic>> authenticate(
13+
String username, String password) async {
1314
final response = await http.post(
1415
Uri.parse('$baseUrl/api/auth/'),
1516
headers: {'Content-Type': 'application/json'},
@@ -57,4 +58,4 @@ class ApiClient {
5758
body: json.encode(record),
5859
);
5960
}
60-
}
61+
}

demos/django-todolist/lib/app_config_template.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
// Edit lib/app_config.dart and enter your Django and PowerSync project details.
33
class AppConfig {
44
static const String djangoUrl = 'https://foo.ngrok.app';
5-
static const String powersyncUrl = 'https://myprojectid.powersync.journeyapps.com';
6-
}
5+
static const String powersyncUrl =
6+
'https://myprojectid.powersync.journeyapps.com';
7+
}

demos/django-todolist/lib/main.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import './widgets/login_page.dart';
99
import './widgets/query_widget.dart';
1010
import './widgets/status_app_bar.dart';
1111

12-
1312
void main() async {
1413
Logger.root.level = Level.INFO;
1514
Logger.root.onRecord.listen((record) {
@@ -28,7 +27,7 @@ void main() async {
2827

2928
WidgetsFlutterBinding
3029
.ensureInitialized(); //required to get sqlite filepath from path_provider before UI has initialized
31-
30+
3231
await openDatabase();
3332

3433
final loggedIn = await isLoggedIn();

demos/django-todolist/lib/models/schema.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ Schema schema = const Schema(([
1515
// Index to allow efficient lookup within a list
1616
Index('list', [IndexedColumn('list_id')])
1717
]),
18-
Table('lists', [
19-
Column.text('created_at'),
20-
Column.text('name'),
21-
Column.text('owner_id')
22-
])
18+
Table('lists',
19+
[Column.text('created_at'), Column.text('name'), Column.text('owner_id')])
2320
]));

demos/django-todolist/lib/powersync.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class DjangoConnector extends PowerSyncBackendConnector {
8787
/// Global reference to the database
8888
late final PowerSyncDatabase db;
8989

90-
// Hacky flag to ensure the database is only initialized once, better to do this with listeners
90+
// Hacky flag to ensure the database is only initialized once, better to do this with listeners
9191
bool _dbInitialized = false;
9292

9393
Future<bool> isLoggedIn() async {

demos/django-todolist/lib/widgets/login_page.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ class _LoginPageState extends State<LoginPage> {
4747

4848
//re-init PowerSync manually for first time sign in
4949
await openDatabase();
50-
}
51-
else {
52-
setState(() {
53-
_error = 'Invalid token payload';
54-
});
50+
} else {
51+
setState(() {
52+
_error = 'Invalid token payload';
53+
});
5554
}
5655

5756
if (context.mounted) {

0 commit comments

Comments
 (0)