This repository was archived by the owner on Dec 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +34
-7
lines changed Expand file tree Collapse file tree 6 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 1+ ##[ 1.1.2] - 29 November 2022
2+
3+ * add custom background to introduction page
14## [ 1.1.1] - 20 October 2022
25
36* fix single button mode position and size
Original file line number Diff line number Diff line change @@ -40,6 +40,17 @@ class MyApp extends StatelessWidget {
4040 ),
4141 IntroductionPage (
4242 title: const Text ('Layout Shift' ),
43+ decoration: const BoxDecoration (
44+ gradient: LinearGradient (
45+ begin: Alignment .topRight,
46+ end: Alignment .bottomLeft,
47+ colors: [
48+ Colors .yellow,
49+ Colors .red,
50+ Colors .indigo,
51+ Colors .teal,
52+ ],
53+ )),
4354 text: const Text (
4455 'You can change the layout of a page to mix things up.' ),
4556 graphic: const FlutterLogo (size: 100 ),
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class IntroductionPage {
2626 final Widget ? text;
2727 final Widget ? graphic;
2828 final ImageProvider ? backgroundImage;
29+ final Decoration ? decoration;
2930 final IntroductionLayoutStyle ? layoutStyle;
3031
3132 /// Creates an introduction page with data used in the introduction screen for
@@ -41,6 +42,7 @@ class IntroductionPage {
4142 this .text,
4243 this .graphic,
4344 this .backgroundImage,
45+ this .decoration,
4446 this .layoutStyle,
4547 });
4648}
Original file line number Diff line number Diff line change @@ -214,6 +214,7 @@ class ExplainerPage extends StatelessWidget {
214214 Widget build (BuildContext context) {
215215 var theme = Theme .of (context);
216216 return Background (
217+ background: page.decoration,
217218 backgroundImage: page.backgroundImage,
218219 child: SafeArea (
219220 child: Column (
Original file line number Diff line number Diff line change @@ -6,21 +6,30 @@ import 'package:flutter/material.dart';
66
77class Background extends StatelessWidget {
88 const Background ({
9+ this .background,
910 required this .child,
1011 this .backgroundImage,
1112 Key ? key,
1213 }) : super (key: key);
1314
15+ final Decoration ? background;
1416 final Widget child;
1517 final ImageProvider ? backgroundImage;
1618
1719 @override
1820 Widget build (BuildContext context) {
1921 var theme = Theme .of (context);
22+ var background = this .background ??
23+ BoxDecoration (
24+ color: theme.backgroundColor,
25+ );
26+ var size = MediaQuery .of (context).size;
2027 var backgroundImage = this .backgroundImage;
2128 if (backgroundImage != null ) {
22- return Material (
23- color: theme.backgroundColor,
29+ return Container (
30+ width: size.width,
31+ height: size.height,
32+ decoration: background,
2433 child: DecoratedBox (
2534 decoration: BoxDecoration (
2635 image: DecorationImage (
@@ -32,10 +41,11 @@ class Background extends StatelessWidget {
3241 ),
3342 );
3443 } else {
35- return Material (
36- color: theme.backgroundColor,
37- child: child,
38- );
44+ return Container (
45+ width: size.width,
46+ height: size.height,
47+ decoration: background,
48+ child: child);
3949 }
4050 }
4151}
Original file line number Diff line number Diff line change 11name : flutter_introduction_widget
22description : Flutter Introduction Widget for showing a list of introduction pages on a single scrollable page or horizontal pageview
3- version : 1.1.1
3+ version : 1.1.2
44homepage : https://github.com/Iconica-Development/flutter_introduction_widget
55
66environment :
You can’t perform that action at this time.
0 commit comments