-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17792 from [BEAM-13756] [Playground] Merge Log an…
…d Output tabs into one and add there filtering * [BEAM-13756] Merged Log and Output tabs into Result tab * [BEAM-13756] Merged Log and Output tabs into Result tab * [BEAM-13756] Merged Log and Output tabs into Result tab * [BEAM-13756] Merged Log and Output tabs into Result tab * [BEAM-13756] Merged Log and Output tabs into Result tab
- Loading branch information
1 parent
b366d52
commit 1f8ae65
Showing
10 changed files
with
250 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
playground/frontend/lib/modules/output/components/output_header/result_filter_bubble.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:playground/config/theme.dart'; | ||
import 'package:playground/constants/sizes.dart'; | ||
import 'package:playground/modules/examples/models/outputs_model.dart'; | ||
import 'package:playground/pages/playground/states/playground_state.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
class ResultFilterBubble extends StatelessWidget { | ||
final OutputType type; | ||
final String name; | ||
|
||
const ResultFilterBubble({ | ||
Key? key, | ||
required this.type, | ||
required this.name, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MouseRegion( | ||
cursor: SystemMouseCursors.click, | ||
child: Padding( | ||
padding: const EdgeInsets.only(right: kMdSpacing), | ||
child: Consumer<PlaygroundState>( | ||
builder: (context, state, child) { | ||
final isSelected = type == state.selectedOutputFilterType; | ||
|
||
return GestureDetector( | ||
onTap: () { | ||
if (!isSelected) { | ||
state.setSelectedOutputFilterType(type); | ||
state.filterOutput(type); | ||
} | ||
}, | ||
child: Container( | ||
height: kContainerHeight, | ||
padding: const EdgeInsets.symmetric(horizontal: kXlSpacing), | ||
decoration: BoxDecoration( | ||
color: isSelected | ||
? ThemeColors.of(context).primary | ||
: ThemeColors.of(context).lightGreyColor, | ||
borderRadius: BorderRadius.circular(kXlBorderRadius), | ||
), | ||
child: Center( | ||
child: Text( | ||
name, | ||
style: TextStyle( | ||
color: isSelected | ||
? ThemeColors.of(context).primaryBackgroundTextColor | ||
: ThemeColors.of(context) | ||
.lightGreyBackgroundTextColor, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
), | ||
); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
playground/frontend/lib/modules/output/components/output_header/result_filter_popover.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:playground/constants/sizes.dart'; | ||
import 'package:playground/modules/examples/models/outputs_model.dart'; | ||
import 'package:playground/modules/output/components/output_header/result_filter_bubble.dart'; | ||
|
||
const kPopoverWidth = 240.0; | ||
const kPopoverPadding = 50.0; | ||
|
||
class ResultFilterPopover extends StatelessWidget { | ||
const ResultFilterPopover({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
AppLocalizations appLocale = AppLocalizations.of(context)!; | ||
|
||
return Padding( | ||
padding: const EdgeInsets.only(top: kPopoverPadding), | ||
child: SizedBox( | ||
width: kPopoverWidth, | ||
child: Card( | ||
child: Padding( | ||
padding: const EdgeInsets.all(kMdSpacing), | ||
child: Wrap( | ||
runSpacing: kMdSpacing, | ||
children: [ | ||
Text(appLocale.displayAtThisTab), | ||
Padding( | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: kSmSpacing, | ||
vertical: kSmSpacing, | ||
), | ||
child: Row( | ||
children: [ | ||
ResultFilterBubble( | ||
type: OutputType.all, | ||
name: appLocale.all, | ||
), | ||
ResultFilterBubble( | ||
type: OutputType.log, | ||
name: appLocale.log, | ||
), | ||
ResultFilterBubble( | ||
type: OutputType.output, | ||
name: appLocale.output, | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.