Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
278 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; | ||
|
||
class LinkedOffsetPage extends StatefulWidget { | ||
@override | ||
_LinkedOffsetPageState createState() => _LinkedOffsetPageState(); | ||
} | ||
|
||
class _LinkedOffsetPageState extends State<LinkedOffsetPage> { | ||
ScrollController scrollController; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
scrollController = ScrollController(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: CupertinoNavigationBar( | ||
transitionBetweenRoutes: false, | ||
middle: LinkedOffsetWidget( | ||
child: Text("offset会变的哦"), | ||
scrollController: scrollController, | ||
), | ||
), | ||
body: ListView.builder( | ||
controller: scrollController, | ||
padding: EdgeInsets.only(), | ||
itemCount: 40, | ||
itemBuilder: (BuildContext context, int index) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 20, top: 20), | ||
child: Text('$index', style: TextStyle(fontSize: 25)), | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
} |
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,44 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; | ||
|
||
class LinkedOpacityAppBarPage extends StatefulWidget { | ||
@override | ||
_LinkedOpacityAppBarPageState createState() => | ||
_LinkedOpacityAppBarPageState(); | ||
} | ||
|
||
class _LinkedOpacityAppBarPageState extends State<LinkedOpacityAppBarPage> { | ||
ScrollController scrollController; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
scrollController = ScrollController(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
extendBodyBehindAppBar: true, | ||
appBar: LinkedOpacityAppBar( | ||
backgroundColor: Colors.deepOrange, | ||
scrollController: scrollController, | ||
toggleOffsetY: 200, | ||
title: | ||
Text("haha", style: TextStyle(fontSize: 20, color: Colors.black)), | ||
), | ||
body: ListView.builder( | ||
controller: scrollController, | ||
padding: EdgeInsets.only(), | ||
itemCount: 40, | ||
itemBuilder: (BuildContext context, int index) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 20, top: 20), | ||
child: Text('$index', style: TextStyle(fontSize: 25)), | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
} |
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,44 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; | ||
|
||
class LinkedOpacityNavigationBarPage extends StatefulWidget { | ||
@override | ||
_LinkedOpacityNavigationBarPageState createState() => | ||
_LinkedOpacityNavigationBarPageState(); | ||
} | ||
|
||
class _LinkedOpacityNavigationBarPageState | ||
extends State<LinkedOpacityNavigationBarPage> { | ||
ScrollController scrollController; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
scrollController = ScrollController(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
extendBodyBehindAppBar: true, | ||
appBar: LinkedOpacityNavigationBar( | ||
transitionBetweenRoutes: false, | ||
scrollController: scrollController, | ||
backgroundColor: Colors.blueAccent, | ||
middle: Text("这个导航栏透明度会变哦"), | ||
), | ||
body: ListView.builder( | ||
controller: scrollController, | ||
padding: EdgeInsets.only(), | ||
itemCount: 40, | ||
itemBuilder: (BuildContext context, int index) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 20, top: 20), | ||
child: Text('$index', style: TextStyle(fontSize: 25)), | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
} |
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,41 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; | ||
|
||
class LinkedOpacityPage extends StatefulWidget { | ||
@override | ||
_LinkedOpacityPageState createState() => _LinkedOpacityPageState(); | ||
} | ||
|
||
class _LinkedOpacityPageState extends State<LinkedOpacityPage> { | ||
ScrollController controller; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
controller = ScrollController(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: CupertinoNavigationBar( | ||
middle: LinkedOpacityWidget( | ||
child: Text("透明会变的哦"), | ||
scrollController: controller, | ||
), | ||
), | ||
body: ListView.builder( | ||
controller: controller, | ||
padding: EdgeInsets.only(), | ||
itemCount: 40, | ||
itemBuilder: (BuildContext context, int index) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 20, top: 20), | ||
child: Text('$index', style: TextStyle(fontSize: 25)), | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
} |
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,49 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:linked_scroll_widgets/linked_scroll_widgets.dart'; | ||
|
||
class LinkedSizePage extends StatefulWidget { | ||
@override | ||
_LinkedSizePageState createState() => _LinkedSizePageState(); | ||
} | ||
|
||
class _LinkedSizePageState extends State<LinkedSizePage> { | ||
ScrollController scrollController; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
scrollController = ScrollController(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: CupertinoNavigationBar( | ||
middle: Container( | ||
decoration: BoxDecoration( | ||
color: Colors.deepOrange, | ||
borderRadius: BorderRadius.circular(6), | ||
), | ||
child: LinkedSizeWidget( | ||
child: Text("size会变的哦"), | ||
finalWidth: 300, | ||
scrollController: scrollController, | ||
originalWidth: 100, | ||
), | ||
), | ||
), | ||
body: ListView.builder( | ||
controller: scrollController, | ||
padding: EdgeInsets.only(), | ||
itemCount: 40, | ||
itemBuilder: (BuildContext context, int index) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 20, top: 20), | ||
child: Text('$index', style: TextStyle(fontSize: 25)), | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
} |
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.