| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- import '/backend/api_requests/api_calls.dart';
- import '/backend/api_requests/api_streaming.dart';
- import '/components/header_buttons_component_widget.dart';
- import '/flutter_flow/flutter_flow_theme.dart';
- import '/flutter_flow/flutter_flow_util.dart';
- import '/flutter_flow/flutter_flow_widgets.dart';
- import '/shared/drawer_component/drawer_component_widget.dart';
- import 'dart:convert';
- import 'dart:ui';
- import 'package:flutter/material.dart';
- import 'package:flutter_spinkit/flutter_spinkit.dart';
- import 'package:google_fonts/google_fonts.dart';
- import 'package:provider/provider.dart';
- import 'wachtwoord_vergeten_model.dart';
- export 'wachtwoord_vergeten_model.dart';
- class WachtwoordVergetenWidget extends StatefulWidget {
- const WachtwoordVergetenWidget({super.key});
- static String routeName = 'wachtwoordVergeten';
- static String routePath = '/wachtwoordVergeten';
- @override
- State<WachtwoordVergetenWidget> createState() =>
- _WachtwoordVergetenWidgetState();
- }
- class _WachtwoordVergetenWidgetState extends State<WachtwoordVergetenWidget>
- with RouteAware {
- late WachtwoordVergetenModel _model;
- final scaffoldKey = GlobalKey<ScaffoldState>();
- @override
- void initState() {
- super.initState();
- _model = createModel(context, () => WachtwoordVergetenModel());
- _model.naamOfEmailFieldTextController ??= TextEditingController()
- ..addListener(() {
- debugLogWidgetClass(_model);
- });
- _model.naamOfEmailFieldFocusNode ??= FocusNode();
- }
- @override
- void dispose() {
- routeObserver.unsubscribe(this);
- _model.dispose();
- super.dispose();
- }
- @override
- void didUpdateWidget(WachtwoordVergetenWidget oldWidget) {
- super.didUpdateWidget(oldWidget);
- _model.widget = widget;
- }
- @override
- void didChangeDependencies() {
- super.didChangeDependencies();
- final route = DebugModalRoute.of(context);
- if (route != null) {
- routeObserver.subscribe(this, route);
- }
- debugLogGlobalProperty(context);
- }
- @override
- void didPopNext() {
- if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
- setState(() => _model.isRouteVisible = true);
- debugLogWidgetClass(_model);
- }
- }
- @override
- void didPush() {
- if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
- setState(() => _model.isRouteVisible = true);
- debugLogWidgetClass(_model);
- }
- }
- @override
- void didPop() {
- _model.isRouteVisible = false;
- }
- @override
- void didPushNext() {
- _model.isRouteVisible = false;
- }
- @override
- Widget build(BuildContext context) {
- DebugFlutterFlowModelContext.maybeOf(context)
- ?.parentModelCallback
- ?.call(_model);
- return GestureDetector(
- onTap: () {
- FocusScope.of(context).unfocus();
- FocusManager.instance.primaryFocus?.unfocus();
- },
- child: Scaffold(
- key: scaffoldKey,
- backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
- drawer: Drawer(
- elevation: 16.0,
- child: wrapWithModel(
- model: _model.drawerComponentModel,
- updateCallback: () => safeSetState(() {}),
- child: Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- child: DrawerComponentWidget(),
- );
- }),
- ),
- ),
- appBar: PreferredSize(
- preferredSize: Size.fromHeight(80.0),
- child: AppBar(
- backgroundColor: FlutterFlowTheme.of(context).info,
- automaticallyImplyLeading: false,
- actions: [],
- flexibleSpace: FlexibleSpaceBar(
- background: wrapWithModel(
- model: _model.headerButtonsComponentModel,
- updateCallback: () => safeSetState(() {}),
- child: Builder(builder: (_) {
- return DebugFlutterFlowModelContext(
- rootModel: _model.rootModel,
- child: HeaderButtonsComponentWidget(
- showBackButton: true,
- ),
- );
- }),
- ),
- centerTitle: true,
- expandedTitleScale: 1.0,
- ),
- bottom: PreferredSize(
- preferredSize: Size.fromHeight(70.0),
- child: Container(),
- ),
- toolbarHeight: MediaQuery.sizeOf(context).height * 0.25,
- elevation: 2.0,
- ),
- ),
- body: SafeArea(
- top: true,
- child: Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- Text(
- FFLocalizations.of(context).getText(
- 'vrbz9a3l' /* Wachtwoord vergeten */,
- ),
- style: FlutterFlowTheme.of(context).bodyMedium.override(
- font: GoogleFonts.roboto(
- fontWeight:
- FlutterFlowTheme.of(context).bodyMedium.fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).bodyMedium.fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight:
- FlutterFlowTheme.of(context).bodyMedium.fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).bodyMedium.fontStyle,
- ),
- ),
- Text(
- FFLocalizations.of(context).getText(
- '503u6v73' /* Vul je gebruikersnaam of e-mai... */,
- ),
- style: FlutterFlowTheme.of(context).bodyMedium.override(
- font: GoogleFonts.roboto(
- fontWeight:
- FlutterFlowTheme.of(context).bodyMedium.fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).bodyMedium.fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight:
- FlutterFlowTheme.of(context).bodyMedium.fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).bodyMedium.fontStyle,
- ),
- ),
- Container(
- width: 200.0,
- child: TextFormField(
- controller: _model.naamOfEmailFieldTextController,
- focusNode: _model.naamOfEmailFieldFocusNode,
- autofocus: false,
- enabled: true,
- obscureText: false,
- decoration: InputDecoration(
- isDense: true,
- labelStyle:
- FlutterFlowTheme.of(context).labelMedium.override(
- font: GoogleFonts.roboto(
- fontWeight: FlutterFlowTheme.of(context)
- .labelMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .labelMedium
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .labelMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .labelMedium
- .fontStyle,
- ),
- hintText: FFLocalizations.of(context).getText(
- 'ush5uxz1' /* Gebruikersnaam of e-mailadres */,
- ),
- hintStyle:
- FlutterFlowTheme.of(context).labelMedium.override(
- font: GoogleFonts.roboto(
- fontWeight: FlutterFlowTheme.of(context)
- .labelMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .labelMedium
- .fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight: FlutterFlowTheme.of(context)
- .labelMedium
- .fontWeight,
- fontStyle: FlutterFlowTheme.of(context)
- .labelMedium
- .fontStyle,
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: BorderSide(
- color: Color(0x00000000),
- width: 1.0,
- ),
- borderRadius: BorderRadius.circular(8.0),
- ),
- focusedBorder: OutlineInputBorder(
- borderSide: BorderSide(
- color: Color(0x00000000),
- width: 1.0,
- ),
- borderRadius: BorderRadius.circular(8.0),
- ),
- errorBorder: OutlineInputBorder(
- borderSide: BorderSide(
- color: FlutterFlowTheme.of(context).error,
- width: 1.0,
- ),
- borderRadius: BorderRadius.circular(8.0),
- ),
- focusedErrorBorder: OutlineInputBorder(
- borderSide: BorderSide(
- color: FlutterFlowTheme.of(context).error,
- width: 1.0,
- ),
- borderRadius: BorderRadius.circular(8.0),
- ),
- filled: true,
- fillColor: FlutterFlowTheme.of(context).secondaryBackground,
- ),
- style: FlutterFlowTheme.of(context).bodyMedium.override(
- font: GoogleFonts.roboto(
- fontWeight: FlutterFlowTheme.of(context)
- .bodyMedium
- .fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).bodyMedium.fontStyle,
- ),
- letterSpacing: 0.0,
- fontWeight:
- FlutterFlowTheme.of(context).bodyMedium.fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).bodyMedium.fontStyle,
- ),
- cursorColor: FlutterFlowTheme.of(context).primaryText,
- enableInteractiveSelection: true,
- validator: _model.naamOfEmailFieldTextControllerValidator
- .asValidator(context),
- ),
- ),
- FFButtonWidget(
- onPressed: () async {
- _model.apiResultuoz = await RequestNewPasswordCall.call(
- name: _model.naamOfEmailFieldTextController.text,
- );
- if ((_model.apiResultuoz?.succeeded ?? true)) {
- ScaffoldMessenger.of(context).showSnackBar(
- SnackBar(
- content: Text(
- 'Als dit account bestaat, ontvang je een e-mail om je wachtwoord opnieuw in te stellen.',
- style: TextStyle(
- color: FlutterFlowTheme.of(context).primaryText,
- ),
- ),
- duration: Duration(milliseconds: 4000),
- backgroundColor: FlutterFlowTheme.of(context).secondary,
- ),
- );
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- SnackBar(
- content: Text(
- RequestNewPasswordCall.errorMessage(
- (_model.apiResultuoz?.jsonBody ?? ''),
- )!,
- style: TextStyle(
- color: FlutterFlowTheme.of(context).primaryText,
- ),
- ),
- duration: Duration(milliseconds: 4000),
- backgroundColor: FlutterFlowTheme.of(context).secondary,
- ),
- );
- }
- safeSetState(() {});
- },
- text: FFLocalizations.of(context).getText(
- '0gfuq6i7' /* Verstuur */,
- ),
- options: FFButtonOptions(
- height: 40.0,
- padding: EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0),
- iconPadding:
- EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
- color: FlutterFlowTheme.of(context).secondary,
- textStyle: FlutterFlowTheme.of(context).titleSmall.override(
- font: GoogleFonts.roboto(
- fontWeight: FlutterFlowTheme.of(context)
- .titleSmall
- .fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).titleSmall.fontStyle,
- ),
- color: Colors.white,
- letterSpacing: 0.0,
- fontWeight:
- FlutterFlowTheme.of(context).titleSmall.fontWeight,
- fontStyle:
- FlutterFlowTheme.of(context).titleSmall.fontStyle,
- ),
- elevation: 0.0,
- borderRadius: BorderRadius.circular(8.0),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
- }
|