Skip to content

Commit

Permalink
Changed version to 3.2.1.
Browse files Browse the repository at this point in the history
Added transition sample for issue toshiaki-h#19.
  • Loading branch information
toshiaki-h committed Aug 12, 2022
1 parent ec932f1 commit 341e9fc
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.2.1

* When rebuilding SplitView with an inline-constructed controller, the new controller was not assigned to _SplitViewState._controller and thus, did not get notified of moves after the first rebuild. (@jpnurmi)

## 3.2.0

* Added weights setter and notify changes.(thanks to @jpnurmi)
Expand Down
110 changes: 110 additions & 0 deletions example/lib/main_with_transition.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import 'package:flutter/material.dart';
import 'package:split_view/split_view.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, this.title}) : super(key: key);

final String? title;

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title!),
),
body: SplitView(
children: [
SplitView(
viewMode: SplitViewMode.Horizontal,
indicator: SplitIndicator(viewMode: SplitViewMode.Horizontal),
activeIndicator: SplitIndicator(
viewMode: SplitViewMode.Horizontal,
isActive: true,
),
gripColorActive: Colors.red,
children: [
Container(
child: Center(child: Text("View1")),
color: Colors.red,
),
Container(
child: Center(child: Text("View2")),
color: Colors.blue,
),
Container(
child: Center(child: Text("View3")),
color: Colors.green,
),
],
onWeightChanged: (w) => print("Horizon: $w"),
),
Container(
child: Center(
child: ElevatedButton(
child: Text('View4'),
onPressed: () {
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return DummyPage();
},
));
},
),
),
color: Colors.purple,
),
Container(
child: Center(child: Text("View5")),
color: Colors.yellow,
),
],
viewMode: SplitViewMode.Vertical,
indicator: SplitIndicator(viewMode: SplitViewMode.Vertical),
activeIndicator: SplitIndicator(
viewMode: SplitViewMode.Vertical,
isActive: true,
),
controller: SplitViewController(limits: [null, WeightLimit(max: 0.5)]),
onWeightChanged: (w) => print("Vertical $w"),
),
);
}
}

class DummyPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => DummyPageState();
}

class DummyPageState extends State<DummyPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Dummy')),
body: Center(
child: Text('dummy'),
),
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: split_view
description: This wedget provides horizontal or vertical split view for flutter.
version: 3.2.0
version: 3.2.1
homepage: https://github.com/toshiaki-h/split_view

environment:
Expand Down

0 comments on commit 341e9fc

Please sign in to comment.