Skip to content

Commit

Permalink
Upgrade flutter version
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Jan 25, 2023
1 parent 4a11377 commit 3b327ce
Show file tree
Hide file tree
Showing 99 changed files with 1,109 additions and 959 deletions.
2 changes: 1 addition & 1 deletion app/FLUTTER_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.10
3.7.0
3 changes: 2 additions & 1 deletion app/l10n.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
output-localization-file: app_localizations.dart
nullable-getter: false
8 changes: 4 additions & 4 deletions app/lib/api/save_data_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ Future<void> saveData(BuildContext context, String data) async {
await showDialog<void>(
context: context,
builder: (context) => AlertDialog(
title: Text(AppLocalizations.of(context)!.areYouSure),
content: Text(AppLocalizations.of(context)!.existOverride),
title: Text(AppLocalizations.of(context).areYouSure),
content: Text(AppLocalizations.of(context).existOverride),
actions: [
TextButton(
child: Text(AppLocalizations.of(context)!.no),
child: Text(AppLocalizations.of(context).no),
onPressed: () => Navigator.of(context).pop()),
ElevatedButton(
child: Text(AppLocalizations.of(context)!.yes),
child: Text(AppLocalizations.of(context).yes),
onPressed: () async {
final navigator = Navigator.of(context);
await write();
Expand Down
32 changes: 16 additions & 16 deletions app/lib/dialogs/area/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class AreaContextMenu extends StatelessWidget {
: const Icon(PhosphorIcons.signOutLight),
title: Text(
area.name == state.currentAreaName
? AppLocalizations.of(context)!.exitArea
: AppLocalizations.of(context)!.enterArea,
? AppLocalizations.of(context).exitArea
: AppLocalizations.of(context).enterArea,
),
onTap: () {
Navigator.of(context).pop();
Expand All @@ -55,7 +55,7 @@ class AreaContextMenu extends StatelessWidget {
),
ListTile(
leading: const Icon(PhosphorIcons.textTLight),
title: Text(AppLocalizations.of(context)!.name),
title: Text(AppLocalizations.of(context).name),
subtitle: Text(area.name),
onTap: () async {
final nameController = TextEditingController(text: area.name);
Expand All @@ -66,16 +66,16 @@ class AreaContextMenu extends StatelessWidget {
builder: (context) => Form(
key: formKey,
child: AlertDialog(
title: Text(AppLocalizations.of(context)!.enterName),
title: Text(AppLocalizations.of(context).enterName),
content: TextFormField(
validator: (value) {
if (value?.isEmpty ?? true) {
return AppLocalizations.of(context)!
return AppLocalizations.of(context)
.shouldNotEmpty;
}
if (state.document.getAreaByName(value!) !=
null) {
return AppLocalizations.of(context)!
return AppLocalizations.of(context)
.alreadyExists;
}
return null;
Expand All @@ -91,11 +91,11 @@ class AreaContextMenu extends StatelessWidget {
),
actions: [
TextButton(
child: Text(AppLocalizations.of(context)!.cancel),
child: Text(AppLocalizations.of(context).cancel),
onPressed: () => Navigator.of(context).pop(false),
),
ElevatedButton(
child: Text(AppLocalizations.of(context)!.ok),
child: Text(AppLocalizations.of(context).ok),
onPressed: () {
Navigator.of(context).pop(true);
},
Expand All @@ -116,20 +116,20 @@ class AreaContextMenu extends StatelessWidget {
),
ListTile(
leading: const Icon(PhosphorIcons.exportLight),
title: Text(AppLocalizations.of(context)!.export),
title: Text(AppLocalizations.of(context).export),
onTap: () {
final bloc = context.read<DocumentBloc>();
Navigator.of(context).pop();
showDialog<void>(
context: context,
builder: (context) => AlertDialog(
scrollable: true,
title: Text(AppLocalizations.of(context)!.export),
title: Text(AppLocalizations.of(context).export),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text(AppLocalizations.of(context)!.image),
title: Text(AppLocalizations.of(context).image),
onTap: () {
Navigator.of(context).pop();
showDialog<void>(
Expand All @@ -147,7 +147,7 @@ class AreaContextMenu extends StatelessWidget {
},
),
ListTile(
title: Text(AppLocalizations.of(context)!.svg),
title: Text(AppLocalizations.of(context).svg),
onTap: () {
Navigator.of(context).pop();
showDialog<void>(
Expand All @@ -163,7 +163,7 @@ class AreaContextMenu extends StatelessWidget {
},
),
ListTile(
title: Text(AppLocalizations.of(context)!.pdf),
title: Text(AppLocalizations.of(context).pdf),
onTap: () {
Navigator.of(context).pop();
showDialog<void>(
Expand All @@ -177,7 +177,7 @@ class AreaContextMenu extends StatelessWidget {
),
actions: [
TextButton(
child: Text(AppLocalizations.of(context)!.cancel),
child: Text(AppLocalizations.of(context).cancel),
onPressed: () => Navigator.pop(context),
),
],
Expand All @@ -187,7 +187,7 @@ class AreaContextMenu extends StatelessWidget {
),
ListTile(
leading: const Icon(PhosphorIcons.trashLight),
title: Text(AppLocalizations.of(context)!.delete),
title: Text(AppLocalizations.of(context).delete),
onTap: () {
final bloc = context.read<DocumentBloc>();
final state = bloc.state;
Expand All @@ -198,7 +198,7 @@ class AreaContextMenu extends StatelessWidget {
),
ListTile(
leading: const Icon(PhosphorIcons.plusCircleLight),
title: Text(AppLocalizations.of(context)!.addToPack),
title: Text(AppLocalizations.of(context).addToPack),
onTap: () {
final settingsCubit = context.read<SettingsCubit>();
final bloc = context.read<DocumentBloc>();
Expand Down
22 changes: 10 additions & 12 deletions app/lib/dialogs/area/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AreasDialog extends StatelessWidget {
child: Column(
children: [
Header(
title: Text(AppLocalizations.of(context)!.areas),
title: Text(AppLocalizations.of(context).areas),
leading: IconButton(
icon: const Icon(PhosphorIcons.xLight),
onPressed: () => Navigator.of(context).pop(),
Expand Down Expand Up @@ -74,9 +74,8 @@ class AreasDialog extends StatelessWidget {
const CurrentAreaChanged.exit());
Navigator.of(context).pop();
},
title: Text(
AppLocalizations.of(context)!
.exitArea)),
title: Text(AppLocalizations.of(context)
.exitArea)),
const Divider(),
],
...List.generate(areas.length, (index) {
Expand Down Expand Up @@ -131,7 +130,7 @@ class _AreaPopupMenu extends StatelessWidget {
padding: EdgeInsets.zero,
child: ListTile(
leading: const Icon(PhosphorIcons.textTLight),
title: Text(AppLocalizations.of(context)!.rename),
title: Text(AppLocalizations.of(context).rename),
onTap: () async {
final TextEditingController nameController =
TextEditingController(text: area.name);
Expand All @@ -144,11 +143,11 @@ class _AreaPopupMenu extends StatelessWidget {
key: formKey,
child: AlertDialog(
title: Text(
AppLocalizations.of(context)!.rename),
AppLocalizations.of(context).rename),
content: TextFormField(
validator: (value) {
if (value?.isEmpty ?? true) {
return AppLocalizations.of(context)!
return AppLocalizations.of(context)
.shouldNotEmpty;
}
final state =
Expand All @@ -159,7 +158,7 @@ class _AreaPopupMenu extends StatelessWidget {
if (state.document
.getAreaByName(value!) !=
null) {
return AppLocalizations.of(context)!
return AppLocalizations.of(context)
.alreadyExists;
}
return null;
Expand All @@ -176,15 +175,14 @@ class _AreaPopupMenu extends StatelessWidget {
),
actions: [
TextButton(
child: Text(
AppLocalizations.of(context)!
.cancel),
child: Text(AppLocalizations.of(context)
.cancel),
onPressed: () =>
Navigator.of(context).pop(false),
),
ElevatedButton(
child: Text(
AppLocalizations.of(context)!.ok),
AppLocalizations.of(context).ok),
onPressed: () {
if (!(formKey.currentState
?.validate() ??
Expand Down
14 changes: 7 additions & 7 deletions app/lib/dialogs/area/label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ class AreaLabelDialog extends StatelessWidget {
return Form(
key: _formKey,
child: AlertDialog(
title: Text(AppLocalizations.of(context)!.enterName),
title: Text(AppLocalizations.of(context).enterName),
content: TextFormField(
autofocus: true,
decoration: InputDecoration(
hintText: AppLocalizations.of(context)!.name,
hintText: AppLocalizations.of(context).name,
filled: true,
),
controller: _controller,
validator: (value) {
if (value?.isEmpty ?? true) {
return AppLocalizations.of(context)!.shouldNotEmpty;
return AppLocalizations.of(context).shouldNotEmpty;
}
final state = context.read<DocumentBloc>().state;
if (state is! DocumentLoadSuccess) {
return AppLocalizations.of(context)!.error;
return AppLocalizations.of(context).error;
}
if (state.document.getAreaByName(value!) != null) {
return AppLocalizations.of(context)!.alreadyExists;
return AppLocalizations.of(context).alreadyExists;
}
return null;
},
),
actions: [
TextButton(
child: Text(AppLocalizations.of(context)!.cancel),
child: Text(AppLocalizations.of(context).cancel),
onPressed: () => Navigator.pop(context, null),
),
ElevatedButton(
child: Text(AppLocalizations.of(context)!.ok),
child: Text(AppLocalizations.of(context).ok),
onPressed: () {
if (_formKey.currentState?.validate() ?? false) {
Navigator.pop(context, _controller.text);
Expand Down
12 changes: 6 additions & 6 deletions app/lib/dialogs/background/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BackgroundContextMenu extends StatelessWidget {
if (state.embedding?.editable ?? true)
ListTile(
leading: const Icon(PhosphorIcons.plusLight),
title: Text(AppLocalizations.of(context)!.insert),
title: Text(AppLocalizations.of(context).insert),
subtitle: Text(context.getShortcut('N', altKey: true)),
onTap: () {
var transformCubit = context.read<TransformCubit>();
Expand All @@ -46,7 +46,7 @@ class BackgroundContextMenu extends StatelessWidget {
),
ListTile(
leading: const Icon(PhosphorIcons.squaresFourLight),
title: Text(AppLocalizations.of(context)!.layers),
title: Text(AppLocalizations.of(context).layers),
subtitle: Text(context.getShortcut('L')),
onTap: () {
Navigator.of(context).pop();
Expand All @@ -55,7 +55,7 @@ class BackgroundContextMenu extends StatelessWidget {
}),
ListTile(
leading: const Icon(PhosphorIcons.monitorLight),
title: Text(AppLocalizations.of(context)!.areas),
title: Text(AppLocalizations.of(context).areas),
subtitle: Text(context.getShortcut('A', shiftKey: true)),
onTap: () {
Navigator.of(context).pop();
Expand All @@ -64,7 +64,7 @@ class BackgroundContextMenu extends StatelessWidget {
),
ListTile(
leading: const Icon(PhosphorIcons.imageLight),
title: Text(AppLocalizations.of(context)!.background),
title: Text(AppLocalizations.of(context).background),
subtitle: Text(context.getShortcut('B')),
onTap: () {
Navigator.of(context).pop();
Expand All @@ -73,7 +73,7 @@ class BackgroundContextMenu extends StatelessWidget {
}),
ListTile(
leading: const Icon(PhosphorIcons.mapPinLight),
title: Text(AppLocalizations.of(context)!.waypoints),
title: Text(AppLocalizations.of(context).waypoints),
subtitle: Text(context.getShortcut('P', shiftKey: true)),
onTap: () {
Navigator.of(context).pop();
Expand All @@ -83,7 +83,7 @@ class BackgroundContextMenu extends StatelessWidget {
if (state.embedding?.editable ?? true)
ListTile(
leading: const Icon(PhosphorIcons.paletteLight),
title: Text(AppLocalizations.of(context)!.color),
title: Text(AppLocalizations.of(context).color),
subtitle: Text(context.getShortcut('P')),
onTap: () {
Navigator.of(context).pop();
Expand Down
Loading

0 comments on commit 3b327ce

Please sign in to comment.