Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:async';
- import 'package:flutter/material.dart';
- import 'package:intl/intl.dart';
- class EvaluationPage extends StatefulWidget {
- @override
- EvaluationPageState createState() => EvaluationPageState();
- }
- class EvaluationPageState extends State<EvaluationPage>
- with SingleTickerProviderStateMixin {
- List<Map<String, String>> _jenis_struktur_list = [
- {'title': 'Kayu', 'value': 'kayu'},
- {'title': 'Tembok', 'value': 'tembok'},
- {'title': 'Beton', 'value': 'beton'},
- {'title': 'Baja', 'value': 'baja'},
- {'title': 'Lainnya', 'value': 'lainnya'},
- ];
- String _jenis_struktur = 'kayu';
- final dateFormat = DateFormat('dd/MM/yyyy');
- DateTime _date = DateTime.now();
- TimeOfDay _time = TimeOfDay.now();
- TextEditingController _tanggalController =
- new TextEditingController(text: 'Coba');
- TabController tabController;
- PageController pageController;
- @override
- void initState() {
- super.initState();
- tabController = new TabController(length: 2, vsync: this);
- }
- @override
- void dispose() {
- super.dispose();
- tabController.dispose();
- }
- @override
- Widget build(BuildContext context) {
- final pageWidth = MediaQuery.of(context).size.width - 32.0;
- return Scaffold(
- appBar: AppBar(
- leading: InkWell(
- child: Icon(Icons.arrow_back),
- onTap: () => Navigator.pop(context),
- ),
- title: Text('Formulir'),
- ),
- body: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Column(
- children: [
- Padding(
- padding: const EdgeInsets.all(16.0),
- child: Text('1 of 4'),
- ),
- Expanded(
- child: PageView(
- children: <Widget>[
- Container(
- padding: EdgeInsets.all(16.0),
- width: pageWidth,
- color: Colors.white,
- child: Center(
- child: Text('Content 1'),
- ),
- ),
- Container(
- padding: EdgeInsets.all(16.0),
- width: pageWidth,
- color: Colors.yellow,
- child: Center(
- child: Text('Content 2'),
- ),
- ),
- Container(
- padding: EdgeInsets.all(16.0),
- width: pageWidth,
- color: Colors.white,
- child: Center(
- child: Text('Content 3'),
- ),
- ),
- ],
- ),
- ),
- Padding(
- padding: const EdgeInsets.all(16.0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- FloatingActionButton(
- mini: true,
- child: Icon(Icons.arrow_back),
- onPressed: () {},
- ),
- FloatingActionButton(
- mini: true,
- child: Icon(Icons.arrow_forward),
- onPressed: () {},
- ),
- ],
- ),
- )
- ],
- ),
- ));
- }
- Future<Null> _selectDate(BuildContext context) async {
- final DateTime picked = await showDatePicker(
- context: context,
- initialDate: _date,
- firstDate: DateTime(_date.year),
- lastDate: DateTime(2019));
- if (picked != null && picked != _date) {
- setState(() {
- _date = picked;
- });
- print('Result: ' + dateFormat.format(_date));
- }
- }
- sectionTitle(String title) {
- return Container(
- margin: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 2.0),
- child: Text(
- title,
- style: TextStyle(
- fontSize: 16.0,
- fontWeight: FontWeight.w300,
- color: Colors.black54,
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement