Skip to content

Commit

Permalink
chore(example): Rename files to Dart style (#2618)
Browse files Browse the repository at this point in the history
* 1. rename LandingPage.dart as landing_page.dart

* renamed LoadingPage.dart as loading_page.dart

* renamed MainPage.dart as main_page.dart

* renamed ErrorView.dart as error_view.dart

* renamed ImageLineItem.dart as image_line_item.dart

* renamed ImagePreview.dart as image_preview.dart

* renamed ImageUploader.dart as image_uploader.dart

* renamed SignInView.dart as sign_in_view.dart

* renamed SignUpView.dart as sign_up_view.dart

* renamed UserView.dart as user_view.dart

* updated imports in main.dart

* renamed ModelProvider.dart as model_provider.dart

* updated imports in main.dart

* updated imports wrt to folder names

* Rename ModelProvider file to match `amplify codegen models` output

---------

Co-authored-by: Dillon Nys <[email protected]>
  • Loading branch information
viveky259259 and Dillon Nys authored Feb 3, 2023
1 parent fe19c79 commit 136abe1
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 22 deletions.
18 changes: 9 additions & 9 deletions canaries/main.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:amplify_analytics_pinpoint/amplify_analytics_pinpoint.dart';
import 'package:amplify_api/amplify_api.dart';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_storage_s3/amplify_storage_s3.dart';
import 'package:amplify_datastore/amplify_datastore.dart';
import 'package:amplify_api/amplify_api.dart';
import '/models/ModelProvider.dart';
import 'amplifyconfiguration.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:amplify_storage_s3/amplify_storage_s3.dart';
import 'package:flutter/material.dart';

import 'models/ModelProvider.dart';
import 'amplifyconfiguration.dart';

void main() {
runApp(const MyApp());
Expand Down Expand Up @@ -66,20 +66,20 @@ class _MyHomePageState extends State<MyHomePage> {
}

void _configureAmplify() async {
if(!Amplify.isConfigured) {
if (!Amplify.isConfigured) {
print("Configuring amplify");
AmplifyAuthCognito auth = AmplifyAuthCognito();
AmplifyStorageS3 storage = AmplifyStorageS3();
AmplifyAnalyticsPinpoint analytics = AmplifyAnalyticsPinpoint();
Amplify.addPlugin(AmplifyAPI(modelProvider: ModelProvider.instance));
AmplifyDataStore datastorePlugin =
AmplifyDataStore(modelProvider: ModelProvider.instance);
AmplifyDataStore(modelProvider: ModelProvider.instance);

try {
await Amplify.addPlugins([auth, storage, analytics, datastorePlugin]);
await Amplify.configure(amplifyconfig);
print("Done configuring amplify");
} on AmplifyException catch (e) {
} on AmplifyException catch (e) {
print(e);
print("Expected to fail cause there's no real amplifyconfig file");
}
Expand Down
5 changes: 2 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:amplify_storage_s3/amplify_storage_s3.dart';
import 'package:flutter/material.dart';
import 'package:sample_app/Pages/LoadingPage.dart';

import 'Pages/LandingPage.dart';
import 'package:sample_app/pages/landing_page.dart';
import 'package:sample_app/pages/loading_page.dart';

/*
IMPORTANT - THIS LINE WILL NOT COMPILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import 'package:flutter/material.dart';

import '../Views/SignInView.dart';
import '../Views/SignUpView.dart';
import 'MainPage.dart';
import '../views/sign_in_view.dart';
import '../views/sign_up_view.dart';
import 'main_page.dart';

class LandingPage extends StatefulWidget {
LandingPage({Key? key}) : super(key: key);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:amplify_storage_s3/amplify_storage_s3.dart';
import 'package:flutter/material.dart';
import 'package:sample_app/Views/ImageLineItem.dart';
import 'package:sample_app/Views/ImageUploader.dart';
import 'package:sample_app/Views/UserView.dart';
import 'package:sample_app/views/image_line_item.dart';
import 'package:sample_app/views/image_uploader.dart';
import 'package:sample_app/views/user_view.dart';

class MainPage extends StatefulWidget {
@override
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import 'package:flutter/material.dart';

import 'ImagePreview.dart';
import 'image_preview.dart';

class ImageLineItem extends StatelessWidget {
final String storageKey;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';

import 'ErrorView.dart';
import 'error_view.dart';

class SignInView extends StatefulWidget {
@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';
import 'package:sample_app/Views/ErrorView.dart';
import 'package:sample_app/views/error_view.dart';

class SignUpView extends StatefulWidget {
@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';
import 'package:sample_app/Pages/LandingPage.dart';
import 'package:sample_app/pages/landing_page.dart';

class UserView extends StatefulWidget {
@override
Expand Down

0 comments on commit 136abe1

Please sign in to comment.