This commit is contained in:
Brord van Wierst 2023-11-27 20:06:46 +01:00
parent 45a7e8fbb5
commit c98b76e8fc
No known key found for this signature in database
GPG key ID: 20E7ACBD8E02BC11
17 changed files with 122 additions and 132 deletions

View file

@ -55,15 +55,14 @@ class DefaultFirebaseOptions {
);
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyAyWBbl83WXzbVr6txyCmlUsZhpWomQfdg',
apiKey: 'AIzaSyAyWBbl83WXzbVr6txyCmlUsZhpWomQfdg',
appId: '1:545984292675:android:d808acce7a80c20bb931f6',
messagingSenderId: '545984292675',
projectId: 'pangea-chat-936ee',
databaseURL: 'https://pangea-chat-936ee-default-rtdb.firebaseio.com',
storageBucket: 'pangea-chat-936ee.appspot.com',
messagingSenderId: '545984292675',
projectId: 'pangea-chat-936ee',
databaseURL: 'https://pangea-chat-936ee-default-rtdb.firebaseio.com',
storageBucket: 'pangea-chat-936ee.appspot.com',
androidClientId:
'545984292675-2amsnoan1mt6lec1fld1a7eagu6gej7o.apps.googleusercontent.com'
);
'545984292675-2amsnoan1mt6lec1fld1a7eagu6gej7o.apps.googleusercontent.com');
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyCl8QZd9_PnaqJY2zLHCwlsmSWdq7hnH-U',

View file

@ -463,4 +463,3 @@ class ConditionalScroll extends StatelessWidget {
}
}
// #Pangea

View file

@ -1,49 +1,48 @@
// void resetActiveSpaceId() {
// setState(() {
// activeSpaceId = null;
// });
// }
// void resetActiveSpaceId() {
// setState(() {
// activeSpaceId = null;
// });
// }
// void setActiveSpace(String? spaceId) {
// setState(() {
// activeSpaceId = spaceId;
// activeFilter = ActiveFilter.spaces;
// });
// }
// void setActiveSpace(String? spaceId) {
// setState(() {
// activeSpaceId = spaceId;
// activeFilter = ActiveFilter.spaces;
// });
// }
// int get selectedIndex {
// switch (activeFilter) {
// case ActiveFilter.allChats:
// case ActiveFilter.messages:
// return 0;
// case ActiveFilter.groups:
// return 1;
// case ActiveFilter.spaces:
// return AppConfig.separateChatTypes ? 2 : 1;
// }
// }
// int get selectedIndex {
// switch (activeFilter) {
// case ActiveFilter.allChats:
// case ActiveFilter.messages:
// return 0;
// case ActiveFilter.groups:
// return 1;
// case ActiveFilter.spaces:
// return AppConfig.separateChatTypes ? 2 : 1;
// }
// }
// ActiveFilter getActiveFilterByDestination(int? i) {
// switch (i) {
// case 1:
// if (AppConfig.separateChatTypes) {
// return ActiveFilter.groups;
// }
// return ActiveFilter.spaces;
// case 2:
// return ActiveFilter.spaces;
// case 0:
// default:
// if (AppConfig.separateChatTypes) {
// return ActiveFilter.messages;
// }
// return ActiveFilter.allChats;
// }
// }
// ActiveFilter getActiveFilterByDestination(int? i) {
// switch (i) {
// case 1:
// if (AppConfig.separateChatTypes) {
// return ActiveFilter.groups;
// }
// return ActiveFilter.spaces;
// case 2:
// return ActiveFilter.spaces;
// case 0:
// default:
// if (AppConfig.separateChatTypes) {
// return ActiveFilter.messages;
// }
// return ActiveFilter.allChats;
// }
// }
// void onDestinationSelected(int? i) {
// setState(() {
// activeFilter = getActiveFilterByDestination(i);
// });
// }
// void onDestinationSelected(int? i) {
// setState(() {
// activeFilter = getActiveFilterByDestination(i);
// });
// }

View file

@ -1,3 +1 @@
enum EditDirection {
append, remove
}
enum EditDirection { append, remove }

View file

@ -97,4 +97,4 @@
// Map<String, dynamic> toJson() => {};
// }
// // maybe search how to do date ranges in dart
// // maybe search how to do date ranges in dart

View file

@ -22,10 +22,8 @@ class ClassNameButton extends StatelessWidget {
onTap: controller.setDisplaynameAction,
title: Text(
room.isSpace
? L10n.of(context)!
.changeTheNameOfTheClass
: L10n.of(context)!
.changeTheNameOfTheChat,
? L10n.of(context)!.changeTheNameOfTheClass
: L10n.of(context)!.changeTheNameOfTheChat,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,

View file

@ -1,4 +1,3 @@
import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';

View file

@ -77,11 +77,11 @@ class SignupPageView extends StatelessWidget {
hintText: L10n.of(context)!.repeatPassword,
errorStyle: const TextStyle(color: Colors.orange),
// #Pangea
fillColor: Theme.of(context)
.colorScheme
.background
.withOpacity(0.75),
// #Pangea
fillColor: Theme.of(context)
.colorScheme
.background
.withOpacity(0.75),
// #Pangea
),
),
),

View file

@ -75,12 +75,12 @@ class FullTextTranslationResponseModel {
factory FullTextTranslationResponseModel.fromJson(Map<String, dynamic> json) {
return FullTextTranslationResponseModel(
translations: (json["translations"] as Iterable)
.map<String>(
(e) => e,
)
.toList()
.cast<String>(),
translations: (json["translations"] as Iterable)
.map<String>(
(e) => e,
)
.toList()
.cast<String>(),
source: json[ModelKey.srcLang],
deepL: json['deepl_res'],
);

View file

@ -127,13 +127,13 @@ extension PangeaPasswordForgotten on LoginController {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
L10n.of(context)!
.passwordHasBeenChanged,
L10n.of(context)!.passwordHasBeenChanged,
),
),
);
usernameController.text = emailController.text;
passwordController.text = newPasswordController.text;
passwordController.text =
newPasswordController.text;
login();
}
},
@ -149,4 +149,4 @@ extension PangeaPasswordForgotten on LoginController {
),
);
}
}
}

View file

@ -4,47 +4,47 @@ import 'package:matrix/matrix.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
void setClassTopic(Room room, BuildContext context) {
final TextEditingController textFieldController =
TextEditingController(text: room.topic);
showDialog(
context: context,
useRootNavigator: false,
builder: (BuildContext context) => AlertDialog(
title: Text(
room.isSpace
? L10n.of(context)!.classDescription
: L10n.of(context)!.chatTopic,
),
content: TextField(
controller: textFieldController,
),
actions: [
TextButton(
child: Text(L10n.of(context)!.cancel),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: Text(L10n.of(context)!.ok),
onPressed: () async {
if (textFieldController.text == "") return;
final success = await showFutureLoadingDialog(
context: context,
future: () => room.setDescription(textFieldController.text),
);
if (success.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content:
Text(L10n.of(context)!.groupDescriptionHasBeenChanged),
),
);
Navigator.of(context).pop();
}
},
),
],
final TextEditingController textFieldController =
TextEditingController(text: room.topic);
showDialog(
context: context,
useRootNavigator: false,
builder: (BuildContext context) => AlertDialog(
title: Text(
room.isSpace
? L10n.of(context)!.classDescription
: L10n.of(context)!.chatTopic,
),
);
}
content: TextField(
controller: textFieldController,
),
actions: [
TextButton(
child: Text(L10n.of(context)!.cancel),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: Text(L10n.of(context)!.ok),
onPressed: () async {
if (textFieldController.text == "") return;
final success = await showFutureLoadingDialog(
context: context,
future: () => room.setDescription(textFieldController.text),
);
if (success.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content:
Text(L10n.of(context)!.groupDescriptionHasBeenChanged),
),
);
Navigator.of(context).pop();
}
},
),
],
),
);
}

View file

@ -33,4 +33,4 @@ class BotFace extends StatelessWidget {
// String toShortString() {
// return toString().split('.').last;
// }
// }
// }

View file

@ -21,7 +21,8 @@ class StarRating extends StatelessWidget {
if (index >= rating) {
icon = const Icon(
Icons.star_border,
size: 20, color: Color(0xffFFC403),
size: 20,
color: Color(0xffFFC403),
);
} else if (index > rating - 1 && index < rating) {
icon = Icon(

View file

@ -49,11 +49,10 @@ class SpanData {
offset: json['offset'],
length: json['length'],
fullText: json['full_text'],
context: json['context'] != null
? Context.fromJson(json['context'])
: null,
context:
json['context'] != null ? Context.fromJson(json['context']) : null,
type: SpanDataTypeEnum.values.firstWhereOrNull(
(e) => e.toString() == 'SpanDataTypeEnum.${json['type']}') ??
(e) => e.toString() == 'SpanDataTypeEnum.${json['type']}') ??
SpanDataTypeEnum.correction,
rule: json['rule'] != null ? Rule.fromJson(json['rule']) : null,
);
@ -67,8 +66,7 @@ class SpanData {
data['choices'] = choices!.map((x) => x.toJson()).toList();
}
if (replacements != null) {
data['replacements'] =
replacements!.map((x) => x.toJson()).toList();
data['replacements'] = replacements!.map((x) => x.toJson()).toList();
}
data['offset'] = offset;
data['length'] = length;
@ -83,6 +81,7 @@ class SpanData {
return data;
}
}
class Context {
String sentence;
int offset;
@ -181,4 +180,3 @@ class SpanDataType {
return data;
}
}

View file

@ -5,4 +5,4 @@ export 'word_cloud_setting.dart';
export 'word_cloud_shape.dart';
export 'word_cloud_tap_view.dart';
export 'word_cloud_tap.dart';
export 'word_cloud_view.dart';
export 'word_cloud_view.dart';

View file

@ -39,6 +39,4 @@ class WordCloudEllipse extends WordCloudShape {
double getMinorAxis() {
return minoraxis;
}
}

View file

@ -0,0 +1 @@