diff --git a/packages/uni_app/app_version.txt b/packages/uni_app/app_version.txt index d1a078ac2..339705b9a 100644 --- a/packages/uni_app/app_version.txt +++ b/packages/uni_app/app_version.txt @@ -1 +1 @@ -1.9.0-beta.23+286 +1.9.0-beta.24+287 diff --git a/packages/uni_app/pubspec.yaml b/packages/uni_app/pubspec.yaml index 289b22276..df57cc422 100644 --- a/packages/uni_app/pubspec.yaml +++ b/packages/uni_app/pubspec.yaml @@ -7,7 +7,7 @@ publish_to: "none" # We do not publish to pub.dev # To change it manually, override the value in app_version.txt. # The app version code is automatically also bumped by CI. # Do not change it manually. -version: 1.9.0-beta.23+286 +version: 1.9.0-beta.24+287 environment: sdk: ">=3.4.0 <4.0.0" diff --git a/packages/uni_ui/lib/modal/modal.dart b/packages/uni_ui/lib/modal/modal.dart new file mode 100644 index 000000000..907bd7f6c --- /dev/null +++ b/packages/uni_ui/lib/modal/modal.dart @@ -0,0 +1,28 @@ +import 'package:figma_squircle/figma_squircle.dart'; +import 'package:flutter/material.dart'; + +class ModalDialog extends StatelessWidget { + const ModalDialog({ + required this.children, + }); + + final List children; + + @override + Widget build(BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: ClipSmoothRect( + radius: SmoothBorderRadius(cornerRadius: 30, cornerSmoothing: 1), + child: Container( + padding: const EdgeInsets.all(20.0), + color: Theme.of(context).colorScheme.surface, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: children, + ), + )), + ); + } +} diff --git a/packages/uni_ui/lib/modal/widgets/enrollment_info.dart b/packages/uni_ui/lib/modal/widgets/enrollment_info.dart new file mode 100644 index 000000000..294057bb3 --- /dev/null +++ b/packages/uni_ui/lib/modal/widgets/enrollment_info.dart @@ -0,0 +1,57 @@ +import 'package:flutter/material.dart'; +import 'package:uni_ui/theme.dart'; + +class ModalEnrollementInfo extends StatelessWidget { + const ModalEnrollementInfo({required this.enrollements}); + + final Map enrollements; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.only(top: 10.0), + width: double.infinity, + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Theme.of(context).dividerColor, width: 1))), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Enrollments", style: Theme.of(context).textTheme.bodyMedium), + Wrap( + spacing: 1, + direction: Axis.horizontal, + children: enrollements.entries.map((entry) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text(entry.key, + style: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith( + color: Theme.of(context).primaryColor)), + Container( + padding: const EdgeInsets.all(4.0), + margin: const EdgeInsets.all(3.0), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(20)), + color: Theme.of(context).primaryColor), + child: Text( + entry.value, + style: Theme.of(context) + .textTheme + .labelSmall + ?.copyWith( + color: pureWhite, + ), + )) + ], + ); + }).toList()) + ], + )); + } +} diff --git a/packages/uni_ui/lib/modal/widgets/info_row.dart b/packages/uni_ui/lib/modal/widgets/info_row.dart new file mode 100644 index 000000000..e6ac6c17b --- /dev/null +++ b/packages/uni_ui/lib/modal/widgets/info_row.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; + +class ModalInfoRow extends StatelessWidget { + const ModalInfoRow( + {super.key, + required this.title, + required this.description, + required this.icon, + this.onPressed}); + + final String title; + final String description; + final IconData icon; + final void Function()? onPressed; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(3.0), + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Theme.of(context).dividerColor, width: 1))), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: Theme.of(context).textTheme.bodyMedium, + ), + Text(description, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: Theme.of(context).secondaryHeaderColor)), + ], + ), + ), + IconButton(onPressed: onPressed, icon: PhosphorIcon(icon)) + ], + )); + } +} diff --git a/packages/uni_ui/lib/modal/widgets/person_info.dart b/packages/uni_ui/lib/modal/widgets/person_info.dart new file mode 100644 index 000000000..e264d09c5 --- /dev/null +++ b/packages/uni_ui/lib/modal/widgets/person_info.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +class ModalPersonInfo extends StatelessWidget { + const ModalPersonInfo({this.image, required this.name}); + + final Image? image; + final String name; + + @override + Widget build(BuildContext context) { + return Padding( + padding: EdgeInsets.only(bottom: 20.0), + child: Column( + children: [ + CircleAvatar( + radius: 60.0, + backgroundImage: image?.image, + backgroundColor: Colors.green, + ), + Text( + name, + style: Theme.of(context).textTheme.displaySmall, + ) + ], + ), + ); + } +} diff --git a/packages/uni_ui/lib/modal/widgets/service_info.dart b/packages/uni_ui/lib/modal/widgets/service_info.dart new file mode 100644 index 000000000..32c011d9b --- /dev/null +++ b/packages/uni_ui/lib/modal/widgets/service_info.dart @@ -0,0 +1,42 @@ +import 'package:flutter/material.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:uni_ui/theme.dart'; + +class ModalServiceInfo extends StatelessWidget { + const ModalServiceInfo({required this.name, required this.durations}); + + final String name; + final List durations; + + @override + Widget build(BuildContext context) { + return Padding( + padding: EdgeInsets.only(bottom: 20.0), + child: Column( + children: [ + Text( + name, + style: TextStyle( + fontSize: 25.0, color: Theme.of(context).primaryColor), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + PhosphorIcon( + PhosphorIcons.clock(PhosphorIconsStyle.duotone), + color: darkGray, + duotoneSecondaryColor: normalGray, + ), + Column( + children: durations.map((duration) { + return Text(duration, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: Theme.of(context).secondaryHeaderColor)); + }).toList(), + ) + ], + ), + ], + )); + } +} diff --git a/packages/uni_ui/lib/theme.dart b/packages/uni_ui/lib/theme.dart index fcf9df238..431d4d1e8 100644 --- a/packages/uni_ui/lib/theme.dart +++ b/packages/uni_ui/lib/theme.dart @@ -61,6 +61,7 @@ ThemeData lightTheme = ThemeData( dividerColor: lightGray, hintColor: lightGray, indicatorColor: darkRed, + secondaryHeaderColor: normalGray, iconTheme: const IconThemeData(color: darkRed), );