Skip to content

Instantly share code, notes, and snippets.

View salihgueler's full-sized avatar
🖖
Aloha

Muhammed Salih Guler salihgueler

🖖
Aloha
View GitHub Profile
Future<void> _signUpUser() async {
if (_formKey.currentState!.validate()) {
// Sign up code
}
}
// (1)
Future<void> main() async {
// (2)
WidgetsFlutterBinding.ensureInitialized();
await _configureAmplify();
runApp(const AmplifyCustomAuthenticationFlows());
}
Future<void> _configureAmplify() async {
try {
dependencies:
...
amplify_flutter: ^1.0.0-next.0
amplify_auth_cognito: ^1.0.0-next.0
Using service: Cognito, provided by: awscloudformation
The current configured provider is Amazon Cognito.
Do you want to use the default authentication and security configuration? Default Configuration
Warning: you will not be able to edit these selections.
How do you want users to be able to sign in? Username
Do you want to configure advanced settings? No, I am done.
@salihgueler
salihgueler / amplify_init.sh
Created August 26, 2022 14:55
amplify_init.sh
? Enter a name for the project amplifycustomauthent
The following configuration will be applied:
Project information
| Name: amplifycustomauthent
| Environment: dev
| Default editor: Visual Studio Code
| App type: flutter
| Configuration file location: ./lib/
? Initialize the project with the above configuration? Yes
Using default provider awscloudformation ?
msalihg@ dart_first_amplify_authentication % amplify add auth
Using service: Cognito, provided by: awscloudformation
The current configured provider is Amazon Cognito.
Do you want to use the default authentication and security configuration? Defau
lt configuration
Warning: you will not be able to edit these selections.
How do you want users to be able to sign in? Username
Do you want to configure advanced settings? No, I am done.
#!/bin/bash
[[ -d artifacts ]] && rm -r artifacts
mkdir artifacts
cp -R build/web artifacts
@salihgueler
salihgueler / main.yaml
Last active July 18, 2022 09:57
Deploy Website
name: On Website Deploy
"on":
push:
# (1)
branches:
- "main"
jobs:
build_and_deploy_web:
name: Build & Deploy Flutter to Web
runs-on: ubuntu-latest
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
@salihgueler
salihgueler / btc.dart
Created March 7, 2022 15:03
Autogenerated BTC class
class Autogenerated {
Btcinr? _btcinr;
Btcinr? _xrpinr;
Btcinr? _ethinr;
Btcinr? _trxinr;
Btcinr? _eosinr;
Btcinr? _zilinr;
Btcinr? _batinr;
Btcinr? _zrxinr;
Btcinr? _reqinr;