Open abhisondagar605 opened 4 years ago
code of createaccountpage class
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:instagramapp/widgets/HeaderWidget.dart';
class CreateAccountPage extends StatefulWidget { @override _CreateAccountPageState createState() => _CreateAccountPageState(); }
class _CreateAccountPageState extends State
submitUserName() { final form = _formKey.currentState; if (form.validate()) { form.save();
SnackBar snackBar = SnackBar(content: Text('welcome ' + userName));
_scaffoldKey.currentState.showSnackBar(snackBar);
Timer(Duration(seconds: 4), () {
Navigator.pop(context, userName);
});
}
}
@override
Widget build(BuildContext parentContext) {
print('account page');
return Scaffold(
key: _scaffoldKey,
appBar:
header(context, strTitle: 'Settings', disappearedBackButton: true),
body: ListView(
children:
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════ The following NoSuchMethodError was thrown building CreateAccountPage(dirty, dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#0560e]], state: _CreateAccountPageState#8ae4d): The method 'validate' was called on null. Receiver: null Tried calling: validate()
The relevant error-causing widget was: CreateAccountPage file:///C:/Users/Abhi%20Sondagar/AndroidStudioProjects/instagram_app/lib/pages/HomePage.dart:44:51 When the exception was thrown, this was the stack:
0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
1 _CreateAccountPageState.submitUserName (package:instagramapp/pages/CreateAccountPage.dart:18:14)
2 _CreateAccountPageState.build (package:instagramapp/pages/CreateAccountPage.dart:88:26)
3 StatefulElement.build (package:flutter/src/widgets/framework.dart:4619:28)
4 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4502:15)
... ════════════════════════════════════════════════════════════════════════════════════════════════════ D/libc-netbsd(27927): [getaddrinfo]: hostname=firestore.googleapis.com; servname=(null); app_uid=10624; ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0 from prox result 0