titled_page_view 0.1.1

titled_page_view #

A Flutter PageView with an additional title bar and optional controls.

Build Status

Showcase #

Usage #

Example #

First, add the package to your pubspec.yaml:


    dependencies:
     ...
     titled_page_view: ^0.1.1

Now you can use TitledPageView like Flutters's PageView


 import 'package:titled_page_view/titled_page_view.dart';

 ...

 new Scaffold(
   body: new TitledPageView(
     children: [
       Column(
         children: [
           Container(height: 300, color: Colors.green),
         ]
       ),
       Column(
         children: [
           Container(height: 300, color: Colors.red),
         ]
       ),
     ],
     titleChildren: [
       Text('Green'),
       Text('Red'),
     ],
   ),
 ),

Interface #

TitledPageView is build around Flutter's PageView. Therefore, many have the same name and work exactly the same. The only two additional options are fadeEffect and controlButtons, which add optional fading effects and controls to the title, respectively. Currently, both the fade animation and the buttons (chevron_left/chevron_right) are hard coded. Lastly, the code is written such that scrollDirection of Axis.vertical is currently not possible, hence this option does not exist. With these differences in mind the interface resembles Flutter's PageView Widget very closely, thus one can always consult the official Flutter documentation.

[0.1.0] - 09.02.2019

Initial Release

  • Title supports optional fading animation
  • Title supports optional control buttons
  • Unit tests included

example/example.dart

import 'package:flutter/material.dart';

import '../lib/titled_page_view.dart';

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

class Example extends StatefulWidget {
	@override
	State<StatefulWidget> createState() => ExampleState();
}

class ExampleState extends State<Example> with SingleTickerProviderStateMixin {
	List<Widget> titles = [Text('blue'), Text('red'), Text('green')];
	List<Widget> body = [
		Container(color: Colors.blue,),
		Container(color: Colors.red,),
		Container(color: Colors.green,),
	];

	@override void initState() {
		super.initState();
	}

	@override
	Widget build(BuildContext context) {

		return MaterialApp(
			title: 'titled_page_view example',
			home: Scaffold(
				appBar: AppBar(
					title: Text('titled_page_view example'),
				),
				body: TitledPageView(
					titleChildren: titles,
					children: body,
				),
			)
		);
	}
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  titled_page_view: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:titled_page_view/titled_page_view.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
37
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

We analyzed this package on Aug 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/titled_page_view.dart.

Run flutter format to format lib/titled_page_view.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test