Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1a07f8d
remove split_view package
lesliearkorful Apr 13, 2021
42f92a7
create title_bar
lesliearkorful Apr 13, 2021
9a2ec6c
create sidebar
lesliearkorful Apr 13, 2021
88bca42
create content_area
lesliearkorful Apr 13, 2021
933f651
remove titlebar in MainFlutterWindow.swift
lesliearkorful Apr 13, 2021
326a7c4
Update pubspec.lock
lesliearkorful Apr 14, 2021
714427d
create resizable_pane
lesliearkorful Apr 15, 2021
91e6b58
create resizable_pane_notifier
lesliearkorful Apr 15, 2021
05d42f1
Update scaffold.dart
lesliearkorful Apr 16, 2021
3943385
Update macos_ui.dart
lesliearkorful Apr 26, 2021
0a7a226
Update main.dart
lesliearkorful Apr 26, 2021
da313cf
Merge branch 'dev' into scaffold
lesliearkorful Apr 26, 2021
f3c66e9
[example] add resizable pane
lesliearkorful Apr 26, 2021
605b87e
add dividerColor to MacosThemeData
lesliearkorful Apr 26, 2021
55c52c8
use BoxDecoration in Sidebar
lesliearkorful Apr 26, 2021
abc7c64
use SafeArea in ContentArea
lesliearkorful Apr 26, 2021
776f114
update ResizablePane
lesliearkorful Apr 26, 2021
935694b
update scaffold
lesliearkorful Apr 26, 2021
636639c
make `ResizablePane` `const`
lesliearkorful Apr 27, 2021
10ba752
make `Sidebar` `const`
lesliearkorful Apr 27, 2021
77098cc
make `TitleBar` `const`
lesliearkorful Apr 27, 2021
4a4f372
make `Scaffold` `const`
lesliearkorful Apr 27, 2021
cf7c9d1
Update CHANGELOG.md
lesliearkorful Apr 27, 2021
b6d94c9
Update resizable_pane.dart
lesliearkorful May 4, 2021
b4c1e1f
add maybeOf to scaffold
lesliearkorful May 4, 2021
ef7b804
Merge branch 'dev' into scaffold
lesliearkorful May 4, 2021
4ce9eb8
Update macos_ui.dart
lesliearkorful May 4, 2021
b7525f9
Update scaffold.dart
lesliearkorful May 5, 2021
02bcb0a
add `scaffoldBreakpoint` to `sidebar`
lesliearkorful May 6, 2021
d175d96
use sidebar breakpoint and toggling in `Scaffold`
lesliearkorful May 6, 2021
48627a9
use `scaffoldBreakpoint` in `ResizablePane`
lesliearkorful May 6, 2021
029716c
update example
lesliearkorful May 6, 2021
e700188
Address some requested changes
GroovinChip May 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [0.0.10]
* Revamp `Scaffold` [#26] (https://github.com/GroovinChip/macos_ui/issues/26)

## [0.0.9+1]
* `CapacityIndicator` colors can now be set on its constructor
* Accessibility support for most of the widgets
Expand Down
111 changes: 65 additions & 46 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,58 +34,77 @@ class Demo extends StatefulWidget {
}

class _DemoState extends State<Demo> {
bool value = false;

double sliderValue = 0;
double ratingValue = 0;
double sliderValue = 0;
bool value = false;

@override
Widget build(BuildContext context) {
return Scaffold(
sidebar: Center(
child: Text('Sidebar'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
PushButton(
buttonSize: ButtonSize.small,
child: Text('Button'),
onPressed: () {},
),
RadioButton(
value: value,
onChanged: (v) => setState(() => value = v),
),
Checkbox(
value: value,
onChanged: (v) => setState(() => value = v),
),
HelpButton(
onPressed: () {},
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CapacityIndicator(
value: sliderValue,
onChanged: (v) => setState(() => sliderValue = v),
discrete: true,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CapacityIndicator(
value: sliderValue,
onChanged: (v) => setState(() => sliderValue = v),
),
),
RatingIndicator(
value: ratingValue,
onChanged: (v) => setState(() => ratingValue = v),
),
RelevanceIndicator(value: 10),
],
titleBar: TitleBar(child: Text("Titlebar")),
sidebar: Sidebar(
minWidth: 200,
builder: (context, _) => Center(child: Text("Sidebar")),
),
children: <Widget>[
ContentArea(
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
padding: EdgeInsets.all(20),
child: Column(
children: [
PushButton(
buttonSize: ButtonSize.small,
child: Text('Button'),
onPressed: () => ScaffoldScope.of(context).toggleSidebar(),
),
SizedBox(height: 20),
RadioButton(
value: value,
onChanged: (v) => setState(() => value = v),
),
SizedBox(height: 20),
Checkbox(
value: value,
onChanged: (v) => setState(() => value = v),
),
SizedBox(height: 20),
HelpButton(
onPressed: () {},
),
SizedBox(height: 20),
CapacityIndicator(
value: sliderValue,
onChanged: (v) => setState(() => sliderValue = v),
discrete: true,
),
SizedBox(height: 20),
CapacityIndicator(
value: sliderValue,
onChanged: (v) => setState(() => sliderValue = v),
),
SizedBox(height: 20),
RatingIndicator(
value: ratingValue,
onChanged: (v) => setState(() => ratingValue = v),
),
SizedBox(height: 20),
RelevanceIndicator(value: 10),
],
),
);
},
),
ResizablePane(
minWidth: 300,
scaffoldBreakpoint: 400,
resizableSide: ResizableSide.left,
builder: (_, __) {
return Center(child: Text("Resizable Pane"));
},
),
],
);
}
}
5 changes: 5 additions & 0 deletions example/macos/Runner/MainFlutterWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ class MainFlutterWindow: NSWindow {
self.contentViewController = flutterViewController
self.setFrame(windowFrame, display: true)

self.titlebarAppearsTransparent = true
self.isMovableByWindowBackground = true
self.titleVisibility = .hidden
self.styleMask.insert(NSWindow.StyleMask.fullSizeContentView)

RegisterGeneratedPlugins(registry: flutterViewController)

super.awakeFromNib()
Expand Down
7 changes: 0 additions & 7 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
split_view:
dependency: transitive
description:
name: split_view
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1+2"
stack_trace:
dependency: transitive
description:
Expand Down
16 changes: 4 additions & 12 deletions lib/macos_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,18 @@ export 'src/buttons/push_button.dart';
export 'src/buttons/push_button_theme.dart';
export 'src/buttons/radio_button.dart';
export 'src/buttons/switch.dart';
export 'src/buttons/switch.dart';
export 'src/buttons/switch.dart';
export 'src/buttons/switch.dart';
export 'src/buttons/switch.dart';
export 'src/indicators/capacity_indicators.dart';
export 'src/indicators/progress_indicators.dart';
export 'src/indicators/progress_indicators.dart';
export 'src/indicators/progress_indicators.dart';
export 'src/indicators/rating_indicator.dart';
export 'src/indicators/relevance_indicator.dart';
export 'src/layout/content_area.dart';
export 'src/layout/resizable_pane.dart';
export 'src/layout/scaffold.dart';
export 'src/layout/scaffold.dart';
export 'src/layout/scaffold.dart';
export 'src/layout/scaffold.dart';
export 'src/macos_app.dart';
export 'src/layout/sidebar.dart';
export 'src/layout/title_bar.dart';
export 'src/macos_app.dart';
export 'src/styles/colors.dart';
export 'src/styles/macos_theme.dart';
export 'src/styles/macos_theme_data.dart';
export 'src/styles/typography.dart';
export 'src/styles/typography.dart';
export 'src/util.dart';
export 'src/util.dart';
39 changes: 39 additions & 0 deletions lib/src/layout/content_area.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:macos_ui/macos_ui.dart';
import 'package:macos_ui/src/layout/scaffold.dart';
import 'package:macos_ui/src/library.dart';

/// The widget that fills the rest of the body of the macOS [Scaffold].
///
/// A [Scaffold] can contain only one [ContentArea].
class ContentArea extends StatelessWidget {
/// Creates a widget that fills the body of the scaffold.
/// The [builder] can be null to show an empty widget.
///
/// The width of this
/// widget is automatically calculated in [ScaffoldScope].
const ContentArea({Key? key, @required this.builder}) : super(key: key);

/// The builder that creates a child to display in this widget, which will
/// use the provided [_scrollController] to enable the scrollbar to work.
///
/// Pass the [_scrollController] obtained from this method, to a scrollable
/// widget used in this method to work with the internal [Scrollbar].
final ScrollableWidgetBuilder? builder;

static final _scrollController = ScrollController();

@override
Widget build(BuildContext context) {
return SizedBox(
width: ScaffoldScope.of(context).contentAreaWidth,
child: SafeArea(
left: false,
right: false,
child: Scrollbar(
controller: _scrollController,
child: builder!(context, _scrollController),
),
),
);
}
}
Loading