https://github.com/bynicodevelop/flutter_profile_manager
https://github.com/bynicodevelop/flutter_profile_manager
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bynicodevelop/flutter_profile_manager
- Owner: bynicodevelop
- License: other
- Created: 2020-12-15T14:07:22.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-31T16:09:01.000Z (over 5 years ago)
- Last Synced: 2024-05-28T23:38:31.506Z (about 2 years ago)
- Language: Dart
- Size: 87.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_profile_manager
Create a profile form with updated data.
## Getting Started
```
import 'package:flutter/material.dart';
import 'package:flutter_profile_manager/flutter_profile_manager.dart';
import 'package:flutter_profile_manager/models/Field.dart';
import 'package:flutter_profile_manager/enums/TypeField.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
Map _map = Map();
@override
void initState() {
super.initState();
_map.addAll(
{
'avatarURL': FieldModel(
id: 'avatarURL',
icon: null,
label: null,
defaultValue: 'John Doe',
value: 'https://picsum.photos/200',
onUpdated: (value) => null,
type: TypeField.AVATAR,
),
'email': FieldModel(
id: 'email',
icon: Icons.email,
label: 'Email',
value: 'john.doe@domain.tld',
onUpdated: (value) => null,
type: TypeField.EMAIL,
fieldPlaceholder: 'Enter your email',
),
'username': FieldModel(
id: 'username',
icon: Icons.person,
label: 'Username',
value: 'john doe',
onUpdated: (value) => null,
fieldPlaceholder: 'Enter your username',
),
'status': FieldModel(
id: 'status',
icon: Icons.info,
label: 'About',
value:
'Le lorem ipsum est, en imprimerie, une suite de mots sans signification utilisée à titre provisoire.',
onUpdated: (value) => null,
fieldPlaceholder: 'Enter your status',
),
},
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: ProfileManager(
onCancled: (FieldModel fieldMode) => null,
onUpdated: (dynamic value, FieldModel fieldModel) {
_map[fieldModel.id].updateValue = value;
setState(() => print('refresh view...'));
},
fields: _map.values.toList(),
),
),
);
}
}
```