Commit 42ad3137 authored by susheel chebrolu's avatar susheel chebrolu

Uploaded feedback File

parent e8c1d1ae
import 'package:flutter/material.dart';
class FeedbackPage extends StatefulWidget {
static String tag = 'feedback';
@override
Feedback createState() => new Feedback();
}
class Feedback extends State<FeedbackPage> {
int _currentStep = 0;
@override
Widget build(BuildContext context) {
return new Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
expandedHeight: 200.0,
floating: false,
pinned: true,
flexibleSpace: FlexibleSpaceBar(
title: Text('FeedBack'),
background: Image.asset('assets/post.jpg'),
),
),
SliverFillRemaining(
child: Stepper(
steps: _mySteps(),
currentStep: this._currentStep,
onStepTapped: (step){
setState(() {
this._currentStep = step;
});
},
onStepContinue: (){
setState(() {
if(this._currentStep < this._mySteps().length - 1){
this._currentStep = this._currentStep + 1;
}else{
//Logic to check if everything is completed
print('Completed, check fields.');
}
});
},
onStepCancel: () {
setState(() {
if(this._currentStep > 0){
this._currentStep = this._currentStep - 1;
}else{
this._currentStep = 0;
}
});
},
),
),
],
),
);
}
List<Step> _mySteps(){
List<Step> _steps = [
Step(
title: Text('Step 1'),
content: TextField(),
isActive: _currentStep >= 0,
),
Step(
title: Text('Step 2'),
content: TextField(),
isActive: _currentStep >= 1,
),
Step(
title: Text('Step 3'),
content: TextField(),
isActive: _currentStep >= 2,
)
];
return _steps;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment