master
Rafael 2024-06-17 17:57:32 +02:00
parent 0eeba51d46
commit 661bdc2454
10 changed files with 174 additions and 175 deletions

View File

@ -1,3 +1,4 @@
import 'package:cofounderella/components/text_bold.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../constants.dart'; import '../constants.dart';
@ -25,13 +26,7 @@ class MyAboutDialog extends StatelessWidget {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( TextBold(text: Constants.appTitle, fontSize: 24),
Constants.appTitle,
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
Text( Text(
'Version ${Constants.appVersion} (${Constants.appCompilationDate})'), 'Version ${Constants.appVersion} (${Constants.appCompilationDate})'),
], ],

View File

@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
/// Text in bold.
///
/// Unless specified otherwise, the default settings will be
/// fontSize: [18] and fontWeight: [FontWeight.bold].
class TextBold extends StatelessWidget {
final String text;
final double? fontSize;
final FontWeight? fontWeight;
final TextAlign? textAlign;
const TextBold({
super.key,
required this.text,
this.fontSize = 18,
this.fontWeight = FontWeight.bold,
this.textAlign,
});
@override
Widget build(BuildContext context) {
return Text(
text,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: fontSize,
),
textAlign: textAlign,
);
}
}

View File

@ -1,6 +1,7 @@
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../components/text_bold.dart';
import '../constants.dart'; import '../constants.dart';
import '../enumerations.dart'; import '../enumerations.dart';
import '../forms/risks_form.dart'; import '../forms/risks_form.dart';
@ -156,10 +157,7 @@ class CultureValuesFormPageState extends State<CultureValuesFormPage> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
const Text( const TextBold(text: 'Work life and corporate culture'),
'Work life and corporate culture',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const Align( const Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text('Which corporate culture suits you best?'), child: Text('Which corporate culture suits you best?'),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../components/text_bold.dart';
import '../utils/helper.dart'; import '../utils/helper.dart';
class ProfileCategoryForm<T> extends StatefulWidget { class ProfileCategoryForm<T> extends StatefulWidget {
@ -52,13 +53,7 @@ class ProfileCategoryFormState<T> extends State<ProfileCategoryForm<T>> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Text( TextBold(text: widget.header),
widget.header,
style: const TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 16), const SizedBox(height: 16),
Text(widget.description), Text(widget.description),
const SizedBox(height: 16), const SizedBox(height: 16),

View File

@ -300,7 +300,7 @@ class LikedUsersPageState extends State<LikedUsersPage> {
: _fetchError != null : _fetchError != null
? Center(child: Text('Error: $_fetchError')) ? Center(child: Text('Error: $_fetchError'))
: _likedUsersWithSwipes.isEmpty : _likedUsersWithSwipes.isEmpty
? const Center(child: Text('No liked users found.')) ? const Center(child: Text('No favored profiles yet.'))
: buildLikedUserList(), : buildLikedUserList(),
], ],
), ),
@ -323,7 +323,7 @@ class LikedUsersPageState extends State<LikedUsersPage> {
return UserTileLikes( return UserTileLikes(
user: user, user: user,
hasMatch: hasMatch, hasMatch: hasMatch,
currentUser: _currentUser!, currentUser: _currentUser,
onUnlike: () async { onUnlike: () async {
Map<String, dynamic> userMap = Map<String, dynamic> userMap =
user.data() as Map<String, dynamic>; user.data() as Map<String, dynamic>;

View File

@ -21,7 +21,6 @@ class RegisterPage extends StatelessWidget {
// register method // register method
Future<void> register(BuildContext context) async { Future<void> register(BuildContext context) async {
// get auth service
final auth = AuthService(); final auth = AuthService();
// check if passwords match // check if passwords match
@ -56,108 +55,114 @@ class RegisterPage extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface, backgroundColor: Theme.of(context).colorScheme.surface,
body: Center( body: Center(
child: ListView(children: [ child: ListView(
Column(mainAxisAlignment: MainAxisAlignment.center, children: [ children: [
//logo Column(
Icon(
Icons.people_alt,
size: 60,
color: Theme.of(context).colorScheme.primary,
),
const SizedBox(height: 50),
// register message
Text(
"Let's create an account for you",
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
fontSize: 16,
),
),
const SizedBox(height: 25),
// name text field
MyTextField(
hintText: "First Name",
obscureText: false,
controller: _nameController,
),
MyTextField(
hintText: "Last Name",
obscureText: false,
controller: _lastnameController,
),
// email text field
MyTextField(
hintText: "E-Mail",
obscureText: false,
controller: _emailController,
),
const SizedBox(height: 10),
// password text field
MyTextField(
hintText: "Password",
obscureText: true,
controller: _passwordController,
),
MyTextField(
hintText: "Confirm Password",
obscureText: true,
controller: _confirmPassController,
),
const SizedBox(height: 25),
//login button
MyButton(
text: "Register",
onTap: () => {
if ((_nameController.text.trim().isEmpty &&
_lastnameController.text.trim().isEmpty) ||
_emailController.text.trim().isEmpty ||
_passwordController.text.trim().isEmpty)
{
showMsg(
context,
'Missing information',
'Please enter your name, email and password',
)
}
else
{register(context)}
},
),
const SizedBox(height: 25),
// register now
Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( // logo
'Already have an account? ', Icon(
style: Icons.people_alt,
TextStyle(color: Theme.of(context).colorScheme.primary), size: 60,
color: Theme.of(context).colorScheme.primary,
), ),
GestureDetector(
onTap: onTap, const SizedBox(height: 50),
child: const Text(
'Login now', // register message
style: TextStyle( Text(
fontWeight: FontWeight.bold, "Let's create an account for you",
), style: TextStyle(
color: Theme.of(context).colorScheme.primary,
fontSize: 16,
), ),
), ),
const SizedBox(height: 25),
// name text field
MyTextField(
hintText: "First Name",
obscureText: false,
controller: _nameController,
),
MyTextField(
hintText: "Last Name",
obscureText: false,
controller: _lastnameController,
),
// email text field
MyTextField(
hintText: "E-Mail",
obscureText: false,
controller: _emailController,
),
const SizedBox(height: 10),
// password text field
MyTextField(
hintText: "Password",
obscureText: true,
controller: _passwordController,
),
MyTextField(
hintText: "Confirm Password",
obscureText: true,
controller: _confirmPassController,
),
const SizedBox(height: 25),
//login button
MyButton(
text: "Register",
onTap: () => {
if ((_nameController.text.trim().isEmpty &&
_lastnameController.text.trim().isEmpty) ||
_emailController.text.trim().isEmpty ||
_passwordController.text.trim().isEmpty)
{
showMsg(
context,
'Missing information',
'Please enter your name, email and password',
)
}
else
{register(context)}
},
),
const SizedBox(height: 25),
// register now
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Already have an account? ',
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
),
GestureDetector(
onTap: onTap,
child: const Text(
'Login now',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
],
)
], ],
) ),
]), ],
]), ),
), ),
); );
} }

View File

@ -1,3 +1,4 @@
import 'package:cofounderella/components/text_bold.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../services/auth/auth_gate.dart'; import '../services/auth/auth_gate.dart';
@ -24,9 +25,9 @@ class RegistrationCompletePage extends StatelessWidget {
size: 100, size: 100,
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
const Text( const TextBold(
'Registration completed!', text: 'Registration completed!',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), fontSize: 24,
), ),
const SizedBox(height: 40), const SizedBox(height: 40),
const Text( const Text(

View File

@ -6,6 +6,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import '../components/location_dialog.dart'; import '../components/location_dialog.dart';
import '../components/my_button.dart'; import '../components/my_button.dart';
import '../components/text_bold.dart';
import '../components/text_with_bold.dart'; import '../components/text_with_bold.dart';
import '../constants.dart'; import '../constants.dart';
import '../enumerations.dart'; import '../enumerations.dart';
@ -395,18 +396,15 @@ class _UserDataPageState extends State<UserDataPage> {
children: [ children: [
if (widget.isRegProcess) ...[ if (widget.isRegProcess) ...[
const SizedBox(height: 10), const SizedBox(height: 10),
const Text( const TextBold(
'Please fill in the following fields to proceed with the registration process.', text:
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), 'Please fill in the following fields to proceed with the registration process.',
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
const Divider(), const Divider(),
], ],
const SizedBox(height: 10), const SizedBox(height: 10),
const Text( const TextBold(text: 'Location'),
'Location',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 20), const SizedBox(height: 20),
// Display selected main location // Display selected main location
const Text( const Text(
@ -483,10 +481,7 @@ class _UserDataPageState extends State<UserDataPage> {
], ],
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
const Text( const TextBold(text: 'Age'),
'Age',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
Row( Row(
children: [ children: [
const Padding(padding: EdgeInsets.symmetric(horizontal: 8)), const Padding(padding: EdgeInsets.symmetric(horizontal: 8)),
@ -512,13 +507,7 @@ class _UserDataPageState extends State<UserDataPage> {
], ],
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
const Text( const TextBold(text: 'Gender'),
'Gender',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: SegmentedButton<Gender>( child: SegmentedButton<Gender>(
@ -550,10 +539,8 @@ class _UserDataPageState extends State<UserDataPage> {
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
const Divider(), const Divider(),
Text( TextBold(
'Language: (${_selectedLanguages.length} selected)', text: 'Language: (${_selectedLanguages.length} selected)',
style:
const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
), ),
...languagesList.map(buildSingleCheckbox), ...languagesList.map(buildSingleCheckbox),
const Divider(), const Divider(),

View File

@ -6,6 +6,7 @@ import 'package:swipable_stack/swipable_stack.dart';
import '../components/card_overlay.dart'; import '../components/card_overlay.dart';
import '../components/language_list.dart'; import '../components/language_list.dart';
import '../components/text_bold.dart';
import '../components/text_with_bold.dart'; import '../components/text_with_bold.dart';
import '../constants.dart'; import '../constants.dart';
import '../forms/matched_screen.dart'; import '../forms/matched_screen.dart';
@ -258,25 +259,17 @@ class UserMatchingPageState extends State<UserMatchingPage> {
if (userProfiles.isEmpty) ...[ if (userProfiles.isEmpty) ...[
const CircularProgressIndicator(), const CircularProgressIndicator(),
const SizedBox(height: 20), const SizedBox(height: 20),
const Text( const TextBold(text: 'Loading data, please wait...'),
'Loading data, please wait...',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
),
] else ...[ ] else ...[
Text( TextBold(
userProfiles.length > 1 text: userProfiles.length > 1
? 'No new profiles available yet.' ? 'No new profiles available yet.'
: 'No profiles available at the moment.', : 'No profiles available at the moment.',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
), ),
const SizedBox(height: 60), const SizedBox(height: 60),
const Text( const TextBold(
'Please check back later, perhaps tomorrow.', text: 'Please check back later, perhaps tomorrow.',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
), ),
], ],
], ],
@ -393,12 +386,9 @@ class UserMatchingPageState extends State<UserMatchingPage> {
lineWidth: 5.0, lineWidth: 5.0,
animation: true, animation: true,
percent: matchScore / 100, percent: matchScore / 100,
header: Text( header: TextBold(
"${matchScore.toStringAsFixed(2)}%", text: "${matchScore.toStringAsFixed(2)}%",
style: const TextStyle( fontSize: 16.0,
fontWeight: FontWeight.bold,
fontSize: 16.0,
),
), ),
circularStrokeCap: CircularStrokeCap.round, circularStrokeCap: CircularStrokeCap.round,
progressColor: _getProgressColor(matchScore), progressColor: _getProgressColor(matchScore),
@ -483,16 +473,17 @@ class UserMatchingPageState extends State<UserMatchingPage> {
children: [ children: [
const Icon(Icons.person_search, size: 64), const Icon(Icons.person_search, size: 64),
const SizedBox(height: 20), const SizedBox(height: 20),
const Text( const TextBold(
'You\'ve viewed all available profiles.', text: 'You\'ve viewed all available profiles.',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), fontSize: 24,
), ),
const SizedBox(height: 60), const SizedBox(height: 60),
const Text( const TextBold(
'Would you like to do another run and see the remaining profiles again?', text: 'Would you like to do another run '
'and see the remaining profiles again?',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), fontSize: 24,
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
ElevatedButton( ElevatedButton(

View File

@ -1,6 +1,7 @@
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../components/text_bold.dart';
import '../constants.dart'; import '../constants.dart';
import '../enumerations.dart'; import '../enumerations.dart';
import '../forms/corporate_culture_form.dart'; import '../forms/corporate_culture_form.dart';
@ -155,10 +156,7 @@ class UserVisionPageState extends State<UserVisionPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text( const TextBold(text: 'Availability and commitment'),
'Availability and commitment',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const Text( const Text(
'How much time can you devote to the startup each week?', 'How much time can you devote to the startup each week?',
), ),
@ -175,10 +173,7 @@ class UserVisionPageState extends State<UserVisionPage> {
); );
}), }),
const SizedBox(height: 40), const SizedBox(height: 40),
const Text( const TextBold(text: 'Vision and goals'),
'Vision and goals',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const Text('What is your long-term vision for a startup?'), const Text('What is your long-term vision for a startup?'),
...VisionOption.values.map((option) { ...VisionOption.values.map((option) {
return CheckboxListTile( return CheckboxListTile(