Mobile Client: Home Page :add floating action button

This commit is contained in:
Arthi-chaud
2022-02-18 09:26:07 +01:00
parent eddf9854ed
commit c347d627c6
5 changed files with 21 additions and 28 deletions
+7 -4
View File
@@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@@ -254,6 +254,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -272,7 +273,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -326,6 +327,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -350,7 +352,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -381,6 +383,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -399,7 +402,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
+8 -22
View File
@@ -25,6 +25,11 @@ class _HomePageState extends State<HomePage> {
ScrollController listController = ScrollController();
return Consumer<PipelineProvider>(
builder: (context, provider, _) => AerisPage(
floatingActionButton: FloatingActionButton(
onPressed: () => showAerisCardPage(context, (_) => const CreatePipelinePage()),
backgroundColor: Theme.of(context).colorScheme.secondary,
child: const Icon(Icons.add),
),
actions: [
HomePageSortMenu(
collectionProvider: provider,
@@ -51,29 +56,10 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only(bottom: 20, top: 20, left: 10, right: 10),
controller: listController,
itemCount: provider.pipelineCount + 1,
itemBuilder: (BuildContext context, int index) {
if (index == provider.pipelineCount) {
return ClickableCard(
color: Theme.of(context).colorScheme.secondary,
body: Padding(
padding: const EdgeInsets.only(top: 20, bottom: 20),
child: Text("Create a pipeline",
textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).colorScheme.onSecondary,
fontSize: 20,
fontWeight: FontWeight.w600)),
),
onTap: () {
showAerisCardPage(context, (_) => const CreatePipelinePage());
},
);
}
return PipelineCard(
pipeline: provider.getPipelineAt(index));
},
itemBuilder: (BuildContext context, int index) =>
PipelineCard(pipeline: provider.getPipelineAt(index),
),
)),
);
));
}
}
+1 -1
View File
@@ -44,7 +44,7 @@ class _ActionFormState extends State<ActionForm> {
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(context),
]),
keyboardType: (widget.initValues.containsKey(name)) && widget.initValues[name] is Int ? TextInputType.number : null,
keyboardType: (widget.initValues.containsKey(name)) && widget.initValues[name] is int ? TextInputType.number : null,
)),
...[
ElevatedButton(
+4
View File
@@ -9,18 +9,22 @@ class AerisPage extends StatelessWidget {
/// Display appbar or not
final bool displayAppbar;
final Widget? floatingActionButton;
/// Actions for appbar
final List<Widget> actions;
const AerisPage(
{Key? key,
required this.body,
this.displayAppbar = true,
this.floatingActionButton,
this.actions = const []})
: super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: floatingActionButton,
resizeToAvoidBottomInset: false,
body: SizedBox(
width: MediaQuery.of(context).size.width,