{
14 |
15 | sendMail() async {
16 | String username = EMAIL;
17 | String password = PASS;//passsword
18 |
19 | final smtpServer = gmail(username, password);
20 | // Creating the Gmail server
21 |
22 | // Create our email message.
23 | final message = Message()
24 | ..from = Address(username)
25 | ..recipients.add('abc@gmail.com') //recipent email
26 | //..ccRecipients.addAll(['destCc1@example.com', 'destCc2@example.com']) //cc Recipents emails
27 | //..bccRecipients.add(Address('bccAddress@example.com')) //bcc Recipents emails
28 | ..subject =
29 | 'Flutter Send Mail from shawondeveloper : ${DateTime.now()}' //subject of the email
30 | //..text =
31 | //'This is the plain text.\nThis is line 2 of the text part.'
32 | ..html =
33 | "Thanks for connecting with us!
\n"; //body of the email
34 |
35 | try {
36 | final sendReport = await send(message, smtpServer);
37 | showToast('Message Send Check your mail',gravity: Toast.CENTER,duration: 3);
38 | print('Message sent: ' +
39 | sendReport.toString()); //print if the email is sent
40 | } on MailerException catch (e) {
41 | print('Message not sent. \n' +
42 | e.toString()); //print if the email is not sent
43 | // e.toString() will show why the email is not sending
44 | }
45 | }
46 |
47 | @override
48 | Widget build(BuildContext context) {
49 | return Scaffold(
50 | appBar: AppBar(
51 | title: Text('Fluter Send Mail '),
52 | ),
53 | body: Center(
54 | child: MaterialButton(
55 | color: Colors.purple,
56 | child: Text('Send Mail',style: TextStyle(color: Colors.white),),
57 | onPressed: () {
58 | sendMail();
59 | },
60 | ),
61 | ),
62 | );
63 | }
64 |
65 | void showToast(String msg, {int duration, int gravity}){
66 | Toast.show(msg, context,duration: duration,gravity: gravity);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/login.php:
--------------------------------------------------------------------------------
1 | query("SELECT * FROM login WHERE username = '".$username."' AND password = '".$password."' AND status = 1");
11 | $count = mysqli_num_rows($select);
12 | if($count == 1){
13 | echo json_encode("OKK");
14 | }else{
15 | echo json_encode("NOTOKK");
16 | }
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | archive:
5 | dependency: transitive
6 | description:
7 | name: archive
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.0.13"
11 | args:
12 | dependency: transitive
13 | description:
14 | name: args
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.6.0"
18 | async:
19 | dependency: transitive
20 | description:
21 | name: async
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.4.1"
25 | boolean_selector:
26 | dependency: transitive
27 | description:
28 | name: boolean_selector
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "2.0.0"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.3"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.14.12"
46 | convert:
47 | dependency: transitive
48 | description:
49 | name: convert
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "2.1.1"
53 | crypto:
54 | dependency: transitive
55 | description:
56 | name: crypto
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.1.4"
60 | cupertino_icons:
61 | dependency: "direct main"
62 | description:
63 | name: cupertino_icons
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "0.1.3"
67 | flutter:
68 | dependency: "direct main"
69 | description: flutter
70 | source: sdk
71 | version: "0.0.0"
72 | flutter_test:
73 | dependency: "direct dev"
74 | description: flutter
75 | source: sdk
76 | version: "0.0.0"
77 | http:
78 | dependency: "direct main"
79 | description:
80 | name: http
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "0.12.2"
84 | http_parser:
85 | dependency: transitive
86 | description:
87 | name: http_parser
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "3.1.4"
91 | image:
92 | dependency: transitive
93 | description:
94 | name: image
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "2.1.12"
98 | intl:
99 | dependency: transitive
100 | description:
101 | name: intl
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "0.16.1"
105 | logging:
106 | dependency: transitive
107 | description:
108 | name: logging
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "0.11.4"
112 | mailer:
113 | dependency: "direct main"
114 | description:
115 | name: mailer
116 | url: "https://pub.dartlang.org"
117 | source: hosted
118 | version: "3.0.4"
119 | matcher:
120 | dependency: transitive
121 | description:
122 | name: matcher
123 | url: "https://pub.dartlang.org"
124 | source: hosted
125 | version: "0.12.6"
126 | meta:
127 | dependency: transitive
128 | description:
129 | name: meta
130 | url: "https://pub.dartlang.org"
131 | source: hosted
132 | version: "1.1.8"
133 | mime:
134 | dependency: transitive
135 | description:
136 | name: mime
137 | url: "https://pub.dartlang.org"
138 | source: hosted
139 | version: "0.9.7"
140 | path:
141 | dependency: transitive
142 | description:
143 | name: path
144 | url: "https://pub.dartlang.org"
145 | source: hosted
146 | version: "1.6.4"
147 | pedantic:
148 | dependency: transitive
149 | description:
150 | name: pedantic
151 | url: "https://pub.dartlang.org"
152 | source: hosted
153 | version: "1.9.0"
154 | petitparser:
155 | dependency: transitive
156 | description:
157 | name: petitparser
158 | url: "https://pub.dartlang.org"
159 | source: hosted
160 | version: "2.4.0"
161 | quiver:
162 | dependency: transitive
163 | description:
164 | name: quiver
165 | url: "https://pub.dartlang.org"
166 | source: hosted
167 | version: "2.1.3"
168 | sky_engine:
169 | dependency: transitive
170 | description: flutter
171 | source: sdk
172 | version: "0.0.99"
173 | source_span:
174 | dependency: transitive
175 | description:
176 | name: source_span
177 | url: "https://pub.dartlang.org"
178 | source: hosted
179 | version: "1.7.0"
180 | stack_trace:
181 | dependency: transitive
182 | description:
183 | name: stack_trace
184 | url: "https://pub.dartlang.org"
185 | source: hosted
186 | version: "1.9.3"
187 | stream_channel:
188 | dependency: transitive
189 | description:
190 | name: stream_channel
191 | url: "https://pub.dartlang.org"
192 | source: hosted
193 | version: "2.0.0"
194 | string_scanner:
195 | dependency: transitive
196 | description:
197 | name: string_scanner
198 | url: "https://pub.dartlang.org"
199 | source: hosted
200 | version: "1.0.5"
201 | term_glyph:
202 | dependency: transitive
203 | description:
204 | name: term_glyph
205 | url: "https://pub.dartlang.org"
206 | source: hosted
207 | version: "1.1.0"
208 | test_api:
209 | dependency: transitive
210 | description:
211 | name: test_api
212 | url: "https://pub.dartlang.org"
213 | source: hosted
214 | version: "0.2.15"
215 | toast:
216 | dependency: "direct main"
217 | description:
218 | name: toast
219 | url: "https://pub.dartlang.org"
220 | source: hosted
221 | version: "0.1.5"
222 | typed_data:
223 | dependency: transitive
224 | description:
225 | name: typed_data
226 | url: "https://pub.dartlang.org"
227 | source: hosted
228 | version: "1.1.6"
229 | vector_math:
230 | dependency: transitive
231 | description:
232 | name: vector_math
233 | url: "https://pub.dartlang.org"
234 | source: hosted
235 | version: "2.0.8"
236 | xml:
237 | dependency: transitive
238 | description:
239 | name: xml
240 | url: "https://pub.dartlang.org"
241 | source: hosted
242 | version: "3.6.1"
243 | sdks:
244 | dart: ">=2.7.0 <3.0.0"
245 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_signup_with_email_verify
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.7.0 <3.0.0"
22 |
23 | dependencies:
24 | flutter:
25 | sdk: flutter
26 |
27 |
28 | # The following adds the Cupertino Icons font to your application.
29 | # Use with the CupertinoIcons class for iOS style icons.
30 | cupertino_icons: ^0.1.3
31 | mailer:
32 | http:
33 | toast:
34 |
35 | dev_dependencies:
36 | flutter_test:
37 | sdk: flutter
38 |
39 | # For information on the generic Dart part of this file, see the
40 | # following page: https://dart.dev/tools/pub/pubspec
41 |
42 | # The following section is specific to Flutter.
43 | flutter:
44 |
45 | # The following line ensures that the Material Icons font is
46 | # included with your application, so that you can use the icons in
47 | # the material Icons class.
48 | uses-material-design: true
49 |
50 | # To add assets to your application, add an assets section, like this:
51 | # assets:
52 | # - images/a_dot_burr.jpeg
53 | # - images/a_dot_ham.jpeg
54 |
55 | # An image asset can refer to one or more resolution-specific "variants", see
56 | # https://flutter.dev/assets-and-images/#resolution-aware.
57 |
58 | # For details regarding adding assets from package dependencies, see
59 | # https://flutter.dev/assets-and-images/#from-packages
60 |
61 | # To add custom fonts to your application, add a fonts section here,
62 | # in this "flutter" section. Each entry in this list should have a
63 | # "family" key with the font family name, and a "fonts" key with a
64 | # list giving the asset and other descriptors for the font. For
65 | # example:
66 | fonts:
67 | - family: Nasalization
68 | fonts:
69 | - asset: fonts/nasalization-rg.ttf
70 | weight: 700
71 | # - asset: fonts/Schyler-Italic.ttf
72 | # style: italic
73 | # - family: Trajan Pro
74 | # fonts:
75 | # - asset: fonts/TrajanPro.ttf
76 | # - asset: fonts/TrajanPro_Bold.ttf
77 | # weight: 700
78 | #
79 | # For details regarding fonts from package dependencies,
80 | # see https://flutter.dev/custom-fonts/#from-packages
81 |
--------------------------------------------------------------------------------
/signup.php:
--------------------------------------------------------------------------------
1 | query("INSERT INTO login(username,password,token)VALUES('".$username."','".$password."','".$token."')");
13 | if($insert){
14 | $lastId = mysqli_insert_id($db);
15 |
16 | $url = 'http://'.$_SERVER['SERVER_NAME'].'/flutter-signup-with-email-verify/verify.php?id='.$lastId.'&token='.$token;
17 |
18 |
19 | //$output = 'Thanks for registering with Flutter localhost. Please click this link to complete this registation
'.$url.'
';
20 |
21 | echo json_encode($url);
22 | }
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutter_signup_with_email_verify/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/verify.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | flutter_signup_with_email_verify
18 |
19 |
20 |
21 |
24 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "flutter_signup_with_email_verify",
3 | "short_name": "flutter_signup_with_email_verify",
4 | "start_url": ".",
5 | "display": "minimal-ui",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------