@@ -3,6 +3,7 @@ import 'package:flow_api/models/model.dart';
33import 'package:flutter/material.dart' ;
44import 'package:flutter_bloc/flutter_bloc.dart' ;
55import 'package:flow/src/generated/i18n/app_localizations.dart' ;
6+ import 'package:material_leap/material_leap.dart' ;
67import 'package:phosphor_flutter/phosphor_flutter.dart' ;
78import 'package:flow_api/models/user/model.dart' ;
89import 'package:flow_api/models/user/service.dart' ;
@@ -23,50 +24,47 @@ class UserDialog extends StatelessWidget {
2324 var currentSource = source ?? '' ;
2425 var currentService =
2526 context.read <FlowCubit >().getService (currentSource).user;
26- return AlertDialog (
27+ return ResponsiveAlertDialog (
2728 title: Text (source == null
2829 ? AppLocalizations .of (context).createUser
2930 : AppLocalizations .of (context).editUser),
30- content: SizedBox (
31- width: 500 ,
32- child: Column (children: [
33- if (source == null ) ...[
34- SourceDropdown <UserService >(
35- value: currentSource,
36- buildService: (e) => e.user,
37- onChanged: (connected) {
38- currentSource = connected? .source ?? '' ;
39- currentService = connected? .model;
40- },
41- ),
42- ],
43- const SizedBox (height: 16 ),
44- TextFormField (
45- decoration: InputDecoration (
46- labelText: AppLocalizations .of (context).name,
47- filled: true ,
48- icon: const PhosphorIcon (PhosphorIconsLight .fileText),
49- ),
50- initialValue: currentUser.name,
51- onChanged: (value) {
52- currentUser = currentUser.copyWith (name: value);
31+ constraints: const BoxConstraints (maxWidth: LeapBreakpoints .compact),
32+ content: ListView (shrinkWrap: true , children: [
33+ if (source == null ) ...[
34+ SourceDropdown <UserService >(
35+ value: currentSource,
36+ buildService: (e) => e.user,
37+ onChanged: (connected) {
38+ currentSource = connected? .source ?? '' ;
39+ currentService = connected? .model;
5340 },
5441 ),
55- const SizedBox (height: 16 ),
56- MarkdownField (
57- decoration: InputDecoration (
58- labelText: AppLocalizations .of (context).description,
59- border: const OutlineInputBorder (),
60- icon: const PhosphorIcon (PhosphorIconsLight .fileText),
61- ),
62- value: currentUser.description,
63- onChanged: (value) {
64- currentUser = currentUser.copyWith (description: value);
65- },
42+ ],
43+ const SizedBox (height: 16 ),
44+ TextFormField (
45+ decoration: InputDecoration (
46+ labelText: AppLocalizations .of (context).name,
47+ filled: true ,
48+ icon: const PhosphorIcon (PhosphorIconsLight .fileText),
49+ ),
50+ initialValue: currentUser.name,
51+ onChanged: (value) {
52+ currentUser = currentUser.copyWith (name: value);
53+ },
54+ ),
55+ const SizedBox (height: 16 ),
56+ MarkdownField (
57+ decoration: InputDecoration (
58+ labelText: AppLocalizations .of (context).description,
59+ border: const OutlineInputBorder (),
60+ icon: const PhosphorIcon (PhosphorIconsLight .fileText),
6661 ),
67- ]),
68- ),
69- scrollable: true ,
62+ value: currentUser.description,
63+ onChanged: (value) {
64+ currentUser = currentUser.copyWith (description: value);
65+ },
66+ ),
67+ ]),
7068 actions: [
7169 TextButton (
7270 onPressed: () => Navigator .of (context).pop (),
0 commit comments