repo_id
stringlengths 21
168
| file_path
stringlengths 36
210
| content
stringlengths 1
9.98M
| __index_level_0__
int64 0
0
|
|---|---|---|---|
mirrored_repositories/BookHive/lib/core
|
mirrored_repositories/BookHive/lib/core/utils/service_locator.dart
|
import 'package:dio/dio.dart';
import 'package:get_it/get_it.dart';
import '/core/utils/api_service.dart';
import '/features/home/data/repos/home_repo_implementation.dart';
import '/features/search/data/repo/search_repo_impl.dart';
// Dependency Injection Concept
final getIt = GetIt.instance;
void setupServiceLocator() {
getIt.registerSingleton<ApiService>(
ApiService(
Dio(),
),
);
getIt.registerSingleton<HomeRepoImpl>(
HomeRepoImpl(
getIt.get<ApiService>(),
),
);
getIt.registerSingleton<SearchRepoImpl>(
SearchRepoImpl(getIt.get<ApiService>()),
);
}
| 0
|
mirrored_repositories/Scribble-App
|
mirrored_repositories/Scribble-App/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:notes_app/Controller/add_notes_provider.dart';
import 'package:notes_app/Controller/delete_notes_provider.dart';
import 'package:notes_app/Controller/display_notes_provider.dart';
import 'package:notes_app/Controller/update_notes_provider.dart';
import 'package:notes_app/View/notes_display.dart';
import 'package:notes_app/View/splash_screen.dart';
import 'package:provider/provider.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider<NotesProvider>(create: (_) => NotesProvider()),
ChangeNotifierProvider<DisplayNotesProvider>(create: (_) => DisplayNotesProvider()),
ChangeNotifierProvider<DeleteNotesProvider>(create: (_) => DeleteNotesProvider()),
ChangeNotifierProvider<UpdateNotesProvider>(create: (_) => UpdateNotesProvider()),
],
child: MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Notes App',
theme: ThemeData.dark(
useMaterial3: true
),
home: const SplashScreen(),
),
);
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Utils/snackbar.dart
|
import 'package:flutter/material.dart';
class snackBar{
static void showSnackBar(BuildContext context , String title){
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
),
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 10),
duration: const Duration(seconds: 2),
backgroundColor: Colors.redAccent,
content: Text(title, style: const TextStyle(fontSize: 20, color: Colors.black87),),
),
);
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Model/db_model.dart
|
class Notes {
int? id;
String title;
String subtitle;
String description;
int? priority;
String date;
Notes({
this.id,
required this.title,
required this.subtitle,
required this.description,
required this.priority,
required this.date,
});
Map<String, dynamic> toMap() {
return {
'id': id,
'title': title,
'subtitle': subtitle,
'description': description,
'priority': priority,
'date': date,
};
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Model/db_helper.dart
|
import 'dart:async';
import 'package:notes_app/Model/db_model.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
class DatabaseHelper {
static const _databaseName = 'notes_database.db';
static const _databaseVersion = 1;
static const table = 'Note';
static const columnId = 'id';
static const columnTitle = 'title';
static const columnSubtitle = 'subtitle';
static const columnDescription = 'description';
static const columnPriority = 'priority';
static const columnDate = 'date';
DatabaseHelper();
static final DatabaseHelper db_instance = DatabaseHelper();
static Database? _database;
Future<Database> get database async {
if (_database != null) return _database!;
_database = await _initDatabase();
return _database!;
}
_initDatabase() async {
String path = join(await getDatabasesPath(), _databaseName);
return await openDatabase(path,
version: _databaseVersion, onCreate: _onCreate);
}
Future _onCreate(Database db, int version) async {
db.execute(
"CREATE TABLE $table($columnId INTEGER PRIMARY KEY AUTOINCREMENT, $columnTitle TEXT NOT NULL, $columnSubtitle TEXT NOT NULL, $columnDescription TEXT NOT NULL, $columnPriority INTEGER NOT NULL, $columnDate TEXT NOT NULL)");
}
Future<Notes> insert(Notes notes) async {
final db = await database;
await db.insert(
table,
notes.toMap(),
);
return notes;
}
Future<List<Notes>> getNotes() async {
final db = await database;
final List<Map<String, dynamic>> maps = await db.query(table);
return List.generate(maps.length, (i) {
return Notes(
id: maps[i]['id'],
title: maps[i]['title'],
subtitle: maps[i]['subtitle'],
description: maps[i]['description'],
priority: maps[i]['priority'],
date: maps[i]['date']);
});
}
Future<int> update(Notes notes) async {
final db = await database;
return await db.update(
table,
notes.toMap(),
where: '$columnId = ?',
whereArgs: [notes.id],
);
}
Future<int?> delete(int id) async {
final db = await database;
return await db.delete(
table,
where: '$columnId = ?',
whereArgs: [id],
);
}
Future close() async {
var db = await database;
db.close();
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/View/add_notes.dart
|
import 'package:flutter/material.dart';
import 'package:notes_app/Controller/add_notes_provider.dart';
import 'package:notes_app/Model/db_helper.dart';
import 'package:notes_app/Model/db_model.dart';
import 'package:notes_app/Utils/snackbar.dart';
import 'package:notes_app/View/notes_display.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
class AddNotes extends StatefulWidget {
Future<List<Notes>> noteslist;
AddNotes({required this.noteslist, Key? key}) : super(key: key);
@override
State<AddNotes> createState() => _AddNotesState();
}
class _AddNotesState extends State<AddNotes> {
TextEditingController titleController = TextEditingController();
TextEditingController subtitleController = TextEditingController();
TextEditingController descriptionController = TextEditingController();
int priority = 1;
DatabaseHelper databaseHelper = DatabaseHelper();
@override
void initState() {
// TODO: implement initState
super.initState();
databaseHelper = DatabaseHelper();
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.redAccent,
),
body: Column(
children: [
const SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(20),
child: Container(
height: 50,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 15, vertical: 0),
child: TextFormField(
textInputAction: TextInputAction.newline,
style: const TextStyle(fontSize: 19),
controller: titleController,
cursorColor: Colors.grey,
decoration: const InputDecoration(
hintText: 'Title',
border: InputBorder.none,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Container(
height: 50,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: TextFormField(
maxLines: 2,
style: const TextStyle(fontSize: 16),
controller: subtitleController,
cursorColor: Colors.grey,
decoration: const InputDecoration(
border: InputBorder.none,
hintText: 'Subtitle',
hintStyle: TextStyle(fontSize: 17)),
),
),
),
),
Consumer<NotesProvider>(
builder: (BuildContext context, value, Widget? child) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 25),
child: Row(
children: [
InkWell(
onTap: () {
value.setPriority(1);
},
child: Stack(
children: [
CircleAvatar(
radius: 10,
backgroundColor:
value.priority == 1 ? Colors.white : Colors.red,
child: value.priority == 1
? Stack(
children: const [
CircleAvatar(
radius: 7.7,
backgroundColor: Colors.red,
),
],
)
: Container(),
),
],
)),
const SizedBox(width: 10),
InkWell(
onTap: () {
value.setPriority(2);
},
child: Stack(
children: [
CircleAvatar(
radius: 10,
backgroundColor: value.priority == 2
? Colors.white
: Colors.yellow,
child: value.priority == 2
? Stack(
children: const [
CircleAvatar(
radius: 7.5,
backgroundColor: Colors.yellow,
),
],
)
: Container(),
),
],
)),
const SizedBox(width: 10),
InkWell(
onTap: () {
value.setPriority(3);
},
child: Stack(
children: [
CircleAvatar(
radius: 10,
backgroundColor:
value.priority == 3 ? Colors.white : Colors.green,
child: value.priority == 3
? Stack(
children: const [
CircleAvatar(
radius: 7.7,
backgroundColor: Colors.green,
),
],
)
: Container(),
),
],
),
)
],
),
);
}),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Container(
height: 270,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 3, horizontal: 12),
child: TextFormField(
style: const TextStyle(fontSize: 15.5),
maxLines: 20,
textInputAction: TextInputAction.newline,
controller: descriptionController,
cursorColor: Colors.grey,
decoration: const InputDecoration(
border: InputBorder.none,
hintText: 'Description',
hintStyle: TextStyle(fontSize: 17)),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 25),
child: Consumer<NotesProvider>(
builder: (BuildContext context, value, Widget? child) {
return InkWell(
onTap: () {
print('inside add notes');
var now = DateTime.now();
var formatter = DateFormat('dd-MM-yyyy');
String formattedDate = formatter.format(now);
value.addNote(
Notes(
title: titleController.text.toString(),
subtitle: subtitleController.text.toString(),
description:
descriptionController.text.toString(),
priority: value.priority,
date: formattedDate),
databaseHelper);
snackBar.showSnackBar(context, 'Notes Added');
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const DisplayNotes()));
},
child: Container(
height: 40,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.redAccent,
borderRadius: BorderRadius.circular(40)),
child: const Center(
child: Text(
'Save',
style: TextStyle(fontSize: 18),
)),
),
);
},
))
],
),
);
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/View/notes_display.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:intl/intl.dart';
import 'package:notes_app/Controller/display_notes_provider.dart';
import 'package:notes_app/Model/db_helper.dart';
import 'package:notes_app/Model/db_model.dart';
import 'package:notes_app/View/add_notes.dart';
import 'package:notes_app/View/view_notes.dart';
import 'package:provider/provider.dart';
class DisplayNotes extends StatefulWidget {
const DisplayNotes({Key? key}) : super(key: key);
@override
State<DisplayNotes> createState() => _DisplayNotesState();
}
class _DisplayNotesState extends State<DisplayNotes> {
DatabaseHelper? databaseHelper;
late Future<List<Notes>> notesList;
@override
void initState() {
// TODO: implement initState
super.initState();
databaseHelper = DatabaseHelper();
loadData();
}
loadData() async {
notesList = databaseHelper!.getNotes();
}
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
title: const Text(
'Notes App',
style: TextStyle(fontWeight: FontWeight.bold),
),
backgroundColor: Colors.redAccent,
automaticallyImplyLeading: false,
),
body: Column(
children: [
const SizedBox(
height: 20,
),
Consumer<DisplayNotesProvider>(
builder: (BuildContext context, value, Widget? child) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
InkWell(
onTap: () {
value.addFilter('all');
},
child: Container(
height: 40,
width: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.grey.withOpacity(.65)),
child: const Center(
child: Icon(Icons.filter_alt,
color: Colors.red, size: 26)),
),
),
InkWell(
onTap: () {
value.addFilter('high');
},
child: Container(
height: size.height * 0.043,
width: size.width * 0.2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: Colors.grey.withOpacity(.65)),
child: const Center(
child: Text(
'High',
style: TextStyle(fontSize: 18, color: Colors.red),
)),
),
),
InkWell(
onTap: () {
value.addFilter('medium');
},
child: Container(
height: size.height * 0.043,
width: size.width * 0.3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: Colors.grey.withOpacity(.65)),
child: const Center(
child: Text(
'Medium',
style: TextStyle(fontSize: 18, color: Colors.yellow),
)),
),
),
InkWell(
onTap: () {
value.addFilter('low');
},
child: Container(
height: size.height * 0.042,
width: size.width * 0.2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: Colors.grey.withOpacity(.65)),
child: const Center(
child: Text(
'Low',
style: TextStyle(fontSize: 18, color: Colors.green),
)),
),
),
],
);
},
),
const SizedBox(
height: 50,
),
Consumer<DisplayNotesProvider>(
builder: (BuildContext context, value, Widget? child) {
return Expanded(
child: FutureBuilder(
future: notesList,
builder: (context, AsyncSnapshot<List<Notes>> snapshot) {
if (snapshot.hasData) {
List<Notes> filteredNotes = snapshot.data!;
if (value.filter == 'high') {
filteredNotes = snapshot.data!
.where((note) => note.priority == 1)
.toList();
} else if (value.filter == 'medium') {
filteredNotes = snapshot.data!
.where((note) => note.priority == 2)
.toList();
} else if (value.filter == 'low') {
filteredNotes = snapshot.data!
.where((note) => note.priority == 3)
.toList();
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: StaggeredGridView.builder(
itemCount: filteredNotes.length,
gridDelegate:
SliverStaggeredGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
staggeredTileCount: filteredNotes.length,
mainAxisSpacing: 10,
crossAxisSpacing: 8,
staggeredTileBuilder: (index) =>
const StaggeredTile.fit(1),
),
itemBuilder: (context, index) {
return InkWell(
onTap: () {
var now = DateTime.now();
var formatter = DateFormat('dd-MM-yyyy');
String formattedDate =
formatter.format(now);
List<Notes>? snapData = filteredNotes;
final data = Notes(
id: filteredNotes[index].id,
title:
filteredNotes[index].title.toString(),
subtitle: filteredNotes[index]
.subtitle
.toString(),
description: filteredNotes[index]
.description
.toString(),
priority: filteredNotes[index].priority,
date: formattedDate,
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ViewNotes(
snap: snapData,
notes: notesList,
noteslist: data),
),
);
},
child: Card(
color: Colors.grey.withOpacity(.65),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
filteredNotes[index]
.title
.toString(),
style: const TextStyle(
fontSize: 18,
),
),
CircleAvatar(
radius: 8,
backgroundColor:
filteredNotes[index]
.priority ==
1
? Colors.red
: filteredNotes[index]
.priority ==
2
? Colors.yellow
: Colors.green,
)
],
),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
filteredNotes[index]
.subtitle
.toString(),
style: const TextStyle(
fontSize: 14,
color: Color(0xFFD1D1D1),
),
),
),
),
const SizedBox(
height: 12,
),
Align(
alignment: Alignment.bottomLeft,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 5),
child: Text(
filteredNotes[index].date,
style:
const TextStyle(fontSize: 14),
),
),
)
],
),
),
);
},
),
);
} else {
return Container();
}
}));
},
)
],
),
floatingActionButton: FloatingActionButton(
backgroundColor: Colors.redAccent,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddNotes(
noteslist: notesList,
)));
},
child: const Icon(
Icons.add,
color: Colors.white,
),
),
);
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/View/splash_screen.dart
|
import 'package:flutter/material.dart';
import 'package:notes_app/Controller/splash_controller.dart';
class SplashScreen extends StatefulWidget {
const SplashScreen({Key? key}) : super(key: key);
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
SplashScreenController splashScreenController = SplashScreenController();
@override
void initState() {
// TODO: implement initState
super.initState();
splashScreenController.SplashTime(context);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Container(
height: 100,
width: 100,
child: Image(
color: Colors.redAccent,
image: AssetImage('images/notes_icon_100.png')),),
),
SizedBox(height: 15,),
Text('Take Notes', style: TextStyle(color: Colors.redAccent, fontSize: 24, fontWeight: FontWeight.w400),),
SizedBox(height: 100,),
Center(child: CircularProgressIndicator(
color: Colors.redAccent, ))
],
),
);
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/View/view_notes.dart
|
import 'package:flutter/material.dart';
import 'package:notes_app/Controller/delete_notes_provider.dart';
import 'package:notes_app/Model/db_helper.dart';
import 'package:notes_app/Model/db_model.dart';
import 'package:notes_app/Utils/snackbar.dart';
import 'package:notes_app/View/edit_notes.dart';
import 'package:notes_app/View/notes_display.dart';
import 'package:provider/provider.dart';
class ViewNotes extends StatefulWidget {
List<Notes>? snap;
Future<List<Notes>> notes;
Notes noteslist;
ViewNotes(
{required this.snap,
required this.notes,
required this.noteslist,
Key? key})
: super(key: key);
@override
State<ViewNotes> createState() => _ViewNotesState();
}
class _ViewNotesState extends State<ViewNotes> {
DatabaseHelper? databaseHelper;
@override
void initState() {
// TODO: implement initState
super.initState();
databaseHelper = DatabaseHelper();
}
@override
Widget build(BuildContext context) {
print('build');
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.redAccent,
actions: [
Consumer<DeleteNotesProvider>(builder: (BuildContext context, value, Widget? child) {
return IconButton(
onPressed: () async {
// setState(() {
// databaseHelper!.delete(widget.noteslist.id!);
// widget.notes = databaseHelper!.getNotes();
// //widget.snap!.remove(widget.noteslist.id);
// });
print('inside icon');
value.deleteNotes(databaseHelper!, widget.noteslist.id!);
snackBar.showSnackBar(context, 'Deleted Successfully');
await Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const DisplayNotes()));
},
icon: const Icon(Icons.delete));
},),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EditNotes(
notes: widget.notes,
noteslist: widget.noteslist)));
// setState(() {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => EditNotes(
// notes: widget.notes,
// noteslist: widget.noteslist)));
// });
},
icon: const Icon(Icons.edit))
],
),
body: Column(
children: [
const SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(20),
child: Container(
height: 50,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
child: Text(
widget.noteslist.title,
style: const TextStyle(fontSize: 20),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Container(
height: 50,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 15, vertical: 11),
child: Text(
widget.noteslist.subtitle,
style: const TextStyle(fontSize: 16),
)),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 25),
child: Row(
children: [
CircleAvatar(
radius: 10,
backgroundColor: widget.noteslist.priority == 1
? Colors.red
: widget.noteslist.priority == 2
? Colors.yellow
: Colors.green)
],
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Container(
height: 270,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 16, horizontal: 15),
child: Text(
widget.noteslist.description,
style: const TextStyle(fontSize: 15),
)),
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/View/edit_notes.dart
|
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:notes_app/Controller/update_notes_provider.dart';
import 'package:notes_app/Model/db_helper.dart';
import 'package:notes_app/Model/db_model.dart';
import 'package:notes_app/View/notes_display.dart';
import 'package:notes_app/Utils/snackbar.dart';
import 'package:provider/provider.dart';
class EditNotes extends StatefulWidget {
Notes noteslist;
Future<List<Notes>> notes;
EditNotes({required this.notes, required this.noteslist, Key? key})
: super(key: key);
@override
State<EditNotes> createState() => _EditNotesState();
}
class _EditNotesState extends State<EditNotes> {
late String title;
late String subtitle;
late String description;
late int Priority;
late int priority;
TextEditingController titleController = TextEditingController();
TextEditingController subtitleController = TextEditingController();
TextEditingController descriptionController = TextEditingController();
@override
void initState() {
// TODO: implement initState
super.initState();
databaseHelper = DatabaseHelper();
title = widget.noteslist.title;
subtitle = widget.noteslist.subtitle;
description = widget.noteslist.description;
Priority = widget.noteslist.priority!;
titleController.text = title;
subtitleController.text = subtitle;
descriptionController.text = description;
priority = Priority;
}
DatabaseHelper? databaseHelper;
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.redAccent,
),
body: Column(
children: [
const SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(20),
child: Container(
height: 50,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 15, vertical: 0),
child: TextFormField(
style: const TextStyle(fontSize: 20),
controller: titleController,
cursorColor: Colors.grey,
decoration: const InputDecoration(
hintText: 'Title',
border: InputBorder.none,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Container(
height: 50,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 15, vertical: 0),
child: TextFormField(
style: const TextStyle(fontSize: 16),
controller: subtitleController,
cursorColor: Colors.grey,
decoration: const InputDecoration(
border: InputBorder.none,
hintText: 'Subtitle',
hintStyle: TextStyle(fontSize: 16)),
),
),
),
),
Consumer<UpdateNotesProvider>(
builder: (BuildContext context, value, Widget? child) {
return Padding(
padding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 25),
child: Row(
children: [
InkWell(
onTap: () {
value.setPriority(1);
priority = value.priority;
},
child: Stack(
children: [
CircleAvatar(
radius: 10,
backgroundColor:
priority == 1 ? Colors.white : Colors.red,
child: priority == 1
? Stack(
children: const [
CircleAvatar(
radius: 7.7,
backgroundColor: Colors.red,
),
],
)
: Container(),
),
],
)),
const SizedBox(width: 10),
InkWell(
onTap: () {
value.setPriority(2);
priority = value.priority;
},
child: Stack(
children: [
CircleAvatar(
radius: 10,
backgroundColor:
priority == 2 ? Colors.white : Colors.yellow,
child: priority == 2
? Stack(
children: const [
CircleAvatar(
radius: 7.5,
backgroundColor: Colors.yellow,
),
],
)
: Container(),
),
],
)),
const SizedBox(width: 10),
InkWell(
onTap: () {
value.setPriority(3);
priority = value.priority;
},
child: Stack(
children: [
CircleAvatar(
radius: 10,
backgroundColor:
priority == 3 ? Colors.white : Colors.green,
child: priority == 3
? Stack(
children: const [
CircleAvatar(
radius: 7.7,
backgroundColor: Colors.green,
),
],
)
: Container(),
),
],
),
)
],
),
);
},
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Container(
height: 270,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.withOpacity(.65),
borderRadius: BorderRadius.circular(8)),
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 2, horizontal: 15),
child: TextFormField(
style: const TextStyle(fontSize: 15),
maxLines: 20,
textInputAction: TextInputAction.newline,
controller: descriptionController,
cursorColor: Colors.grey,
decoration: const InputDecoration(
border: InputBorder.none,
hintText: 'Description',
hintStyle: TextStyle(fontSize: 17)),
),
),
),
),
Consumer<UpdateNotesProvider>(
builder: (BuildContext context, value, Widget? child) {
return Padding(
padding:
const EdgeInsets.symmetric(vertical: 40, horizontal: 25),
child: InkWell(
onTap: () {
var now = DateTime.now();
var formatter = DateFormat('dd-MM-yyyy');
String formattedDate = formatter.format(now);
if (databaseHelper != null) {
value.updateNote(
Notes(
id: widget.noteslist.id,
title: titleController.text.toString(),
subtitle: subtitleController.text.toString(),
description: descriptionController.text.toString(),
priority: priority,
date: formattedDate,
),
databaseHelper!);
snackBar.showSnackBar(context, 'Notes Updated');
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const DisplayNotes()));
}
},
child: Container(
height: 40,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.redAccent,
borderRadius: BorderRadius.circular(40)),
child: const Center(
child: Text(
'Save',
style: TextStyle(fontSize: 18),
)),
),
),
);
},
)
],
),
);
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Controller/delete_notes_provider.dart
|
import 'package:flutter/foundation.dart';
import 'package:notes_app/Model/db_helper.dart';
import 'package:notes_app/Model/db_model.dart';
class DeleteNotesProvider with ChangeNotifier {
Future<void> deleteNotes(DatabaseHelper databaseHelper, int id) async {
databaseHelper.delete(id);
notifyListeners();
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Controller/add_notes_provider.dart
|
import 'package:flutter/foundation.dart';
import 'package:notes_app/Model/db_helper.dart';
import 'package:notes_app/Model/db_model.dart';
class NotesProvider extends ChangeNotifier {
int _priority = 1;
int get priority => _priority;
void setPriority(int priority) {
_priority = priority;
notifyListeners();
}
void addNote(Notes note, DatabaseHelper databaseHelper) {
databaseHelper.insert(note);
notifyListeners();
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Controller/display_notes_provider.dart
|
import 'package:flutter/foundation.dart';
class DisplayNotesProvider with ChangeNotifier {
String _filter = 'all';
get filter => _filter;
void addFilter(String val) {
_filter = val;
notifyListeners();
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Controller/splash_controller.dart
|
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:notes_app/View/notes_display.dart';
class SplashScreenController {
void SplashTime(BuildContext context) {
Timer(
const Duration(milliseconds: 3000),
() =>
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => const DisplayNotes())));
}
}
| 0
|
mirrored_repositories/Scribble-App/lib
|
mirrored_repositories/Scribble-App/lib/Controller/update_notes_provider.dart
|
import 'package:flutter/foundation.dart';
import 'package:notes_app/Model/db_helper.dart';
import 'package:notes_app/Model/db_model.dart';
class UpdateNotesProvider with ChangeNotifier {
int _priority = 1;
int get priority => _priority;
void setPriority(int priority) {
_priority = priority;
notifyListeners();
}
void updateNote(Notes note, DatabaseHelper databaseHelper) {
databaseHelper.update(note);
notifyListeners();
}
}
| 0
|
mirrored_repositories/Scribble-App
|
mirrored_repositories/Scribble-App/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:notes_app/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/animated_login_page_ui
|
mirrored_repositories/animated_login_page_ui/lib/login.dart
|
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/animation.dart';
import 'package:flutter_signin_button/flutter_signin_button.dart';
class LoginPage extends StatefulWidget {
@override
_LoginPageState createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage>
with SingleTickerProviderStateMixin {
Animation animation, childAnimation;
AnimationController animationController;
@override
void initState() {
super.initState();
animationController =
AnimationController(duration: Duration(seconds: 5), vsync: this);
// it flying from left side towards center
// -ve value mean it start from left side
animation = Tween(begin: -0.10, end: 0.0).animate(CurvedAnimation(
parent: animationController,
curve: Curves.easeIn,
));
childAnimation = Tween(begin: 20.0, end: 125.0).animate(CurvedAnimation(
parent: animationController,
curve: Curves.easeIn,
));
animationController.forward();
}
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return AnimatedBuilder(
animation: animationController,
builder: (BuildContext context, Widget child) {
return Scaffold(
body: Container(
height: MediaQuery.of(context).size.height - 20,
alignment: Alignment.bottomCenter,
padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Transform(
transform:
Matrix4.translationValues(animation.value * width, 0.0, 0.0),
child: AnimatedBuilder(
animation: childAnimation,
builder: (BuildContext context, Widget child) {
return Container(
height: childAnimation.value * 5,
width: childAnimation.value * 5,
child: ListView(
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 85.0),
child: Image(image: AssetImage('images/user.png')),
),
SizedBox(height: 10.0),
TextFormField(
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white)),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white)),
labelText: 'Email',
labelStyle: TextStyle(color: Colors.white54),
prefixIcon: Icon(Icons.email_outlined,
color: Colors.white54),
),
),
SizedBox(height: 10.0),
TextFormField(
style: TextStyle(color: Colors.white),
obscureText: true,
decoration: InputDecoration(
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white)),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white)),
labelText: 'Password',
labelStyle: TextStyle(color: Colors.white54),
prefixIcon:
Icon(Icons.vpn_key, color: Colors.white54),
),
),
SizedBox(height: 8.0),
Container(
alignment: Alignment.centerRight,
padding: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
child: Text(
'Forgot Password ?',
style:
TextStyle(fontSize: 16.0, color: Colors.white),
),
),
SizedBox(height: 16.0),
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.symmetric(vertical: 20.0),
child: Text(
'Login',
style: TextStyle(fontWeight: FontWeight.bold),
),
decoration: BoxDecoration(
// Border
borderRadius: BorderRadius.circular(30.0),
// Gradient
gradient: LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
const Color(0xffbb56d1),
const Color(0xff71d9d0),
],
),
),
),
SizedBox(height: 16.0),
Container(
padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Divider(color: Colors.white54, thickness: 1.0),
),
SizedBox(height: 16.0),
Center(
child: Text('or Sign In',
style: TextStyle(color: Colors.white)),
),
SizedBox(height: 16.0),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
SignInButton(
Buttons.Facebook,
mini: true,
onPressed: () {},
),
SignInButton(
Buttons.Twitter,
mini: true,
onPressed: () {},
),
SignInButton(
Buttons.LinkedIn,
mini: true,
onPressed: () {},
),
SignInButton(
Buttons.Tumblr,
mini: true,
onPressed: () {},
),
SignInButton(
Buttons.GitHub,
mini: true,
onPressed: () {},
),
],
),
SizedBox(height: 16.0),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Don\'t have an account ? ',
style: TextStyle(
fontSize: 16.0, color: Colors.white),
),
Container(
padding: EdgeInsets.symmetric(vertical: 8.0),
child: Text(
'Register Now',
style: TextStyle(
fontSize: 16.0,
color: Colors.white,
decoration: TextDecoration.underline,
),
),
),
],
),
],
),
);
},
),
),
),
);
},
);
}
}
| 0
|
mirrored_repositories/animated_login_page_ui
|
mirrored_repositories/animated_login_page_ui/lib/main.dart
|
import 'package:animated_login_page_ui/login.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
scaffoldBackgroundColor: Color(0xff1F1F1F),
primaryColor: Color(0xff145C9E),
primarySwatch: Colors.blue,
accentColor: Color(0xff007EF4),
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: LoginPage(),
);
}
}
| 0
|
mirrored_repositories/animated_login_page_ui
|
mirrored_repositories/animated_login_page_ui/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:animated_login_page_ui/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/rivaly
|
mirrored_repositories/rivaly/lib/LeaguePage.dart
|
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rivaly/EnterResultPage.dart';
import 'package:rivaly/OnboardingPage.dart';
import 'package:rivaly/models.dart';
const primaryColor = Colors.purple;
class FadeInSlideOutRoute<T> extends MaterialPageRoute<T> {
FadeInSlideOutRoute({WidgetBuilder builder, RouteSettings settings})
: super(builder: builder, settings: settings);
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
if (settings.isInitialRoute) return child;
// Fades between routes. (If you don't want any animation,
// just return child.)
if (animation.status == AnimationStatus.reverse)
return super.buildTransitions(context, animation, secondaryAnimation, child);
return FadeTransition(opacity: animation, child: child);
}
}
class LeaguePage extends StatefulWidget {
final String _leagueId;
LeaguePage(this._leagueId);
@override
State<StatefulWidget> createState() {
return _LeaguePageState();
}
}
class _LeaguePageState extends State<LeaguePage> {
League _league;
List<Member> _members;
@override
void initState() {
super.initState();
_fetchData();
}
_fetchData() async {
var snap =
await Firestore.instance.document('leagues/${this.widget._leagueId}').get();
setState(() {
_league = League(snap);
});
}
void _settingModalBottomSheet(BuildContext context) {
showModalBottomSheet(context: context, builder: (BuildContext bc) {
return Container(
child: SafeArea(
child: Wrap(
children: <Widget>[
ListTile(
leading: Icon(Icons.exit_to_app),
title: Text('Logout'),
onTap: () async {
await FirebaseAuth.instance.signOut();
Navigator.pop(context);
Navigator.pushReplacement(
context,
FadeInSlideOutRoute(
builder: (context) => OnboardingPage()
)
);
}
)
],
),
),
);
}
);
}
@override
Widget build(BuildContext context) {
var signOutButton = IconButton(icon: Icon(Icons.more_horiz), onPressed: () async {
_settingModalBottomSheet(context);
});
return Scaffold(
appBar: AppBar(title: Text("Rivaly"), actions: <Widget>[signOutButton],),
body: _league == null ? Text("Loading...") : buildLeague(_league),
);
}
Widget buildLeague(League league) {
return ListView(
children: [
Stack(children: <Widget>[
Image.network(_league.picture),
Positioned(
bottom: 20,
left: 20,
child: Text(_league.name,
style: TextStyle(
fontWeight: FontWeight.w900,
fontSize: 30,
color: Colors.white)),
),
]),
Column(children: <Widget>[
Padding(
padding: EdgeInsets.all(20),
child: Align(
alignment: Alignment.topLeft,
child: Text('Ranking',
textAlign: TextAlign.left,
style:
TextStyle(fontWeight: FontWeight.w900, fontSize: 30)),
)),
RankingList(_league.id)
]),
]);
}
}
class RankingList extends StatefulWidget {
final String _leagueId;
RankingList(this._leagueId);
@override
State<StatefulWidget> createState() {
return _RankingListState(_leagueId);
}
}
class _RankingListState extends State<RankingList> {
String _leagueId;
List<Member> _members;
User _currentUser;
_RankingListState(String leagueId) {
_leagueId = leagueId;
_fetchData();
}
_fetchData() async {
var membersSnap = await Firestore.instance
.collection('leagues/${League.demoLeagueId}/members')
.getDocuments();
var users = await _fetchRelations(
Firestore.instance.collection('users'),
membersSnap.documents.toList().map((snap) {
return snap.documentID;
}).toList());
var user = await User.currentUser();
setState(() {
_currentUser = user;
_members = membersSnap.documents.toList().map((snap) {
return Member.decode(snap, users[snap.documentID]);
}).toList();
_members.sort((one, two) => two.score - one.score);
});
}
Future<Map<String, DocumentSnapshot>> _fetchRelations(
CollectionReference ref, List<String> ids) async {
var futures = ids.map((id) {
return ref.document(id).get();
});
Map<String, DocumentSnapshot> resultMap = Map();
var result = await Future.wait(futures);
result.toList().forEach((doc) {
resultMap[doc.documentID] = doc;
});
return resultMap;
}
ListTile _listItem(int index, Member member) {
var isMe = member.id == _currentUser.id;
var meString = isMe ? "(me)" : "";
var listTextStyle = TextStyle(fontWeight: isMe ? FontWeight.w700 : FontWeight.w500, fontSize: 18);
return ListTile(
leading: new Container(
width: 35,
height: 35,
decoration: new BoxDecoration(
shape: BoxShape.circle,
image: new DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(member.user.picture)))),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text("${member.score}", style: listTextStyle),
IconButton(
icon: Icon(Icons.cake),
color: primaryColor,
onPressed: isMe ? null : () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
EnterResultPage(opponent: member),
fullscreenDialog: true),
);
_fetchData();
}
)
],
),
title: Text("${index + 1} ${member.user.name} ${meString}", style: listTextStyle),
);
}
@override
Widget build(BuildContext context) {
if (_members == null) {
return Text("Loading...");
}
if (_members.length == 0) {
return Text("No members");
}
return Column(
children: _members
.asMap()
.map((index, member) {
return MapEntry(index, _listItem(index, member));
})
.values
.toList());
}
}
| 0
|
mirrored_repositories/rivaly
|
mirrored_repositories/rivaly/lib/OnboardingPage.dart
|
import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rivaly/LeaguePage.dart';
import 'package:rivaly/models.dart';
import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';
const primaryColor = Colors.purple;
class OnboardingPage extends StatefulWidget {
OnboardingPage({Key key}) : super(key: key);
@override
_OnboardingPageState createState() => _OnboardingPageState();
}
class _OnboardingPageState extends State<OnboardingPage> {
final FirebaseAuth _auth = FirebaseAuth.instance;
File _image;
final nameFieldController = TextEditingController();
bool actionButtonDisabled = true;
@override
void initState() {
super.initState();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark.copyWith(
statusBarColor: Colors.black, //or set color with: Color(0xFF0000FF)
));
}
Future getImage() async {
var image; //await ImagePicker.pickImage(source: ImageSource.gallery);
setState(() {
_image = image;
});
}
_signUp() async {
var firebaseUser;
print("BEFORE AUTH");
try {
firebaseUser = await _auth.signInAnonymously();
} catch (e) {
print("AUTH TESSTING");
print(e.toString());
throw e;
}
print("AUTH AFTER");
var user = User(firebaseUser.uid, nameFieldController.text, null);
await Firestore.instance
.document("users/${firebaseUser.uid}")
.setData(user.encode());
print("AUTH users");
var member = Member(user.id, user, 900);
await Firestore.instance
.document("leagues/${League.demoLeagueId}/members/${user.id}")
.setData(member.encode());
var prefs = await SharedPreferences.getInstance();
var jsonString = jsonEncode(user.encode());
await prefs.setString("currentUser", jsonString);
print("AUTH done");
}
@override
Widget build(BuildContext context) {
Widget widget = new Container(
width: 150,
height: 150,
decoration: new BoxDecoration(
shape: BoxShape.circle,
image: new DecorationImage(
fit: BoxFit.fill,
image: new NetworkImage("https://randomuser.me/api/portraits/women/78.jpg"))));
return Scaffold(
body: Center(
child: Padding(
padding: EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Join SF PingPong league',
style: TextStyle(fontWeight: FontWeight.w900, fontSize: 40)),
Container(height: 25),
GestureDetector(
onTap: getImage,
child: _image != null ? widget : Icon(Icons.person)),
Container(height: 25),
TextField(
style: TextStyle(fontSize: 40, color: Colors.black87),
controller: nameFieldController,
textCapitalization: TextCapitalization.words,
onChanged: (text) {
this.setState(() {
this.actionButtonDisabled = text.length < 3;
});
},
decoration: InputDecoration(border: InputBorder.none, hintText: 'Name'),
),
Container(height: 25),
SizedBox(
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0)),
onPressed: this.actionButtonDisabled ? null : () async {
this.setState(() { this.actionButtonDisabled = true; });
await _signUp();
Navigator.pushReplacement(
context,
FadeInSlideOutRoute(builder: (context) => LeaguePage(League.demoLeagueId)),
);
},
child: Text(
'Get Started',
style: TextStyle(color: Colors.white),
),
color: primaryColor,
),
width: double.infinity,
),
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/rivaly
|
mirrored_repositories/rivaly/lib/models.dart
|
import 'dart:convert';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:shared_preferences/shared_preferences.dart';
class League {
static const demoLeagueId = "fOfk8aa6Z3xsbJbVGDff";
String id;
String picture;
String name;
String note;
League(DocumentSnapshot snap) {
var data = snap.data;
id = snap.documentID;
name = data["name"];
picture = data["picture"] ?? 'https://cdn6.f-cdn.com/contestentries/1216494/10168094/5a47db5a18926_thumb900.jpg';
note = data["note"];
}
}
class Outcome {
static const win = 'win';
static const loss = "loss";
}
class Result {
String id;
String opponentId;
String hostId;
String outcome;
Result(this.id, this.opponentId, this.hostId, this.outcome);
Result.decode(DocumentSnapshot snap) {
id = snap.documentID;
opponentId = snap.data["opponentId"];
hostId = snap.data["hostId"];
outcome = snap.data["outcome"];
if (opponentId == null || hostId == null || outcome == null) {
throw FormatException("Could not decode Result");
}
}
Map<String, dynamic> encode() {
return {
'id': id,
'opponentId': opponentId,
'hostId': hostId,
'outcome': outcome
};
}
}
class User {
String id;
String name;
String picture;
User(this.id, this.name, this.picture);
User.decode(Map<String, dynamic> data) {
id = data["id"];
name = data["firstName"];
picture = data["picture"] ?? "https://randomuser.me/api/portraits/women/78.jpg";
if (id == null || name == null || picture == null) {
throw new Exception("Invalid user $id");
}
}
Map<String, dynamic> encode() {
return {
"id": id,
"firstName": name,
"picture": picture
};
}
static Future<User> currentUser() async {
var prefs = await SharedPreferences.getInstance();
var jsonString = prefs.getString("currentUser");
if (jsonString == null) return null;
return User.decode(jsonDecode(jsonString));
}
}
class Member {
String id;
User user;
int score;
Member(this.id, this.user, this.score);
static Future<Member> fetch(String leagueId, String userId) async {
var snap = await Firestore.instance
.document("leagues/$leagueId/members/$userId").get();
var userSnap = await Firestore.instance
.document("users/$userId").get();
print("User: $userId");
return Member.decode(snap, userSnap);
}
Member.decode(DocumentSnapshot memberSnap, DocumentSnapshot userSnap) {
id = memberSnap.documentID;
score = memberSnap.data["score"];
var data = userSnap.data;
data["id"] = userSnap.documentID;
user = User.decode(data);
}
Map<String, dynamic> encode() {
return {
'score': score,
'userId': user.id
};
}
}
| 0
|
mirrored_repositories/rivaly
|
mirrored_repositories/rivaly/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rivaly/LeaguePage.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:rivaly/OnboardingPage.dart';
import 'package:rivaly/models.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:convert';
void main() => runApp(MyApp());
const primaryColor = Colors.purple;
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool loading = false;
User currentUser;
@override
void initState() {
super.initState();
_setup();
}
_setup() async {
var user = await User.currentUser();
this.setState(() {
this.currentUser = user;
this.loading = false;
});
}
@override
Widget build(BuildContext context) {
print("heyy");
return MaterialApp(
title: 'Rivaly',
theme: ThemeData(
primarySwatch: primaryColor,
),
home: this.loading ? null : this.currentUser == null ? OnboardingPage() : LeaguePage(League.demoLeagueId),
debugShowCheckedModeBanner: false,
);
}
}
| 0
|
mirrored_repositories/rivaly
|
mirrored_repositories/rivaly/lib/EnterResultPage.dart
|
import 'dart:math';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rivaly/models.dart';
class EnterResultPage extends StatefulWidget {
final Member opponent;
EnterResultPage({this.opponent});
@override
_EnterResultPageState createState() => _EnterResultPageState();
}
class _EnterResultPageState extends State<EnterResultPage> {
int mySavedRating = 100;
String outcome = Outcome.win;
int getNewRating(double myGameResult, int targetRating, int opponentRating) {
if ([0, 0.5, 1].indexOf(myGameResult) == -1) {
return null;
}
var myChanceToWin = 1 / (1 + pow(10, (opponentRating - targetRating) / 400));
var delta = (32 * (myGameResult - myChanceToWin)).round();
return targetRating + delta;
}
_submitResults() async {
var currentUser = await User.currentUser();
var me = await Member.fetch(League.demoLeagueId, currentUser.id);
var gameResult = this.outcome == Outcome.win ? 1.0 : 0.0;
var myNewRating = this.getNewRating(gameResult, me.score, this.widget.opponent.score);
var opponentGameResult = this.outcome == Outcome.loss ? 1.0 : 0.0;
var opponentNewRating = this.getNewRating(opponentGameResult, this.widget.opponent.score, me.score);
var batch = Firestore.instance.batch();
var resultsDoc = Firestore.instance
.collection("leagues/${League.demoLeagueId}/results").document();
var result = Result(resultsDoc.documentID, this.widget.opponent.id, me.id, outcome);
batch.setData(resultsDoc, result.encode());
var meDoc = Firestore.instance
.document("leagues/${League.demoLeagueId}/members/${me.id}");
batch.updateData(meDoc, {'score': myNewRating});
var opponentDoc = Firestore.instance
.document("leagues/${League.demoLeagueId}/members/${this.widget.opponent.id}");
batch.updateData(opponentDoc, {'score': opponentNewRating});
await batch.commit();
}
@override
Widget build(BuildContext context) {
Widget opponentImage = new Container(
width: 50,
height: 50,
decoration: new BoxDecoration(
shape: BoxShape.circle,
image: new DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(this.widget.opponent.user.picture)
)
)
);
return Scaffold(
appBar: AppBar(title: Text("Enter Results"), actions: <Widget>[
IconButton(icon: Icon(Icons.send), onPressed: () async {
await _submitResults();
Navigator.pop(context);
})
]),
body: SafeArea(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(20),
child: Align(
alignment: Alignment.topLeft,
child: Column(
children: <Widget>[
Align(
alignment: Alignment.topLeft,
child: Text('Opponent',
style:
TextStyle(fontWeight: FontWeight.bold, fontSize: 20)),
),
Container(height: 10),
Row(
children: <Widget>[
opponentImage,
Container(width: 10),
Text(this.widget.opponent.user.name, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.black54)),
],
),
Padding(
padding: const EdgeInsets.only(top: 20),
child: Align(
alignment: Alignment.topLeft,
child: Text('Winner',
style:
TextStyle(fontWeight: FontWeight.bold, fontSize: 20)),
),
),
Align(
alignment: Alignment.topLeft,
child: DropdownButton<String>(
value: this.outcome,
onChanged: (String newValue) {
this.setState(() {
this.outcome = newValue;
});
},
items: <String>[Outcome.win, Outcome.loss].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value == Outcome.win ? 'Me' : 'Opponent'),
);
})
.toList(),
),
)
],
),
),
)
],
)),
);
}
}
| 0
|
mirrored_repositories/rivaly
|
mirrored_repositories/rivaly/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:rivaly/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Dijipol
|
mirrored_repositories/Dijipol/lib/main.dart
|
import 'package:dijipol/data/repositories/login_repository.dart';
import 'package:dijipol/data/repositories/signup_repository.dart';
import 'package:dijipol/presentation/auth/forgot_pass.dart';
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/first_open/select_language.dart';
import 'package:dijipol/presentation/first_open/steps_pages.dart';
import 'package:dijipol/presentation/home/account/change_settings.dart';
import 'package:dijipol/presentation/home/home_bottom_tabs.dart';
import 'package:dijipol/presentation/home/offers/Arac/arac_insurance_offer.dart';
import 'package:dijipol/presentation/home/support/branches.dart';
import 'package:dijipol/presentation/home/support/faq.dart';
import 'package:dijipol/presentation/home/offers/kasko/kasko_enter_info.dart';
import 'package:dijipol/presentation/home/offers/kasko/kasko_home_screen.dart';
import 'package:dijipol/presentation/home/offers/kasko/kasko_request_received.dart';
import 'package:dijipol/presentation/home/offers/kasko/kasko_view_offer.dart';
import 'package:dijipol/presentation/home/support/query_insurance_value.dart';
import 'package:dijipol/presentation/home/support/submit_claim.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:dijipol/presentation/home/offers/Zorunlu/zorunlu_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Zorunlu/zorunlu_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Zorunlu/zorunlu_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Dask/dask_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Dask/dask_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Dask/dask_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Dask/dask_request_received.dart';
import 'package:dijipol/presentation/home/offers/Dask/dask_payment.dart';
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlayıcı_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlayıcı_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlayıcı_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlayıcı_request_received.dart';
import 'package:dijipol/presentation/home/offers/Yabanci/yabanci_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Yabanci/yabanci_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Yabanci/yabanci_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Seyahat/seyahat_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Seyahat/seyahat_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Seyahat/seyahat_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Arac/arac_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Arac/arac_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Arac/arac_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Konut/konut_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Konut/konut_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Konut/konut_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Bireysel/bireysel_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Bireysel/bireysel_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Bireysel/bireysel_request_received.dart';
import 'package:dijipol/presentation/home/offers/Cep/cep_request_received.dart';
import 'package:dijipol/presentation/home/offers/Cep/cep_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Cep/cep_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Evcil/evcil_request_received.dart';
import 'package:dijipol/presentation/home/offers/Evcil/evcil_enter_info.dart';
import 'package:dijipol/presentation/home/offers/Evcil/evcil_home_screen.dart';
import 'package:dijipol/presentation/home/account/change_password.dart';
import 'package:dijipol/presentation/home/account/change_language.dart';
import 'logic/cubits/login_cubit/login_cubit.dart';
import 'logic/cubits/signup_cubit/signup_cubit.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MyHomePage();
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Dijipol',
theme: ThemeData(
// primarySwatch: MaterialColor(
// 0xFF090f4e,
// materialColorMaker(9, 15, 78),
// ),
fontFamily: 'Poppins',
primaryColor: const Color(0xFF0047ba),
primaryColorDark: const Color(0xFF090f4e),
primaryColorLight: const Color(0xFF5a7184),
backgroundColor: Colors.white,
highlightColor: Colors.transparent,
),
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: const <Locale>[
Locale('en', ''),
Locale('tr', ''),
// Locale('ar', ''),
// Locale('fa', ''),
// Locale('ru', ''),
],
home: SelectLanguageScreen(),
routes: <String, Widget Function(BuildContext context)>{
LoginScreen.routeName: (_) => BlocProvider(
create: (context) => LoginCubit(
repository: LoginRepository(),
),
child: LoginScreen(),
),
Register.routeName: (_) => BlocProvider(
create: (context) => SignupCubit(
repository: SignupRepository(),
),
child: Register(),
),
StepsPagesScreen.routeName: (_) => StepsPagesScreen(),
HomeBottomTabs.routeName: (_) => HomeBottomTabs(),
ForgotPass.routeName: (_) => ForgotPass(),
Register.routeName: (_) => Register(),
Branches.routeName: (_) => Branches(),
SubmitClaim.routeName: (_) => SubmitClaim(),
QueryInsuranceValue.routeName: (_) => QueryInsuranceValue(),
Faq.routeName: (_) => Faq(),
KaskoHomeScreen.routeName: (_) => KaskoHomeScreen(),
KaskoEnterInfo.routeName: (_) => KaskoEnterInfo(),
KaskoRequestReceived.routeName: (_) => KaskoRequestReceived(),
KaskoViewOffer.routeName: (_) => KaskoViewOffer(),
ZorunluHomeScreen.routeName: (_) => ZorunluHomeScreen(),
ZorunluEnterInfo.routeName: (_) => ZorunluEnterInfo(),
ZorunluViewOffer.routeName: (_) => ZorunluViewOffer(),
DaskHomeScreen.routeName: (_) => DaskHomeScreen(),
DaskEnterInfo.routeName: (_) => DaskEnterInfo(),
DaskViewOffer.routeName: (_) => DaskViewOffer(),
DaskRequestReceived.routeName: (_) => DaskRequestReceived(),
DaskPayment.routeName: (_) => DaskPayment(),
TamamlayHomeScreen.routeName: (_) => TamamlayHomeScreen(),
TamamlayEnterInfo.routeName: (_) => TamamlayEnterInfo(),
TamamlayRequestReceived.routeName: (_) => TamamlayRequestReceived(),
TamamlayViewOffer.routeName: (_) => TamamlayViewOffer(),
YabanciHomeScreen.routeName: (_) => YabanciHomeScreen(),
YabanciEnterInfo.routeName: (_) => YabanciEnterInfo(),
YabanciViewOffer.routeName: (_) => YabanciViewOffer(),
SeyahatHomeScreen.routeName: (_) => SeyahatHomeScreen(),
SeyahatEnterInfo.routeName: (_) => SeyahatEnterInfo(),
SeyahatViewOffer.routeName: (_) => SeyahatViewOffer(),
AracHomeScreen.routeName: (_) => AracHomeScreen(),
AracEnterInfo.routeName: (_) => AracEnterInfo(),
AracViewOffer.routeName: (_) => AracViewOffer(),
AracInsuranceOffer.routname: (_) => AracInsuranceOffer(),
BireyselHomeScreen.routeName: (_) => BireyselHomeScreen(),
BireyselEnterInfo.routeName: (_) => BireyselEnterInfo(),
BireyselRequestReceived.routeName: (_) => BireyselRequestReceived(),
KnoutHomeScreen.routeName: (_) => KnoutHomeScreen(),
KonutEnterInfo.routeName: (_) => KonutEnterInfo(),
KnoutViewOffer.routeName: (_) => KnoutViewOffer(),
CepRequestReceived.routeName: (_) => CepRequestReceived(),
CepHomeScreen.routeName: (_) => CepHomeScreen(),
CepEnterInfo.routeName: (_) => CepEnterInfo(),
EvcilRequestReceived.routeName: (_) => EvcilRequestReceived(),
EvcilHomeScreen.routeName: (_) => EvcilHomeScreen(),
EvcilEnterInfo.routeName: (_) => EvcilEnterInfo(),
ChangePassword.routeName: (_) => ChangePassword(),
ChangeLanguage.routeName: (_) => ChangeLanguage(),
ChangeSetting.routeName: (_) => ChangeSetting(),
SelectLanguageScreen.routeName: (_) => SelectLanguageScreen(),
},
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/district.dart
|
import 'dart:convert';
class District {
final int CityCode;
final String CountyCode;
final String CountyName;
District({
required this.CityCode,
required this.CountyCode,
required this.CountyName,
});
District copyWith({
int? CityCode,
String? CountyCode,
String? CountyName,
}) {
return District(
CityCode: CityCode ?? this.CityCode,
CountyCode: CountyCode ?? this.CountyCode,
CountyName: CountyName ?? this.CountyName,
);
}
Map<String, dynamic> toMap() {
return {
'CityCode': CityCode,
'CountyCode': CountyCode,
'CountyName': CountyName,
};
}
factory District.fromMap(Map<String, dynamic> map) {
return District(
CityCode: int.parse(map['CityCode'].toString()),
CountyCode: map['CountyCode'].toString(),
CountyName: map['CountyName'],
);
}
String toJson() => json.encode(toMap());
factory District.fromJson(String source) =>
District.fromMap(json.decode(source));
@override
String toString() =>
'District(CityCode: $CityCode, CountyCode: $CountyCode, CountyName: $CountyName)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is District &&
other.CityCode == CityCode &&
other.CountyCode == CountyCode &&
other.CountyName == CountyName;
}
@override
int get hashCode =>
CityCode.hashCode ^ CountyCode.hashCode ^ CountyName.hashCode;
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/buildingNumber.dart
|
import 'dart:convert';
class BuildingNumber{
final String Code;
final String Description;
BuildingNumber({
required this.Code,
required this.Description,
});
BuildingNumber copyWith({
String? Code,
String? Description,
}) {
return BuildingNumber(
Code: Code ?? this.Code,
Description: Description ?? this.Description,
);
}
Map<String, dynamic> toMap() {
return {
'Code': Code,
'Description': Description,
};
}
factory BuildingNumber.fromMap(Map<String, dynamic> map) {
return BuildingNumber(
Code: map['Code'].toString(),
Description: map['Description'].toString(),
);
}
String toJson() => json.encode(toMap());
factory BuildingNumber.fromJson(String source) =>
BuildingNumber.fromMap(json.decode(source));
@override
String toString() =>
'BuildingNumber(Code: $Code, Description: $Description)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is BuildingNumber &&
other.Code == Code &&
other.Description == Description;
}
@override
int get hashCode =>
Code.hashCode ^ Description.hashCode;
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/provinces.dart
|
import 'dart:convert';
class Provinces {
final String CityCode;
final String CityName;
final String ID;
Provinces({
required this.CityCode,
required this.CityName,
required this.ID,
});
Provinces copyWith({
String? CityCode,
String? CityName,
String? ID,
}) {
return Provinces(
CityCode: CityCode ?? this.CityCode,
CityName: CityName ?? this.CityName,
ID: ID ?? this.ID,
);
}
Map<String, dynamic> toMap() {
return {
'CityCode': CityCode,
'CityName': CityName,
'ID': ID,
};
}
factory Provinces.fromMap(Map<String, dynamic> map) {
return Provinces(
CityCode: map['CityCode'],
CityName: map['CityName'],
ID: map['ID'],
);
}
String toJson() => json.encode(toMap());
factory Provinces.fromJson(String source) =>
Provinces.fromMap(json.decode(source));
@override
String toString() =>
'Provinces(CityCode: $CityCode, CityName: $CityName, ID: $ID)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is Provinces &&
other.CityCode == CityCode &&
other.CityName == CityName &&
other.ID == ID;
}
@override
int get hashCode => CityCode.hashCode ^ CityName.hashCode ^ ID.hashCode;
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/town.dart
|
import 'dart:convert';
class Town{
final String Code;
final String Description;
Town({
required this.Code,
required this.Description,
});
Town copyWith({
String? Code,
String? Description,
}) {
return Town(
Code: Code ?? this.Code,
Description: Description ?? this.Description,
);
}
Map<String, dynamic> toMap() {
return {
'Code': Code,
'Description': Description,
};
}
factory Town.fromMap(Map<String, dynamic> map) {
return Town(
Code: map['Code'].toString(),
Description: map['Description'].toString(),
);
}
String toJson() => json.encode(toMap());
factory Town.fromJson(String source) =>
Town.fromMap(json.decode(source));
@override
String toString() =>
'Town(Code: $Code, Description: $Description)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is Town &&
other.Code == Code &&
other.Description == Description;
}
@override
int get hashCode =>
Code.hashCode ^ Description.hashCode;
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/avenuestreet.dart
|
import 'dart:convert';
class Avenuestreet{
final String Code;
final String Description;
Avenuestreet({
required this.Code,
required this.Description,
});
Avenuestreet copyWith({
String? Code,
String? Description,
}) {
return Avenuestreet(
Code: Code ?? this.Code,
Description: Description ?? this.Description,
);
}
Map<String, dynamic> toMap() {
return {
'Code': Code,
'Description': Description,
};
}
factory Avenuestreet.fromMap(Map<String, dynamic> map) {
return Avenuestreet(
Code: map['Code'].toString(),
Description: map['Description'].toString(),
);
}
String toJson() => json.encode(toMap());
factory Avenuestreet.fromJson(String source) =>
Avenuestreet.fromMap(json.decode(source));
@override
String toString() =>
'Avenuestreet(Code: $Code, Description: $Description)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is Avenuestreet &&
other.Code == Code &&
other.Description == Description;
}
@override
int get hashCode =>
Code.hashCode ^ Description.hashCode;
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/login.dart
|
class Login {
String username;
String password;
Login({
required this.username,
required this.password,
});
Map<String, dynamic> toJson() {
return {
'Username': username,
'password': password,
};
}
factory Login.fromJson(Map<String, dynamic> map) {
return Login(
username: map['Username'],
password: map['password'],
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/dijipol_error.dart
|
class AcenteError implements Exception {
final String message;
final int httpStatusCode;
final String errorCode;
AcenteError({
required this.message,
required this.httpStatusCode,
this.errorCode = "",
});
factory AcenteError.fromError(dynamic e) {
if(e is AcenteError) {
return e;
} else {
return AcenteError(message: e.toString(), httpStatusCode: -1, errorCode: "");
}
}
@override
String toString() => "AcenteError { message: $message, httpStatusCode: $httpStatusCode, errorCode: $errorCode }";
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/neighbourhood.dart
|
import 'dart:convert';
class Neighbourhood{
final String Code;
final String Description;
Neighbourhood({
required this.Code,
required this.Description,
});
Neighbourhood copyWith({
String? Code,
String? Description,
}) {
return Neighbourhood(
Code: Code ?? this.Code,
Description: Description ?? this.Description,
);
}
Map<String, dynamic> toMap() {
return {
'Code': Code,
'Description': Description,
};
}
factory Neighbourhood.fromMap(Map<String, dynamic> map) {
return Neighbourhood(
Code: map['Code'].toString(),
Description: map['Description'].toString(),
);
}
String toJson() => json.encode(toMap());
factory Neighbourhood.fromJson(String source) =>
Neighbourhood.fromMap(json.decode(source));
@override
String toString() =>
'Neighbourhood(Code: $Code, Description: $Description)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is Neighbourhood &&
other.Code == Code &&
other.Description == Description;
}
@override
int get hashCode =>
Code.hashCode ^ Description.hashCode;
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/signup.dart
|
class Signup {
String name;
String surname;
String identityNumber;
String eMail;
String telephoneNumber;
String password;
Signup({
required this.name,
required this.surname,
required this.identityNumber,
required this.eMail,
required this.telephoneNumber,
required this.password,
});
Map<String, dynamic> toJson() {
return {
'name': name,
'surname': surname,
'identityNumber': identityNumber,
'eMail': eMail,
'telephoneNumber': telephoneNumber,
'password': password,
};
}
factory Signup.fromJson(Map<String, dynamic> map) {
return Signup(
name: map['name'],
surname: map['surname'],
identityNumber: map['identityNumber'],
eMail: map['eMail'],
telephoneNumber: map['telephoneNumber'],
password: map['password'],
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/models/user_details.dart
|
import 'dart:convert';
import 'package:flutter/foundation.dart';
class UserDetails {
final int? Id;
final String? UserType;
final String? Username;
final String? Name;
final String? Surname;
final String? Gsm;
final String? NationalID;
final String? Email;
final String? Birthday;
final String? Password;
final String? CurrentToken;
final String? SessionToken;
final String? TokenID;
final String? IEToken;
final int? FirmTypeId;
final String? FirmTypeName;
final String? IPAddress;
final bool? EMailCampaign;
final String? PasswordExpireDate;
final String? ProfilePicture;
final bool? DesktopUser;
final bool? SmsCampaign;
final String? TokenExpires;
final int? FirmID;
final int? BranchID;
final String? IETokenExpires;
final int? SystemID;
final String? RegisterToMain;
final String? AgreementDate;
final bool? SmsApproved;
final String? SmsActivationCode;
final String? SmsApproveDate;
final String? LastSmsSent;
final String? CityCode;
final String? County;
final String? Latitude;
final String? Longitude;
final String? CountyCode;
final String? IsGuest;
final String? PrivacyAgreement;
final bool? TemporaryActiveUser;
final bool? IsTemporaryActive;
final String? TemporaryReleaseTime;
final List<dynamic>? UserAuthorizations;
final bool? CanUseReferenceScreen;
final bool? Success;
final int? TotalCredits;
final int? CreditsLeft;
final String? CanSeeLocations;
final String? CurrentIPAddress;
final bool? CanManageDijipol;
final bool? CanEnterPortal;
final bool? CanCreatePoll;
final String? ProfessionCode;
final String? mailgun_access_token;
final bool? CanUseApi;
final bool? IsDesktop;
final String? Source;
final List<BranchAuthentication>? BranchAuthentications;
UserDetails({
required this.Id,
required this.UserType,
required this.Username,
required this.Name,
required this.Surname,
required this.Gsm,
required this.NationalID,
required this.Email,
required this.Birthday,
required this.Password,
required this.CurrentToken,
required this.SessionToken,
required this.TokenID,
required this.IEToken,
required this.FirmTypeId,
required this.FirmTypeName,
required this.IPAddress,
required this.EMailCampaign,
required this.PasswordExpireDate,
required this.ProfilePicture,
required this.DesktopUser,
required this.SmsCampaign,
required this.TokenExpires,
required this.FirmID,
required this.BranchID,
required this.IETokenExpires,
required this.SystemID,
required this.RegisterToMain,
required this.AgreementDate,
required this.SmsApproved,
required this.SmsActivationCode,
required this.SmsApproveDate,
required this.LastSmsSent,
required this.CityCode,
required this.County,
required this.Latitude,
required this.Longitude,
required this.CountyCode,
required this.IsGuest,
required this.PrivacyAgreement,
required this.TemporaryActiveUser,
required this.IsTemporaryActive,
required this.TemporaryReleaseTime,
required this.UserAuthorizations,
required this.CanUseReferenceScreen,
required this.Success,
required this.TotalCredits,
required this.CreditsLeft,
required this.CanSeeLocations,
required this.CurrentIPAddress,
required this.CanManageDijipol,
required this.CanEnterPortal,
required this.CanCreatePoll,
required this.ProfessionCode,
required this.mailgun_access_token,
required this.CanUseApi,
required this.IsDesktop,
required this.Source,
required this.BranchAuthentications,
});
UserDetails copyWith({
int? Id,
String? UserType,
String? Username,
String? Name,
String? Surname,
String? Gsm,
String? NationalID,
String? Email,
String? Birthday,
String? Password,
String? CurrentToken,
String? SessionToken,
String? TokenID,
String? IEToken,
int? FirmTypeId,
String? FirmTypeName,
String? IPAddress,
bool? EMailCampaign,
String? PasswordExpireDate,
String? ProfilePicture,
bool? DesktopUser,
bool? SmsCampaign,
String? TokenExpires,
int? FirmID,
int? BranchID,
String? IETokenExpires,
int? SystemID,
String? RegisterToMain,
String? AgreementDate,
bool? SmsApproved,
String? SmsActivationCode,
String? SmsApproveDate,
String? LastSmsSent,
String? CityCode,
String? County,
String? Latitude,
String? Longitude,
String? CountyCode,
String? IsGuest,
String? PrivacyAgreement,
bool? TemporaryActiveUser,
bool? IsTemporaryActive,
String? TemporaryReleaseTime,
List<dynamic>? UserAuthorizations,
bool? CanUseReferenceScreen,
bool? Success,
int? TotalCredits,
int? CreditsLeft,
String? CanSeeLocations,
String? CurrentIPAddress,
bool? CanManageDijipol,
bool? CanEnterPortal,
bool? CanCreatePoll,
String? ProfessionCode,
String? mailgun_access_token,
bool? CanUseApi,
bool? IsDesktop,
String? Source,
List<BranchAuthentication>? BranchAuthentications,
}) {
return UserDetails(
Id: Id ?? this.Id,
UserType: UserType ?? this.UserType,
Username: Username ?? this.Username,
Name: Name ?? this.Name,
Surname: Surname ?? this.Surname,
Gsm: Gsm ?? this.Gsm,
NationalID: NationalID ?? this.NationalID,
Email: Email ?? this.Email,
Birthday: Birthday ?? this.Birthday,
Password: Password ?? this.Password,
CurrentToken: CurrentToken ?? this.CurrentToken,
SessionToken: SessionToken ?? this.SessionToken,
TokenID: TokenID ?? this.TokenID,
IEToken: IEToken ?? this.IEToken,
FirmTypeId: FirmTypeId ?? this.FirmTypeId,
FirmTypeName: FirmTypeName ?? this.FirmTypeName,
IPAddress: IPAddress ?? this.IPAddress,
EMailCampaign: EMailCampaign ?? this.EMailCampaign,
PasswordExpireDate: PasswordExpireDate ?? this.PasswordExpireDate,
ProfilePicture: ProfilePicture ?? this.ProfilePicture,
DesktopUser: DesktopUser ?? this.DesktopUser,
SmsCampaign: SmsCampaign ?? this.SmsCampaign,
TokenExpires: TokenExpires ?? this.TokenExpires,
FirmID: FirmID ?? this.FirmID,
BranchID: BranchID ?? this.BranchID,
IETokenExpires: IETokenExpires ?? this.IETokenExpires,
SystemID: SystemID ?? this.SystemID,
RegisterToMain: RegisterToMain ?? this.RegisterToMain,
AgreementDate: AgreementDate ?? this.AgreementDate,
SmsApproved: SmsApproved ?? this.SmsApproved,
SmsActivationCode: SmsActivationCode ?? this.SmsActivationCode,
SmsApproveDate: SmsApproveDate ?? this.SmsApproveDate,
LastSmsSent: LastSmsSent ?? this.LastSmsSent,
CityCode: CityCode ?? this.CityCode,
County: County ?? this.County,
Latitude: Latitude ?? this.Latitude,
Longitude: Longitude ?? this.Longitude,
CountyCode: CountyCode ?? this.CountyCode,
IsGuest: IsGuest ?? this.IsGuest,
PrivacyAgreement: PrivacyAgreement ?? this.PrivacyAgreement,
TemporaryActiveUser: TemporaryActiveUser ?? this.TemporaryActiveUser,
IsTemporaryActive: IsTemporaryActive ?? this.IsTemporaryActive,
TemporaryReleaseTime: TemporaryReleaseTime ?? this.TemporaryReleaseTime,
UserAuthorizations: UserAuthorizations ?? this.UserAuthorizations,
CanUseReferenceScreen: CanUseReferenceScreen ?? this.CanUseReferenceScreen,
Success: Success ?? this.Success,
TotalCredits: TotalCredits ?? this.TotalCredits,
CreditsLeft: CreditsLeft ?? this.CreditsLeft,
CanSeeLocations: CanSeeLocations ?? this.CanSeeLocations,
CurrentIPAddress: CurrentIPAddress ?? this.CurrentIPAddress,
CanManageDijipol: CanManageDijipol ?? this.CanManageDijipol,
CanEnterPortal: CanEnterPortal ?? this.CanEnterPortal,
CanCreatePoll: CanCreatePoll ?? this.CanCreatePoll,
ProfessionCode: ProfessionCode ?? this.ProfessionCode,
mailgun_access_token: mailgun_access_token ?? this.mailgun_access_token,
CanUseApi: CanUseApi ?? this.CanUseApi,
IsDesktop: IsDesktop ?? this.IsDesktop,
Source: Source ?? this.Source,
BranchAuthentications: BranchAuthentications ?? this.BranchAuthentications,
);
}
Map<String, dynamic> toMap() {
return {
'Id': Id,
'UserType': UserType,
'Username': Username,
'Name': Name,
'Surname': Surname,
'Gsm': Gsm,
'NationalID': NationalID,
'Email': Email,
'Birthday': Birthday,
'Password': Password,
'CurrentToken': CurrentToken,
'SessionToken': SessionToken,
'TokenID': TokenID,
'IEToken': IEToken,
'FirmTypeId': FirmTypeId,
'FirmTypeName': FirmTypeName,
'IPAddress': IPAddress,
'EMailCampaign': EMailCampaign,
'PasswordExpireDate': PasswordExpireDate,
'ProfilePicture': ProfilePicture,
'DesktopUser': DesktopUser,
'SmsCampaign': SmsCampaign,
'TokenExpires': TokenExpires,
'FirmID': FirmID,
'BranchID': BranchID,
'IETokenExpires': IETokenExpires,
'SystemID': SystemID,
'RegisterToMain': RegisterToMain,
'AgreementDate': AgreementDate,
'SmsApproved': SmsApproved,
'SmsActivationCode': SmsActivationCode,
'SmsApproveDate': SmsApproveDate,
'LastSmsSent': LastSmsSent,
'CityCode': CityCode,
'County': County,
'Latitude': Latitude,
'Longitude': Longitude,
'CountyCode': CountyCode,
'IsGuest': IsGuest,
'PrivacyAgreement': PrivacyAgreement,
'TemporaryActiveUser': TemporaryActiveUser,
'IsTemporaryActive': IsTemporaryActive,
'TemporaryReleaseTime': TemporaryReleaseTime,
'UserAuthorizations': UserAuthorizations,
'CanUseReferenceScreen': CanUseReferenceScreen,
'Success': Success,
'TotalCredits': TotalCredits,
'CreditsLeft': CreditsLeft,
'CanSeeLocations': CanSeeLocations,
'CurrentIPAddress': CurrentIPAddress,
'CanManageDijipol': CanManageDijipol,
'CanEnterPortal': CanEnterPortal,
'CanCreatePoll': CanCreatePoll,
'ProfessionCode': ProfessionCode,
'mailgun_access_token': mailgun_access_token,
'CanUseApi': CanUseApi,
'IsDesktop': IsDesktop,
'Source': Source,
'BranchAuthentications': BranchAuthentications?.map((x) => x.toMap()).toList(),
};
}
factory UserDetails.fromMap(Map<String, dynamic> map) {
return UserDetails(
Id: map['Id']?.toInt(),
UserType: map['UserType'],
Username: map['Username'],
Name: map['Name'],
Surname: map['Surname'],
Gsm: map['Gsm'],
NationalID: map['NationalID'],
Email: map['Email'],
Birthday: map['Birthday'],
Password: map['Password'],
CurrentToken: map['CurrentToken'],
SessionToken: map['SessionToken'],
TokenID: map['TokenID'],
IEToken: map['IEToken'],
FirmTypeId: map['FirmTypeId']?.toInt(),
FirmTypeName: map['FirmTypeName'],
IPAddress: map['IPAddress'],
EMailCampaign: map['EMailCampaign'],
PasswordExpireDate: map['PasswordExpireDate'],
ProfilePicture: map['ProfilePicture'],
DesktopUser: map['DesktopUser'],
SmsCampaign: map['SmsCampaign'],
TokenExpires: map['TokenExpires'],
FirmID: map['FirmID']?.toInt(),
BranchID: map['BranchID']?.toInt(),
IETokenExpires: map['IETokenExpires'],
SystemID: map['SystemID']?.toInt(),
RegisterToMain: map['RegisterToMain'],
AgreementDate: map['AgreementDate'],
SmsApproved: map['SmsApproved'],
SmsActivationCode: map['SmsActivationCode'],
SmsApproveDate: map['SmsApproveDate'],
LastSmsSent: map['LastSmsSent'],
CityCode: map['CityCode'],
County: map['County'],
Latitude: map['Latitude'],
Longitude: map['Longitude'],
CountyCode: map['CountyCode'],
IsGuest: map['IsGuest'],
PrivacyAgreement: map['PrivacyAgreement'],
TemporaryActiveUser: map['TemporaryActiveUser'],
IsTemporaryActive: map['IsTemporaryActive'],
TemporaryReleaseTime: map['TemporaryReleaseTime'],
UserAuthorizations: List<dynamic>.from(map['UserAuthorizations']),
CanUseReferenceScreen: map['CanUseReferenceScreen'],
Success: map['Success'],
TotalCredits: map['TotalCredits']?.toInt(),
CreditsLeft: map['CreditsLeft']?.toInt(),
CanSeeLocations: map['CanSeeLocations'],
CurrentIPAddress: map['CurrentIPAddress'],
CanManageDijipol: map['CanManageDijipol'],
CanEnterPortal: map['CanEnterPortal'],
CanCreatePoll: map['CanCreatePoll'],
ProfessionCode: map['ProfessionCode'],
mailgun_access_token: map['mailgun_access_token'],
CanUseApi: map['CanUseApi'],
IsDesktop: map['IsDesktop'],
Source: map['Source'],
BranchAuthentications: List<BranchAuthentication>.from(map['BranchAuthentications']?.map((x) => BranchAuthentication.fromMap(x))),
);
}
String toJson() => json.encode(toMap());
factory UserDetails.fromJson(String source) => UserDetails.fromMap(json.decode(source));
@override
String toString() {
return 'UserDetails(Id: $Id, UserType: $UserType, Username: $Username, Name: $Name, Surname: $Surname, Gsm: $Gsm, NationalID: $NationalID, Email: $Email, Birthday: $Birthday, Password: $Password, CurrentToken: $CurrentToken, SessionToken: $SessionToken, TokenID: $TokenID, IEToken: $IEToken, FirmTypeId: $FirmTypeId, FirmTypeName: $FirmTypeName, IPAddress: $IPAddress, EMailCampaign: $EMailCampaign, PasswordExpireDate: $PasswordExpireDate, ProfilePicture: $ProfilePicture, DesktopUser: $DesktopUser, SmsCampaign: $SmsCampaign, TokenExpires: $TokenExpires, FirmID: $FirmID, BranchID: $BranchID, IETokenExpires: $IETokenExpires, SystemID: $SystemID, RegisterToMain: $RegisterToMain, AgreementDate: $AgreementDate, SmsApproved: $SmsApproved, SmsActivationCode: $SmsActivationCode, SmsApproveDate: $SmsApproveDate, LastSmsSent: $LastSmsSent, CityCode: $CityCode, County: $County, Latitude: $Latitude, Longitude: $Longitude, CountyCode: $CountyCode, IsGuest: $IsGuest, PrivacyAgreement: $PrivacyAgreement, TemporaryActiveUser: $TemporaryActiveUser, IsTemporaryActive: $IsTemporaryActive, TemporaryReleaseTime: $TemporaryReleaseTime, UserAuthorizations: $UserAuthorizations, CanUseReferenceScreen: $CanUseReferenceScreen, Success: $Success, TotalCredits: $TotalCredits, CreditsLeft: $CreditsLeft, CanSeeLocations: $CanSeeLocations, CurrentIPAddress: $CurrentIPAddress, CanManageDijipol: $CanManageDijipol, CanEnterPortal: $CanEnterPortal, CanCreatePoll: $CanCreatePoll, ProfessionCode: $ProfessionCode, mailgun_access_token: $mailgun_access_token, CanUseApi: $CanUseApi, IsDesktop: $IsDesktop, Source: $Source, BranchAuthentications: $BranchAuthentications)';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is UserDetails &&
other.Id == Id &&
other.UserType == UserType &&
other.Username == Username &&
other.Name == Name &&
other.Surname == Surname &&
other.Gsm == Gsm &&
other.NationalID == NationalID &&
other.Email == Email &&
other.Birthday == Birthday &&
other.Password == Password &&
other.CurrentToken == CurrentToken &&
other.SessionToken == SessionToken &&
other.TokenID == TokenID &&
other.IEToken == IEToken &&
other.FirmTypeId == FirmTypeId &&
other.FirmTypeName == FirmTypeName &&
other.IPAddress == IPAddress &&
other.EMailCampaign == EMailCampaign &&
other.PasswordExpireDate == PasswordExpireDate &&
other.ProfilePicture == ProfilePicture &&
other.DesktopUser == DesktopUser &&
other.SmsCampaign == SmsCampaign &&
other.TokenExpires == TokenExpires &&
other.FirmID == FirmID &&
other.BranchID == BranchID &&
other.IETokenExpires == IETokenExpires &&
other.SystemID == SystemID &&
other.RegisterToMain == RegisterToMain &&
other.AgreementDate == AgreementDate &&
other.SmsApproved == SmsApproved &&
other.SmsActivationCode == SmsActivationCode &&
other.SmsApproveDate == SmsApproveDate &&
other.LastSmsSent == LastSmsSent &&
other.CityCode == CityCode &&
other.County == County &&
other.Latitude == Latitude &&
other.Longitude == Longitude &&
other.CountyCode == CountyCode &&
other.IsGuest == IsGuest &&
other.PrivacyAgreement == PrivacyAgreement &&
other.TemporaryActiveUser == TemporaryActiveUser &&
other.IsTemporaryActive == IsTemporaryActive &&
other.TemporaryReleaseTime == TemporaryReleaseTime &&
listEquals(other.UserAuthorizations, UserAuthorizations) &&
other.CanUseReferenceScreen == CanUseReferenceScreen &&
other.Success == Success &&
other.TotalCredits == TotalCredits &&
other.CreditsLeft == CreditsLeft &&
other.CanSeeLocations == CanSeeLocations &&
other.CurrentIPAddress == CurrentIPAddress &&
other.CanManageDijipol == CanManageDijipol &&
other.CanEnterPortal == CanEnterPortal &&
other.CanCreatePoll == CanCreatePoll &&
other.ProfessionCode == ProfessionCode &&
other.mailgun_access_token == mailgun_access_token &&
other.CanUseApi == CanUseApi &&
other.IsDesktop == IsDesktop &&
other.Source == Source &&
listEquals(other.BranchAuthentications, BranchAuthentications);
}
@override
int get hashCode {
return Id.hashCode ^
UserType.hashCode ^
Username.hashCode ^
Name.hashCode ^
Surname.hashCode ^
Gsm.hashCode ^
NationalID.hashCode ^
Email.hashCode ^
Birthday.hashCode ^
Password.hashCode ^
CurrentToken.hashCode ^
SessionToken.hashCode ^
TokenID.hashCode ^
IEToken.hashCode ^
FirmTypeId.hashCode ^
FirmTypeName.hashCode ^
IPAddress.hashCode ^
EMailCampaign.hashCode ^
PasswordExpireDate.hashCode ^
ProfilePicture.hashCode ^
DesktopUser.hashCode ^
SmsCampaign.hashCode ^
TokenExpires.hashCode ^
FirmID.hashCode ^
BranchID.hashCode ^
IETokenExpires.hashCode ^
SystemID.hashCode ^
RegisterToMain.hashCode ^
AgreementDate.hashCode ^
SmsApproved.hashCode ^
SmsActivationCode.hashCode ^
SmsApproveDate.hashCode ^
LastSmsSent.hashCode ^
CityCode.hashCode ^
County.hashCode ^
Latitude.hashCode ^
Longitude.hashCode ^
CountyCode.hashCode ^
IsGuest.hashCode ^
PrivacyAgreement.hashCode ^
TemporaryActiveUser.hashCode ^
IsTemporaryActive.hashCode ^
TemporaryReleaseTime.hashCode ^
UserAuthorizations.hashCode ^
CanUseReferenceScreen.hashCode ^
Success.hashCode ^
TotalCredits.hashCode ^
CreditsLeft.hashCode ^
CanSeeLocations.hashCode ^
CurrentIPAddress.hashCode ^
CanManageDijipol.hashCode ^
CanEnterPortal.hashCode ^
CanCreatePoll.hashCode ^
ProfessionCode.hashCode ^
mailgun_access_token.hashCode ^
CanUseApi.hashCode ^
IsDesktop.hashCode ^
Source.hashCode ^
BranchAuthentications.hashCode;
}
}
class BranchAuthentication {
final int? BranchId;
final int? QueryTypeId;
final bool? IsAuth;
final String? CreateDate;
final String? QueryType;
BranchAuthentication({
required this.BranchId,
required this.QueryTypeId,
required this.IsAuth,
required this.CreateDate,
required this.QueryType,
});
BranchAuthentication copyWith({
int? BranchId,
int? QueryTypeId,
bool? IsAuth,
String? CreateDate,
String? QueryType,
}) {
return BranchAuthentication(
BranchId: BranchId ?? this.BranchId,
QueryTypeId: QueryTypeId ?? this.QueryTypeId,
IsAuth: IsAuth ?? this.IsAuth,
CreateDate: CreateDate ?? this.CreateDate,
QueryType: QueryType ?? this.QueryType,
);
}
Map<String, dynamic> toMap() {
return {
'BranchId': BranchId,
'QueryTypeId': QueryTypeId,
'IsAuth': IsAuth,
'CreateDate': CreateDate,
'QueryType': QueryType,
};
}
factory BranchAuthentication.fromMap(Map<String, dynamic> map) {
return BranchAuthentication(
BranchId: map['BranchId']?.toInt(),
QueryTypeId: map['QueryTypeId']?.toInt(),
IsAuth: map['IsAuth'],
CreateDate: map['CreateDate'],
QueryType: map['QueryType'],
);
}
String toJson() => json.encode(toMap());
factory BranchAuthentication.fromJson(String source) => BranchAuthentication.fromMap(json.decode(source));
@override
String toString() {
return 'BranchAuthentication(BranchId: $BranchId, QueryTypeId: $QueryTypeId, IsAuth: $IsAuth, CreateDate: $CreateDate, QueryType: $QueryType)';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is BranchAuthentication &&
other.BranchId == BranchId &&
other.QueryTypeId == QueryTypeId &&
other.IsAuth == IsAuth &&
other.CreateDate == CreateDate &&
other.QueryType == QueryType;
}
@override
int get hashCode {
return BranchId.hashCode ^
QueryTypeId.hashCode ^
IsAuth.hashCode ^
CreateDate.hashCode ^
QueryType.hashCode;
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/avenuestreet_repositoy.dart
|
import 'dart:convert';
import 'dart:io';
import 'package:dijipol/data/models/avenuestreet.dart';
import 'package:http/http.dart' as http;
class AvenuestreetRepository{
Future<List<Avenuestreet>> avenuestreet({
required String neighborhoodId,
}) async {
final body =
'NeighborhoodId=$neighborhoodId&AccessToken=9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE&Source=dijipol';
print(body);
final response = await http.post(
Uri.parse("https://appfck.acente365.com/api/dask/caddesokak/"),
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: body);
print(response.body);
print(response.statusCode);
if (response.statusCode >= 200 && response.statusCode < 300) {
final rslt = json.decode(response.body) as List;
return rslt.map((e) => Avenuestreet.fromMap(e)).toList();
} else {
final rslt = json.decode(response.body);
throw HttpException(rslt['Message'] ?? response.reasonPhrase);
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/login_repository.dart
|
import 'package:dijipol/data/models/login.dart';
import 'package:http/http.dart' as http;
class LoginRepository {
final baseUrl = "https://bnapi.acente365.com/api";
Future login(Login login) async {
try {
var headers = {'Content-Type': 'application/x-www-form-urlencoded'};
var request = http.Request(
'POST', Uri.parse('https://bnapi.acente365.com/api/login'));
request.bodyFields = {
'AccessToken':
'9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE',
'Source': 'dijipol',
'Username': login.username,
'Password': login.password,
};
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
print(response);
// if (response.statusCode == 200) {
var rslt = await response.stream.bytesToString();
print(rslt);
return rslt;
//}
// else {
// print(response.reasonPhrase);
// }
} catch (e) {
print(e);
return [];
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/signup_repository.dart
|
import 'dart:convert';
import 'package:dijipol/data/models/signup.dart';
import 'package:http/http.dart' as http;
class SignupRepository {
final baseUrl = "https://bnapi.acente365.com/api";
Future signUp(Signup signup) async {
try {
var headers = {'Content-Type': 'application/x-www-form-urlencoded'};
var request = http.Request(
'POST', Uri.parse('https://appfck.acente365.com/api/musteri/uyeol'));
request.bodyFields = {
'AccessToken':
'9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE',
'Source': 'dijipol',
'Email': signup.eMail,
'NationalNumber': signup.identityNumber,
'Name': signup.name,
'Password': signup.password,
'Phone': signup.telephoneNumber,
'Surname': signup.surname,
'CurrentIPAddress': '127.0.0.1'
};
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
print(response);
// if (response.statusCode == 200) {
var rslt = await response.stream.bytesToString();
print(rslt);
return rslt;
//}
// else {
// print(response.reasonPhrase);
// }
} catch (e) {
print(e);
return [];
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/neighbourhood_repository.dart
|
import 'dart:convert';
import 'dart:io';
import 'package:dijipol/data/models/neighbourhood.dart';
import 'package:http/http.dart' as http;
class NeighbourhoodRepository{
Future<List<Neighbourhood>> neighbourhood({
required String townId,
}) async {
final body =
'TownId=$townId&AccessToken=9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE&Source=dijipol';
print(body);
final response = await http.post(
Uri.parse("https://appfck.acente365.com/api/dask/mahalle/"),
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: body);
print(response.body);
print(response.statusCode);
if (response.statusCode >= 200 && response.statusCode < 300) {
final rslt = json.decode(response.body) as List;
return rslt.map((e) => Neighbourhood.fromMap(e)).toList();
} else {
final rslt = json.decode(response.body);
throw HttpException(rslt['Message'] ?? response.reasonPhrase);
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/buildingNumber_repository.dart
|
import 'dart:convert';
import 'dart:io';
import 'package:dijipol/data/models/buildingNumber.dart';
import 'package:http/http.dart' as http;
class BuildingNumberRepository{
Future<List<BuildingNumber>> buildingNumber({
required String roadAndStreetId,
}) async {
final body =
'RoadAndStreetId=$roadAndStreetId&AccessToken=9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE&Source=dijipol';
print(body);
final response = await http.post(
Uri.parse("https://appfck.acente365.com/api/dask/binakodlari/"),
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: body);
print(response.body);
print(response.statusCode);
if (response.statusCode >= 200 && response.statusCode < 300) {
final rslt = json.decode(response.body) as List;
return rslt.map((e) => BuildingNumber.fromMap(e)).toList();
} else {
final rslt = json.decode(response.body);
throw HttpException(rslt['Message'] ?? response.reasonPhrase);
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/provinces_repository.dart
|
import 'dart:convert';
import 'dart:io';
import 'package:dijipol/data/models/provinces.dart';
import 'package:http/http.dart' as http;
class ProvincesRepository {
Future<List<Provinces>> provinces() async {
final body =
'AccessToken=9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE';
print(body);
final response = await http.post(
Uri.parse("https://appfck.acente365.com/api/dask/iller"),
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: body);
print(response.body);
print(response.statusCode);
if (response.statusCode >= 200 && response.statusCode < 300) {
final List rslt = json.decode(response.body) as List;
return rslt.map((e) => Provinces.fromMap(e)).toList();
} else {
final rslt = json.decode(response.body);
throw HttpException(rslt['Message'] ?? response.reasonPhrase);
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/town_repository.dart
|
import 'dart:convert';
import 'dart:io';
import 'package:dijipol/data/models/town.dart';
import 'package:http/http.dart' as http;
class TownRepository{
Future<List<Town>> town({
required String countyId,
}) async {
final body =
'CountyId=$countyId&AccessToken=9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE&Source=dijipol';
print(body);
final response = await http.post(
Uri.parse("https://appfck.acente365.com/api/dask/beldeler/"),
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: body);
print(response.body);
print(response.statusCode);
if (response.statusCode >= 200 && response.statusCode < 300) {
final rslt = json.decode(response.body) as List;
return rslt.map((e) => Town.fromMap(e)).toList();
} else {
final rslt = json.decode(response.body);
throw HttpException(rslt['Message'] ?? response.reasonPhrase);
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/data
|
mirrored_repositories/Dijipol/lib/data/repositories/district_repository.dart
|
import 'dart:convert';
import 'dart:io';
import 'package:dijipol/data/models/district.dart';
import 'package:http/http.dart' as http;
class DistrictRepository{
Future<List<District>> districts({
required String citycode,
}) async {
final body =
'CityCode=$citycode&AccessToken=9A2754A2886AF16C2849582998F19EB5DB84E22DEC2161A8679A5CF2928G43DE&Source=dijipol';
print(body);
final response = await http.post(
Uri.parse("https://appfck.acente365.com/api/dask/ilceler/"),
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: body);
print(response.body);
print(response.statusCode);
if (response.statusCode >= 200 && response.statusCode < 300) {
final rslt = json.decode(response.body) as List;
return rslt.map((e) => District.fromMap(e)).toList();
} else {
final rslt = json.decode(response.body);
throw HttpException(rslt['Message'] ?? response.reasonPhrase);
}
}
}
| 0
|
mirrored_repositories/Dijipol/lib/logic/cubits
|
mirrored_repositories/Dijipol/lib/logic/cubits/login_cubit/login_cubit.dart
|
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:dijipol/data/models/login.dart';
import 'package:dijipol/data/repositories/login_repository.dart';
import 'package:meta/meta.dart';
part 'login_state.dart';
class LoginCubit extends Cubit<LoginState> {
final LoginRepository repository;
LoginCubit({required this.repository}) : super(LoginInitial());
void login(Login login){
emit(LoginLoading());
Timer(Duration(seconds: 2), () {
repository.login(login).then((result){
if(result['Success']){
emit(LoginSuccess());
}
});
});
}
}
| 0
|
mirrored_repositories/Dijipol/lib/logic/cubits
|
mirrored_repositories/Dijipol/lib/logic/cubits/login_cubit/login_state.dart
|
part of 'login_cubit.dart';
@immutable
abstract class LoginState {}
class LoginInitial extends LoginState {}
class LoginError extends LoginState {
String error;
LoginError({
required this.error,
});
}
class LoginLoading extends LoginState{
}
class LoginSuccess extends LoginState{
}
| 0
|
mirrored_repositories/Dijipol/lib/logic/cubits
|
mirrored_repositories/Dijipol/lib/logic/cubits/signup_cubit/signup_cubit.dart
|
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:dijipol/data/models/signup.dart';
import 'package:dijipol/data/repositories/signup_repository.dart';
import 'package:meta/meta.dart';
part './signup_state.dart';
class SignupCubit extends Cubit<SignupState> {
final SignupRepository repository;
SignupCubit({required this.repository}) : super(SignupInitial());
void signup(Signup signup) {
emit(SignupLoading());
Timer(Duration(seconds: 2), () {
repository.signUp(signup).then((result){
if(result['Success']){
emit(SignupSuccess());
}
});
});
}
}
| 0
|
mirrored_repositories/Dijipol/lib/logic/cubits
|
mirrored_repositories/Dijipol/lib/logic/cubits/signup_cubit/signup_state.dart
|
part of 'signup_cubit.dart';
@immutable
abstract class SignupState {}
class SignupInitial extends SignupState {}
class SignupError extends SignupState {
String error;
SignupError({
required this.error,
});
}
class SignupLoading extends SignupState{
}
class SignupSuccess extends SignupState{
}
| 0
|
mirrored_repositories/Dijipol/lib/logic/cubits
|
mirrored_repositories/Dijipol/lib/logic/cubits/auth_cubit/auth_cubit.dart
|
import 'package:bloc/bloc.dart';
import 'package:dijipol/data/models/dijipol_error.dart';
import 'package:dijipol/data/models/user_details.dart';
import 'package:meta/meta.dart';
part 'auth_state.dart';
class AuthCubit extends Cubit<AuthState> {
AuthCubit() : super(AuthState());
void authenticate(UserDetails userDetails){
emit(AuthState(userDetails: userDetails,authStatus: AuthStatus.authenticated));
}
void logout(){
emit(AuthState());
}
}
| 0
|
mirrored_repositories/Dijipol/lib/logic/cubits
|
mirrored_repositories/Dijipol/lib/logic/cubits/auth_cubit/auth_state.dart
|
part of 'auth_cubit.dart';
enum AuthStatus {authenticated,unauthenticated}
class AuthState {
final UserDetails? userDetails;
final AuthStatus authStatus;
final AcenteError? acenteError;
AuthState({
this.userDetails,
this.authStatus = AuthStatus.unauthenticated,
this.acenteError,
});
AuthState copyWith({
UserDetails? userDetails,
AuthStatus? authStatus,
AcenteError? acenteError,
}) {
return AuthState(
userDetails: userDetails ?? this.userDetails,
authStatus: authStatus ?? this.authStatus,
acenteError: acenteError ?? this.acenteError,
);
}
@override
String toString() => 'AuthState(userDetails: $userDetails, authStatus: $authStatus, acenteError: $acenteError)';
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/widgets/app_button.dart
|
import 'package:flutter/material.dart';
class AppButton extends StatelessWidget {
const AppButton({
required this.text,
required this.onTap,
this.disabled = false,
this.enabled = true,
this.loading = false,
this.color,
this.textColor,
this.padding = const EdgeInsets.all(18),
this.fontSize,
this.fontWeight,
});
final void Function() onTap;
final String text;
final bool disabled; // changes background to grey
final bool enabled; // Just disables click
final bool loading;
final Color? color;
final Color? textColor;
final EdgeInsetsGeometry padding;
final double? fontSize;
final FontWeight? fontWeight;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: disabled || loading
? Theme.of(context).disabledColor
: color ?? Theme.of(context).primaryColor,
// borderRadius: BorderRadius.circular(200),
),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: !disabled && enabled && !loading ? onTap : null,
highlightColor: Colors.transparent,
child: Container(
padding: padding,
child: Center(
child: loading
? const SizedBox(
height: 24,
width: 24,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
)
: Text(
text,
style: TextStyle(
color: disabled || loading
? Colors.white
: textColor ?? Colors.white,
fontWeight: fontWeight ?? FontWeight.w700,
fontSize: fontSize ?? 18,
),
),
),
),
),
),
);
}
}
class AppButtonIcon extends StatelessWidget {
const AppButtonIcon({
required this.text,
required this.onTap,
this.disabled = false,
this.enabled = true,
this.loading = false,
this.color,
this.textColor,
this.padding = const EdgeInsets.all(18),
this.fontSize,
this.fontWeight,
required this.icon,
});
final void Function() onTap;
final String text;
final bool disabled; // changes background to grey
final bool enabled; // Just disables click
final bool loading;
final Color? color;
final Color? textColor;
final EdgeInsetsGeometry padding;
final double? fontSize;
final FontWeight? fontWeight;
final Icon icon;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: disabled || loading
? Theme.of(context).disabledColor
: color ?? Theme.of(context).primaryColor,
// borderRadius: BorderRadius.circular(200),
),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: !disabled && enabled && !loading ? onTap : null,
highlightColor: Colors.transparent,
child: Container(
padding: padding,
child: Center(
child: loading
? const SizedBox(
height: 24,
width: 24,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
)
: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
text,
style: TextStyle(
color: disabled || loading
? Colors.white
: textColor ?? Colors.white,
fontWeight: fontWeight ?? FontWeight.w700,
fontSize: fontSize ?? 18,
),
),
SizedBox(width: 15),
icon,
],
),
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/widgets/custom_icon.dart
|
import 'package:flutter/material.dart';
class CustomIcon extends StatelessWidget {
final String iconName;
final double? size;
const CustomIcon(
this.iconName, {
this.size,
});
@override
Widget build(BuildContext context) {
return SizedBox(
height: size ?? 24,
width: size ?? 24,
child: Image.asset(
'lib/assets/images/icons/$iconName.png',
fit: BoxFit.contain,
height: size ?? 24,
width: size ?? 24,
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/widgets/app_text_input.dart
|
import 'package:flutter/material.dart';
class AppTextInput extends StatelessWidget {
const AppTextInput({
this.label,
this.floatingLabel,
this.disabled = false,
this.enabled = true,
this.color,
this.labelColor,
this.fontSize,
this.labelFontWeight,
this.placeholder,
this.backgroundColor,
this.obscureText = false,
this.displayBorder = false,
this.customBorder,
this.prefixIcon,
this.suffixIcon,
this.leading,
this.trailing,
this.contentPadding,
this.keyboardType,
this.readOnly = false,
this.initialValue,
this.controller,
});
final String? label;
final String? floatingLabel;
final bool disabled; // changes background to grey
final bool enabled; // Just disables click
final Color? color;
final Color? labelColor;
final double? fontSize;
final FontWeight? labelFontWeight;
final String? placeholder;
final Color? backgroundColor;
final bool obscureText;
final bool displayBorder;
final Border? customBorder;
final Widget? prefixIcon;
final Widget? suffixIcon;
final Widget? leading;
final Widget? trailing;
final EdgeInsetsGeometry? contentPadding;
final TextInputType? keyboardType;
final bool readOnly;
final String? initialValue;
final TextEditingController? controller;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
if (label != null)
Text(
label!,
style: TextStyle(
color: labelColor ?? Theme.of(context).primaryColorDark,
fontWeight: labelFontWeight ?? FontWeight.w500,
fontSize: fontSize ?? 16,
),
),
if (label != null) const SizedBox(height: 10),
Container(
decoration: displayBorder
? BoxDecoration(
border: customBorder ??
Border.all(
width: 1,
color: const Color(0xFFe4e7ec),
),
color: const Color(0xfff1f3f5),
)
: const BoxDecoration(
color: Color(0xfff1f3f5),
),
child: Row(
children: <Widget>[
if (leading != null) leading!,
Expanded(
child: TextFormField(
obscureText: obscureText,
keyboardType: keyboardType,
readOnly: readOnly,
initialValue: initialValue,
decoration: InputDecoration(
labelText: floatingLabel,
hintText: placeholder,
border: InputBorder.none,
prefixIcon: prefixIcon,
suffixIcon: suffixIcon,
contentPadding: contentPadding ??
EdgeInsets.symmetric(
horizontal: 16,
vertical: floatingLabel == null ? 0 : 8,
),
),
controller: controller,
),
),
if (trailing != null) trailing!,
],
),
),
],
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/widgets/custom_widgets.dart
|
import 'package:flutter/material.dart';
import '../../presentation/utils/constant.dart';
import 'app_button.dart';
import 'app_text_input.dart';
class DualTextRow extends StatelessWidget {
final String text1;
final String text2;
DualTextRow({required this.text1, required this.text2});
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(height: 25),
Row(
children: [
Expanded(child: Text(text1,style: L14M)),
Text(text2,style: D14M),
],
),
SizedBox(height: 25),
Divider(height: 1),
],
);
}
}
class DualTextColumn extends StatelessWidget {
final String text1;
final String text2;
DualTextColumn({required this.text1, required this.text2});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(text1, style: D16B),
Text(text2, style: L16R),
SizedBox(
height: 15,
),
],
);
}
}
class CheckboxText extends StatelessWidget {
final String text;
final bool value;
final void Function(bool?) onChange;
CheckboxText({required this.text, required this.value ,required this.onChange});
@override
Widget build(BuildContext context) {
return Row(
children: <Widget>[
Checkbox(
value: value,
onChanged: onChange,
activeColor:
Theme.of(context).primaryColor,
),
Flexible(
child: Text(
text,
style: TextStyle(
color: Theme.of(context)
.primaryColorDark),
),
),
],
);
}
}
class ViewOffersItem extends StatelessWidget {
final String title;
final String subtitle;
final String installment;
final String subinstallment;
final void Function() onButtonTap;
final void Function(bool) onChange;
final bool switchvalue;
final Color bordercolor;
final bool headerVisible;
ViewOffersItem({
required this.title,
required this.subtitle,
required this.installment,
required this.subinstallment,
required this.onButtonTap,
required this.onChange,
required this.switchvalue,
required this.bordercolor,
this.headerVisible = false,
});
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
padding: EdgeInsets.all(12),
margin: EdgeInsets.only(top: 17),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: bordercolor,
),
),
child: Column(
children: [
SizedBox(height: 17),
Row(
children: [
Image.asset(
'lib/assets/images/Aklogo.png',
width: 115,
height: 57,
),
SizedBox(width: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: D16M,
),
SizedBox(height: 8),
Text(
subtitle,
style: D12R,
),
],
),
],
),
SizedBox(height: 9),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
installment,
style: L14M,
),
SizedBox(height: 2),
Text(
subinstallment,
style: P14M,
),
],
),
Spacer(),
AppButton(
text: 'Satın Al',
onTap: onButtonTap,
color: Color(0xFF1ab759),
padding: EdgeInsets.symmetric(horizontal: 33, vertical: 12),
),
],
),
SizedBox(height: 15),
Divider(color: Colors.black),
SizedBox(height: 10),
Row(
children: [
Text(
'Poliçe Detayı',
style: P12M,
),
Icon(
Icons.arrow_drop_down,
color: primaryColor,
),
Spacer(),
Text(
'Karşılaştır',
style: D10M,
),
SizedBox(width: 6),
Switch(value: switchvalue, onChanged: onChange),
],
)
],
),
),
if(headerVisible)
Positioned(
top: 0,
left: 16,
height: 34,
child: Container(
decoration: BoxDecoration(
color: primaryColor,
// borderRadius: BorderRadius.circular(200),
),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 18),
child: const Center(
child: Text(
'EN DÜŞÜK FİYAT',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 12,
),
),
),
),
),
),
],
);
}
}
class OffersItem extends StatelessWidget {
final Widget icon;
final String title;
final Color backColor;
const OffersItem(
{required this.title, required this.icon, required this.backColor});
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(
horizontal: 6,
vertical: 6,
),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
blurRadius: 15,
offset: Offset(0, 5),
color: Color(
0x29000000,
),
),
BoxShadow(
offset: const Offset(3, 3),
color: backColor,
),
],
),
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 18,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
icon,
],
),
SizedBox(
width: 9,
),
Flexible(
child: Column(
children: [
Text(
title,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
SizedBox(
height: 15,
),
RowValues(
text1: 'Teklif Sayısı',
text2: '13',
),
SizedBox(
height: 18,
),
RowValues(
text1: 'En Düşük',
text2: '1.311,25 TL',
),
SizedBox(
height: 18,
),
RowValues(
text1: 'Fiyat Avantajı',
text2: '%23',
),
SizedBox(
height: 23,
),
],
),
),
],
),
),
);
}
}
class OffersItem2 extends StatelessWidget {
final Widget icon;
final String title;
final Color backColor;
const OffersItem2(
{required this.title, required this.icon, required this.backColor});
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(
horizontal: 6,
vertical: 6,
),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
blurRadius: 15,
offset: Offset(0, 5),
color: Color(
0x29000000,
),
),
BoxShadow(
offset: const Offset(3, 3),
color: backColor,
),
],
),
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 18,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
SizedBox(
height: 50,
width: 50,
child: Stack(
children:const <Widget>[
Center(
child: SizedBox(
width: 58,
height: 58,
child: CircularProgressIndicator(
backgroundColor: primaryColor,
color: Color(0xFFbbc3cf),
value: 0.5,
),
),
),
Center(child: Text("%13",style: TextStyle(color: primaryColor),)),
],
),
),
],
),
SizedBox(
width: 9,
),
Flexible(
child: Column(
children: [
Text(
title,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
SizedBox(
height: 15,
),
RowValues2(
text1: 'Teklif Sayısı',
text2: '13',
color1: Colors.red,
),
SizedBox(
height: 18,
),
RowValues2(
text1: 'En Düşük',
text2: '1.311,25 TL',
color2: Colors.amber,
),
SizedBox(
height: 18,
),
RowValues2(
text1: 'Fiyat Avantajı',
text2: '%23',
color3: Colors.blue,
),
SizedBox(
height: 23,
),
],
),
),
],
),
),
);
}
}
class RowValues2 extends StatelessWidget {
final String text1;
final String text2;
final Color color1;
final Color color2;
final Color color3;
static const Color defaultcolor = Color(0xFFbbc3cf);
RowValues2({required this.text1, required this.text2, this.color1 = defaultcolor, this.color2 = defaultcolor, this.color3 = defaultcolor});
@override
Widget build(BuildContext context) {
return Row(
children: [
Text(
text1,
style: L12_R,
),
Spacer(),
Container(
width: 8,
height: 8,
color: color1,
),
SizedBox(width: 6),
Container(
width: 8,
height: 8,
color: color2,
),
SizedBox(width: 6),
Container(
width: 8,
height: 8,
color: color3,
),
SizedBox(width: 8),
Text(
text2,
style: D16B,
),
],
);
}
}
class RowValues extends StatelessWidget {
final String text1;
final String text2;
RowValues({required this.text1, required this.text2});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
text1,
style: L12_R,
),
Text(
text2,
style: D16B,
),
],
);
}
}
class DualAppTextInput extends StatelessWidget {
final String labeltext1;
final String labeltext2;
final String initialtext1;
final String initialtext2;
DualAppTextInput({required this.labeltext1, required this.initialtext1, required this.labeltext2, required this.initialtext2});
@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
child: AppTextInput(
label: labeltext1,
readOnly: true,
initialValue: initialtext1,
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
SizedBox(width: 16),
Expanded(
child: AppTextInput(
label: labeltext2,
readOnly: true,
initialValue: initialtext2,
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
],
);
}
}
class RadioText<T> extends StatelessWidget {
RadioText({required this.value, required this.groupvalue , required this.onChange,required this.text});
final T value;
final void Function(T) onChange;
final T? groupvalue;
final String text;
@override
Widget build(BuildContext context) {
return Expanded(
child: Row(
children: [
Radio<T>(
value: value,
groupValue: groupvalue,
onChanged: (T? i) {
if (i != null)
onChange(i);
},
),
Flexible(
child: GestureDetector(
onTap: () => onChange(value),
child: Text(
text,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColorLight,
),
),
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/auth/register.dart
|
import 'package:dijipol/presentation/auth/register_institute.dart';
import 'package:dijipol/presentation/auth/register_person.dart';
import 'package:flutter/material.dart';
class Register extends StatefulWidget {
static const String routeName = '/register';
@override
_RegisterState createState() => _RegisterState();
}
class _RegisterState extends State<Register> {
final PageController pageController = PageController(initialPage: 0);
int currentPage = 0;
@override
void initState() {
pageController.addListener(() {
setState(() {
currentPage = (pageController.page ?? 0).round();
});
});
super.initState();
}
@override
void dispose() {
pageController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Row(
children: <Widget>[
const SizedBox(width: 20),
Image.asset(
'lib/assets/images/logo_banner.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
IconButton(
onPressed: () {
Navigator.of(context).pop();
},
icon: const Icon(Icons.close, size: 30),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.only(left: 20),
child: Text(
'Üye Ol',
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
),
const SizedBox(height: 15),
Container(
height: 56,
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
pageController.animateToPage(0,
duration: const Duration(milliseconds: 500),
curve: Curves.ease);
},
child: Container(
decoration: currentPage == 0
? BoxDecoration(
color: Theme.of(context).primaryColorDark)
: const BoxDecoration(
border: Border(
bottom: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
top: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
left: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
),
),
alignment: Alignment.center,
child: Text(
'Şahıs',
style: TextStyle(
color: currentPage == 0
? Colors.white
: Theme.of(context).primaryColorLight,
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
pageController.animateToPage(1,
duration: const Duration(milliseconds: 500),
curve: Curves.ease);
},
child: Container(
decoration: currentPage == 1
? BoxDecoration(
color: Theme.of(context).primaryColorDark)
: const BoxDecoration(
border: Border(
bottom: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
top: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
right: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
),
),
alignment: Alignment.center,
child: Text(
'Kurumsal',
style: TextStyle(
color: currentPage == 1
? Colors.white
: Theme.of(context).primaryColorLight,
),
),
),
),
),
],
),
),
Expanded(
child: PageView(
controller: pageController,
children: <Widget>[
RegisterPerson(),
RegisterInstitute(),
],
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/auth/register_person.dart
|
import 'package:dijipol/data/models/signup.dart';
import 'package:dijipol/logic/cubits/signup_cubit/signup_cubit.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class RegisterPerson extends StatefulWidget {
@override
_RegisterPersonState createState() => _RegisterPersonState();
}
class _RegisterPersonState extends State<RegisterPerson> {
bool policyChecked = false;
bool illuminationChecked = false;
final TextEditingController name = TextEditingController();
final TextEditingController surname = TextEditingController();
final TextEditingController identityNumber = TextEditingController();
final TextEditingController eMail = TextEditingController();
final TextEditingController telephoneNumber = TextEditingController();
final TextEditingController password = TextEditingController();
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
width: MediaQuery.of(context).size.width - 40,
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const SizedBox(height: 16),
Row(
children: <Widget>[
Expanded(
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 2, color: const Color(0xFFe4e7ec)),
),
child: AppTextInput(placeholder: 'Adınız',controller: name),
),
),
const SizedBox(width: 16),
Expanded(
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 2, color: const Color(0xFFe4e7ec)),
),
child: AppTextInput(placeholder: 'SoyAdınız',controller: surname),
),
),
],
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: AppTextInput(placeholder: 'TC Kimlik Numarası',controller: identityNumber),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: AppTextInput(placeholder: 'E-posta Adresi',controller: eMail),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: AppTextInput(placeholder: 'Telefon Numaranız', controller: telephoneNumber),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: AppTextInput(placeholder: 'Şifrenizi Yazın', controller: password),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'Şifrenizi Tekrar Yazın'),
),
const SizedBox(height: 16),
Row(
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
),
Flexible(
child: Text(
'Poliçe Bilgilendirme formu’nu okudum.',
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
),
],
),
Row(
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
),
Flexible(
child: Text(
'Aydınlatma Metni’ni okudum.',
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
),
],
),
const SizedBox(height: 16),
AppButton(text: 'Üye Ol', onTap: () {
BlocProvider.of<SignupCubit>(context).signup(Signup(name: name.text, surname: surname.text, identityNumber: identityNumber.text, eMail: eMail.text, telephoneNumber: telephoneNumber.text, password: password.text));
}),
const SizedBox(height: 16),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/auth/login.dart
|
import 'package:dijipol/data/models/login.dart';
import 'package:dijipol/logic/cubits/login_cubit/login_cubit.dart';
import 'package:dijipol/presentation/auth/forgot_pass.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class LoginScreen extends StatelessWidget {
static const String routeName = '/login';
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
final TextEditingController username = TextEditingController();
final TextEditingController password = TextEditingController();
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
Image.asset(
'lib/assets/images/logo_banner.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
IconButton(
onPressed: () {
Navigator.of(context).pop();
},
icon: const Icon(Icons.close, size: 30),
),
const SizedBox(width: 20),
],
),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(height: 50),
Text(
'Giriş Yap',
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
const SizedBox(height: 30),
AppTextInput(label: 'Kullanıcı Adı / Telefon',controller: username),
const SizedBox(height: 30),
AppTextInput(label: 'Şifreniz', obscureText: true,controller: password),
const SizedBox(height: 40),
AppButton(
text: 'Giriş Yap',
onTap: () {
BlocProvider.of<LoginCubit>(context).login(Login(username: username.text, password: password.text));
},
),
const SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(ForgotPass.routeName);
},
child: Text(
'Şifremi Unuttum',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w500,
),
),
),
InkWell(
onTap: () => Navigator.of(context).pushNamed(Register.routeName),
child: RichText(
text: TextSpan(
children: <InlineSpan>[
const TextSpan(text: 'Üye Değilseniz '),
TextSpan(
text: 'Üye Olun',
style: TextStyle(color: Theme.of(context).primaryColor),
),
],
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontWeight: FontWeight.w500,
),
),
),
),
],
),
const SizedBox(height: 20),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/auth/register_institute.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/material.dart';
class RegisterInstitute extends StatefulWidget {
@override
_RegisterInstituteState createState() => _RegisterInstituteState();
}
class _RegisterInstituteState extends State<RegisterInstitute> {
bool policyChecked = false;
bool illuminationChecked = false;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'Firma Ünvanı'),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'Vergi Kimlik No'),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'Cep Telefonu'),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'E-Posta'),
),
const SizedBox(height: 16),
Row(
children: <Widget>[
Expanded(
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 2, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'İl'),
),
),
const SizedBox(width: 16),
Expanded(
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 2, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'İlçe'),
),
),
],
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'Şifreniz'),
),
const SizedBox(height: 16),
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 1, color: const Color(0xFFe4e7ec)),
),
child: const AppTextInput(placeholder: 'Şifrenizi Tekrar Yazın'),
),
const SizedBox(height: 16),
Row(
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
),
Flexible(
child: Text(
'Poliçe Bilgilendirme formu’nu okudum.',
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
),
],
),
Row(
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
),
Flexible(
child: Text(
'Aydınlatma Metni’ni okudum.',
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
),
],
),
const SizedBox(height: 16),
AppButton(text: 'Üye Ol', onTap: () {}),
const SizedBox(height: 16),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/auth/forgot_pass.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/material.dart';
class ForgotPass extends StatelessWidget {
static const String routeName = '/forgot-pass';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: const Icon(Icons.close, size: 30),
),
const SizedBox(width: 20),
],
),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(height: 50),
Text(
'Şifremi Unuttum',
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
const SizedBox(height: 30),
Text(
'Dijipol.com’a üye olurken kullandığınız telefon numarasını girin, yeni şifre oluşturmak için bağlantı adresinize gelsin.',
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColorLight,
),
textAlign: TextAlign.left,
),
const SizedBox(height: 30),
const AppTextInput(label: 'Telefon Numaranız'),
const SizedBox(height: 40),
AppButton(
text: 'Giriş Yap',
onTap: () {},
),
const SizedBox(height: 20),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/home/home_bottom_tabs.dart
|
import 'package:dijipol/presentation/home/account/account_screen.dart';
import 'package:dijipol/presentation/home/account/account_screen2.dart';
import 'package:dijipol/presentation/home/offers/offers_screen.dart';
import 'package:dijipol/presentation/home/policies/policy_screen.dart';
import 'package:dijipol/presentation/home/policies/policy_screen2.dart';
import 'package:dijipol/presentation/home/support/support_screen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import './start/start_screen.dart';
class HomeBottomTabs extends StatefulWidget {
static const String routeName = '/home-bottom-tabs';
@override
_HomeBottomTabsState createState() => _HomeBottomTabsState();
}
class _HomeBottomTabsState extends State<HomeBottomTabs> {
final Map<String, Widget> routes = <String, Widget>{
StartScreen.routeName: StartScreen((_) {}),
// PolicyScreen.routeName: PolicyScreen(),
PolicyScreen2.routeName: PolicyScreen2(),
OffersScreen.routeName: OffersScreen(),
// AccountScreen.routeName: AccountScreen(),
AccountScreen2.routeName: AccountScreen2(),
SupportScreen.routeName: SupportScreen(),
};
static const List<String> routeLabels = <String>[
'Dijipol',
'My Policies',
'Teklif Al',
'My Account',
'Support',
];
List<Widget Function(bool isActive, int size, Color activeColor)> routeIcons =
<Widget Function(bool isActive, int size, Color activeColor)>[
(bool isActive, int size, Color activeColor) => Icon(
Icons.home_outlined,
color: isActive ? Colors.white : activeColor,
),
(bool isActive, int size, Color activeColor) => Icon(
CupertinoIcons.umbrella,
color: isActive ? Colors.white : activeColor,
),
(bool isActive, int size, Color activeColor) => Container(
padding: isActive ? EdgeInsets.zero : const EdgeInsets.all(1),
color: Colors.white,
child: Image.asset(
'lib/assets/images/logo${isActive ? '-white' : ''}.png',
height: 22,
width: 22,
),
),
(bool isActive, int size, Color activeColor) => Icon(
Icons.person_outline,
color: isActive ? Colors.white : activeColor,
),
(bool isActive, int size, Color activeColor) => Icon(
Icons.phone_in_talk_outlined,
color: isActive ? Colors.white : activeColor,
),
];
String? selectedRoute;
@override
void initState() {
routes[StartScreen.routeName] = StartScreen(_onItemTapped);
selectedRoute = routes.keys.elementAt(0);
super.initState();
}
void _onItemTapped(String route) {
// if (route == OffersScreen.routeName) {
// return;
// }
setState(() {
selectedRoute = route;
});
}
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: routes[selectedRoute],
bottomNavigationBar: Container(
decoration: const BoxDecoration(
color: Colors.white,
),
child: Stack(
children: <Widget>[
Row(
children: List<Widget>.generate(
routes.length,
(int index) => Expanded(
child: TabBarIcon(
icon: routeIcons[index],
isActive: routes.keys.elementAt(index) == selectedRoute,
onTap: () => _onItemTapped(routes.keys.elementAt(index)),
badgeVisible: false,
width: width,
text: routeLabels[index],
),
),
),
),
],
),
),
);
}
}
class TabBarIcon extends StatelessWidget {
const TabBarIcon({
required this.icon,
required this.isActive,
required this.onTap,
required this.badgeVisible,
required this.width,
required this.text,
});
final Widget Function(bool isActive, int size, Color activeColor) icon;
final bool isActive;
final void Function() onTap;
final bool badgeVisible;
final double width;
final String text;
@override
Widget build(BuildContext context) {
return Material(
color: isActive ? Theme.of(context).primaryColor : Colors.transparent,
child: InkWell(
onTap: onTap,
highlightColor: Colors.transparent,
child: Container(
color: Colors.transparent,
height: 64,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
icon(isActive, 25, Theme.of(context).primaryColor),
// Icon(
// icon,
// size: 25,
// color: isActive ? Colors.white : Theme.of(context).primaryColor,
// ),
Text(
text,
style: TextStyle(
color:
isActive ? Colors.white : Theme.of(context).primaryColor,
fontSize: 11,
),
),
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/policies/policy_screen2.dart
|
import 'package:dijipol/presentation/utils/constant.dart';
import 'package:dijipol/presentation/home/policies/policy_details_dialog.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/material.dart';
class PolicyScreen2 extends StatefulWidget {
static const String routeName = '/policy-screen2';
@override
_PolicyScreen2State createState() => _PolicyScreen2State();
}
class _PolicyScreen2State extends State<PolicyScreen2> {
bool policyChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Container(
decoration: const BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000)))),
padding: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).padding.top + 20,
horizontal: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
children: <Widget>[
Image.asset(
'lib/assets/images/logo_banner1.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
Text('S.SOYLU',style: D16M),
],
),
SizedBox(height: 65),
Text('Poliçelerim',style: D24M),
SizedBox(height: 40),
AppTextInput(
readOnly: true,
initialValue: 'Nakliyat',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
Row(
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
activeColor:
Theme.of(context).primaryColor,
),
Flexible(
child: Text(
'Vadesi bitmek üzere olanları göster',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark),
),
),
],
),
SizedBox(height: 12),
Divider(),
SizedBox(height: 12),
Expanded(child: SingleChildScrollView(
child: Column(
children: [
FourText(text1: '12303203203232',text2: 'Sinan Soylu',text3: 'Akbank Neasürans Hizmetleri A.Ş',text4: 'Kalan Gün: 365'),
SizedBox(height: 25),
FourText(text1: '12303203203232',text2: 'Sinan Soylu',text3: 'Akbank Neasürans Hizmetleri A.Ş',text4: 'Kalan Gün: 365'),
SizedBox(height: 25),
FourText(text1: '12303203203232',text2: 'Sinan Soylu',text3: 'Akbank Neasürans Hizmetleri A.Ş',text4: 'Kalan Gün: 365'),
],
),
))
],
),
);
}
}
class FourText extends StatelessWidget {
final String text1;
final String text2;
final String text3;
final String text4;
FourText({required this.text1,required this.text2,required this.text3,required this.text4});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: (){
showDialog(context: context, builder: (context)=>PolicyDetailsDialog(),);
},
child: Column(
children: [
Row(
children: [
Text(text1,style: P12R),
Spacer(),
Text(text2,style: L12R),
],
),
SizedBox(height: 8),
Row(
children: [
Text(text3,style: L12R),
Spacer(),
Text(text4,style: D12R),
],
),
SizedBox(height: 8),
Divider(),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/policies/policy_screen.dart
|
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class PolicyScreen extends StatelessWidget {
static const String routeName = '/policy-screen';
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Container(
decoration: const BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000)))),
padding: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).padding.top + 20,
horizontal: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
'lib/assets/images/logo_banner.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
fontWeight: FontWeight.w500,
color: Colors.transparent,
textColor: Theme.of(context).primaryColorDark,
),
const SizedBox(width: 12),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
],
),
const SizedBox(height: 30),
Text(
'Giriş Yapınız',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
),
const SizedBox(height: 20),
Text(
'Bu alanı görüntülemek için lütfen giriş yapınız. Üye degilseniz, üye olarak poliçe tekliflerimizden faydalanabilirsiniz.',
style: TextStyle(
fontSize: 16,
color: Theme.of(context).primaryColorLight,
),
textAlign: TextAlign.left,
),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
color: Theme.of(context).primaryColor,
),
),
const SizedBox(width: 18),
Expanded(
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
padding: const EdgeInsets.symmetric(
vertical: 16,
horizontal: 18,
),
color: Colors.white,
textColor: Theme.of(context).primaryColor,
),
),
),
],
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/policies/policy_details_dialog.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import '../../../presentation/utils/constant.dart';
class PolicyDetailsDialog extends StatefulWidget {
@override
_PolicyDetailsDialogState createState() => _PolicyDetailsDialogState();
}
class _PolicyDetailsDialogState extends State<PolicyDetailsDialog> {
@override
Widget build(BuildContext context) {
return Dialog(
insetPadding: EdgeInsets.symmetric(horizontal: 23, vertical: 30),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Zorunlu trafik Sigortası',
style: D16M,
),
SizedBox(height: 8),
Text(
'AK Sigorta',
style: D12R,
),
],
),
),
SizedBox(width: 12),
Image.asset(
'lib/assets/images/Aklogo.png',
width: 100,
height: 50,
),
],
),
SizedBox(height: 12),
Divider(),
SizedBox(height: 12),
Container(
margin: const EdgeInsets.symmetric(
horizontal: 6,
vertical: 6,
),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
blurRadius: 15,
offset: Offset(0, 5),
color: Color(
0x29000000,
),
),
BoxShadow(
offset: const Offset(3, 3),
color: Color(0xFFfea403),
),
],
),
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 18,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
RichText(text: TextSpan(children: [
TextSpan(text: 'Poliçe bedelim: ',style: D16R),
TextSpan(text: '3.700 TL',style: TextStyle(fontWeight: FontWeight.bold)),
],style: D16R),),
RichText(text: TextSpan(children: [
TextSpan(text: 'Yenileme tarihim: ',style: D16R),
TextSpan(text: '27.08.2022',style: TextStyle(fontWeight: FontWeight.bold)),
],style: D16R),),
],
),
),
),
SizedBox(height: 20),
Text('Ana teminatlar',style: D12B),
SizedBox(height: 12),
Divider(height: 1),
Expanded(child: SingleChildScrollView(
child: Column(
children: [
DualTextRow(text1: 'Maddi Hasar Araç Başına',text2: '41.000 TL'),
DualTextRow(text1: 'Maddi Hasar Kaza Başına',text2: '82.000 TL'),
DualTextRow(text1: 'Ölüm ve Sakatlanma Kişi Başına',text2: '410.000 TL'),
DualTextRow(text1: 'Ölüm ve Sakatlanma Kaza Başına',text2: '2.050.000 TL'),
DualTextRow(text1: 'Sağlık Gideri Kişi Başına',text2: '410.000 TL'),
DualTextRow(text1: 'Sağlık Gideri Kaza Başına',text2: '2.050.000 TL'),
],
),
),),
AppButton(text: 'Kapat', onTap: (){})
],
),
));
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/account/change_settings.dart
|
import 'package:dijipol/presentation/utils/constant.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ChangeSetting extends StatefulWidget {
static const String routeName = '/change-settings';
@override
_ChangeSettingState createState() => _ChangeSettingState();
}
class _ChangeSettingState extends State<ChangeSetting> {
bool switch1 = false;
bool switch2 = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
decoration: const BoxDecoration(
color: Colors.white,
border:
Border(bottom: BorderSide(width: 2, color: Color(0x11000000)))),
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 20,
right: 20,
),
// margin: EdgeInsets.only(bottom: 56),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S.SOYLU',
style: D16M,
),
],
),
SizedBox(height: 70),
Row(
children: [
Icon(Icons.settings, color: primaryColorDark),
SizedBox(width: 10),
Text('Ayarlar', style: D24M),
],
),
SizedBox(height: 40),
Divider(height: 0),
SizedBox(height: 24),
Row(
children: [
Switch(
inactiveTrackColor: Color(0x306200ee),
inactiveThumbColor: Color(0x616200ee),
activeColor: Color(0xFF6200ee),
value: switch1,
onChanged: (val) {
setState(() {
switch1 = val;
});
}),
SizedBox(width: 25),
Expanded(
child: Text(
'SMS ile indirim ve kampanyalardan haberdar olmak istiyorum.'))
],
),
SizedBox(height: 25),
Divider(height: 0),
SizedBox(height: 25),
Row(
children: [
Switch(
inactiveTrackColor: Color(0x306200ee),
inactiveThumbColor: Color(0x616200ee),
activeColor: Color(0xFF6200ee),
value: switch2,
onChanged: (val) {
setState(() {
switch2 = val;
});
}),
SizedBox(width: 25),
Expanded(
child: Text(
'E-Posta ile indirim ve kampanyalardan haberdar olmak istiyorum'))
],
),
SizedBox(height: 25),
Divider(height: 0),
SizedBox(height: 25),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/account/account_screen2.dart
|
import 'package:dijipol/presentation/first_open/select_language.dart';
import 'package:dijipol/presentation/home/account/change_language.dart';
import 'package:dijipol/presentation/home/account/change_password.dart';
import 'package:dijipol/presentation/home/account/change_settings.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../presentation/utils/constant.dart';
class AccountScreen2 extends StatefulWidget {
static const String routeName = '/account-screen2';
@override
_AccountScreen2State createState() => _AccountScreen2State();
}
class _AccountScreen2State extends State<AccountScreen2> {
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Container(
decoration: const BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000)))),
padding: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).padding.top + 20,
horizontal: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
children: <Widget>[
Image.asset(
'lib/assets/images/logo_banner1.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
Text('S.SOYLU',style: D16M),
],
),
SizedBox(height: 64),
Text('Hesabım',style: D24M),
SizedBox(height: 40),
ListItem(text: 'Şifre Değiştir',icon: Icons.lock_outline_rounded, onTap: (){
Navigator.pushNamed(context, ChangePassword.routeName);
}),
SizedBox(height: 15),
ListItem(text: 'Dil Seçimi',icon: CupertinoIcons.globe, onTap: (){
Navigator.pushNamed(context, ChangeLanguage.routeName);
}),
SizedBox(height: 15),
ListItem(text: 'Ayarlar',icon: Icons.settings, onTap: () {
Navigator.pushNamed(context, ChangeSetting.routeName);
}),
SizedBox(height: 15),
ListItem(text: 'Çikiş',icon: Icons.power_settings_new,onTap: (){
Navigator.of(context).pushReplacementNamed(SelectLanguageScreen.routeName);
},),
],
),
);
}
}
class ListItem extends StatelessWidget {
final String text;
final IconData icon;
final void Function()? onTap;
ListItem({required this.text , required this.icon, this.onTap});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Color(0x29000000),),
),
child: ListTile(
leading: Icon(this.icon,color: primaryColorDark),
title: Text(text,style: D16M),
trailing: Icon(Icons.keyboard_arrow_right_outlined,color: primaryColorDark),
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/account/account_screen.dart
|
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class AccountScreen extends StatelessWidget {
static const String routeName = '/account-screen';
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Container(
decoration: const BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000)))),
padding: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).padding.top + 20,
horizontal: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
'lib/assets/images/logo_banner.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
fontWeight: FontWeight.w500,
color: Colors.transparent,
textColor: Theme.of(context).primaryColorDark,
),
const SizedBox(width: 12),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
],
),
const SizedBox(height: 30),
Text(
'Giriş Yapınız',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
),
const SizedBox(height: 20),
Text(
'Bu alanı görüntülemek için lütfen giriş yapınız. Üye degilseniz, üye olarak poliçe tekliflerimizden faydalanabilirsiniz.',
style: TextStyle(
fontSize: 16,
color: Theme.of(context).primaryColorLight,
),
textAlign: TextAlign.left,
),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
color: Theme.of(context).primaryColor,
),
),
const SizedBox(width: 18),
Expanded(
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
padding: const EdgeInsets.symmetric(
vertical: 16,
horizontal: 18,
),
color: Colors.white,
textColor: Theme.of(context).primaryColor,
),
),
),
],
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/account/change_language.dart
|
import 'package:dijipol/presentation/utils/constant.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ChangeLanguage extends StatefulWidget {
static const String routeName = '/change-language';
@override
_ChangeLanguageState createState() => _ChangeLanguageState();
}
class _ChangeLanguageState extends State<ChangeLanguage> {
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
decoration: const BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000)))),
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 20,right: 20,
),
// margin: EdgeInsets.only(bottom: 56),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S.SOYLU',
style: D16M,
),
],
),
SizedBox(height: 70),
Row(
children: [
Icon(CupertinoIcons.globe, color: primaryColorDark),
SizedBox(width: 10),
Text('Dil Seçimi',style: D24M),
],
),
SizedBox(height: 40),
Expanded(child: SingleChildScrollView(
child: Column(
children: [
LanguageItem(text1: 'Türkçe', text2: 'Turkish', text3: 'اللغة التركية', text4: 'ترکی', text5: 'Tурецкий', image: 'turkey_flag.png'),
LanguageItem(text1: 'Türkçe', text2: 'Turkish', text3: 'اللغة التركية', text4: 'ترکی', text5: 'Tурецкий', image: 'uk_flag.png'),
LanguageItem(text1: 'Türkçe', text2: 'Turkish', text3: 'اللغة التركية', text4: 'ترکی', text5: 'Tурецкий', image: 'saudi_flag.jpeg'),
LanguageItem(text1: 'Türkçe', text2: 'Turkish', text3: 'اللغة التركية', text4: 'ترکی', text5: 'Tурецкий', image: 'iran_flag.png'),
LanguageItem(text1: 'Türkçe', text2: 'Turkish', text3: 'اللغة التركية', text4: 'ترکی', text5: 'Tурецкий', image: 'russia_flag.png'),
],
),
))
],
),
),
);
}
}
class LanguageItem extends StatelessWidget {
final String text1;
final String text2;
final String text3;
final String text4;
final String text5;
final String image;
LanguageItem({required this.text1,required this.text2,required this.text3,required this.text4,required this.text5,required this.image});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const SizedBox(width: 20),
const Icon(
Icons.radio_button_unchecked,
color: Color(0xFF0047bb),
),
Image.asset('lib/assets/images/$image',width: 95),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
text1,
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
Text(
text2,
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
text3,
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
text4,
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
text5,
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
],
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/account/change_password.dart
|
import 'package:dijipol/presentation/utils/constant.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/material.dart';
class ChangePassword extends StatefulWidget {
static const String routeName = '/change-password';
@override
_ChangePasswordState createState() => _ChangePasswordState();
}
class _ChangePasswordState extends State<ChangePassword> {
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
decoration: const BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000)))),
padding: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).padding.top + 20,
horizontal: 20,
),
// margin: EdgeInsets.only(bottom: 56),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S.SOYLU',
style: D16M,
),
],
),
SizedBox(height: 70),
Row(
children: [
Icon(Icons.lock_outline_rounded,color: primaryColor),
SizedBox(width: 10),
Text('Şifre Değiştir',style: D24M),
],
),
SizedBox(height: 46),
Expanded(child: SingleChildScrollView(
child: Column(
children: [
AppTextInput(
label: 'Kullanıcı adi / Telefon',
placeholder: 'Isim veya tel no',
fontSize: 14,
),
SizedBox(height: 25),
AppTextInput(
label: 'Şifreniz',
placeholder: 'Mevcut şifre',
fontSize: 14,
),
SizedBox(height: 25),
AppTextInput(
label: 'Yeni Şifre',
placeholder: 'Yeni şifreniz',
fontSize: 14,
),
SizedBox(height: 25),
AppTextInput(
label: 'Yeni Şifre Tekrar',
placeholder: 'Yeni şifreniz',
fontSize: 14,
),
],
),
),),
SizedBox(height: 25),
AppButton(
text: 'Şifremi degistir', onTap: () { },
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/support/query_insurance_value.dart
|
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class QueryInsuranceValue extends StatelessWidget {
static const String routeName = '/query-insurance-value';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
fontWeight: FontWeight.w500,
color: Colors.transparent,
textColor: Theme.of(context).primaryColorDark,
),
const SizedBox(width: 12),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 16),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'Kasko Değeri sorgula',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Model yılı',
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Marka',
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Model',
),
),
const SizedBox(height: 50),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'Kasko Değeri',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.center,
),
),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'Toyota Corolla 1.4 Advanced 2021',
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.center,
),
),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'250.000 TL',
style: TextStyle(
fontSize: 34,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w600,
),
textAlign: TextAlign.center,
),
),
const Spacer(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: AppButton(
text: 'Tamamla',
onTap: () {},
),
),
const SizedBox(height: 20),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/support/branches.dart
|
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class Branches extends StatefulWidget {
static const String routeName = '/branches';
@override
_BranchesState createState() => _BranchesState();
}
class _BranchesState extends State<Branches> {
final PageController pageController = PageController(initialPage: 0);
int currentPage = 0;
@override
void initState() {
pageController.addListener(() {
setState(() {
currentPage = (pageController.page ?? 0).round();
});
});
super.initState();
}
@override
void dispose() {
pageController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
fontSize: 14,
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
fontWeight: FontWeight.w500,
color: Colors.transparent,
textColor: Theme.of(context).primaryColorDark,
),
const SizedBox(width: 12),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
fontSize: 14,
padding:
const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 16),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'Şubelerimiz',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
),
const SizedBox(height: 15),
Container(
height: 200,
width: width,
color: Colors.grey[300],
),
const SizedBox(height: 15),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
children: <Widget>[
Expanded(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {},
highlightColor: Colors.transparent,
child: Container(
padding: const EdgeInsets.all(18),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: const <Widget>[
Text(
'Bana En Yakın Şubeleri Göster',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 18,
),
),
SizedBox(width: 10),
Icon(Icons.location_pin,
color: Colors.white),
],
),
),
),
),
),
),
],
),
),
const SizedBox(height: 25),
const Divider(),
const SizedBox(height: 25),
Container(
height: 56,
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
pageController.animateToPage(0,
duration: const Duration(milliseconds: 500),
curve: Curves.ease);
},
child: Container(
decoration: currentPage == 0
? BoxDecoration(
color:
Theme.of(context).primaryColorDark)
: const BoxDecoration(
border: Border(
bottom: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
top: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
left: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
),
),
alignment: Alignment.center,
child: Text(
'Yurtiçi',
style: TextStyle(
color: currentPage == 0
? Colors.white
: Theme.of(context).primaryColorLight,
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
pageController.animateToPage(1,
duration: const Duration(milliseconds: 500),
curve: Curves.ease);
},
child: Container(
decoration: currentPage == 1
? BoxDecoration(
color:
Theme.of(context).primaryColorDark)
: const BoxDecoration(
border: Border(
bottom: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
top: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
right: BorderSide(
width: 2,
color: Color(0xFFf1f3f5),
),
),
),
alignment: Alignment.center,
child: Text(
'Yurtdışı',
style: TextStyle(
color: currentPage == 1
? Colors.white
: Theme.of(context).primaryColorLight,
),
),
),
),
),
],
),
),
const SizedBox(height: 16),
Row(
children: <Widget>[
const SizedBox(width: 20),
Expanded(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: const Color(0xFFf1f3f5),
),
),
child: DropdownButton<String>(
items: const <DropdownMenuItem<String>>[
DropdownMenuItem<String>(
child: Text('Tüm İller'),
value: '1',
),
DropdownMenuItem<String>(
child: Text('Tüm İller'),
value: '2',
),
],
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 16,
),
onChanged: (_) {},
value: '1',
isExpanded: true,
underline: Container(),
),
),
),
const SizedBox(width: 20),
Container(
padding: const EdgeInsets.symmetric(horizontal: 16),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: const Color(0xFFf1f3f5),
),
),
child: const Icon(Icons.search),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 20),
const BranchesList(
title: 'Adıyaman',
),
const SizedBox(height: 20),
const BranchesList(
title: 'Amasya',
),
const SizedBox(height: 20),
],
),
),
),
],
),
),
);
}
}
class BranchesList extends StatelessWidget {
const BranchesList({Key? key, required this.title}) : super(key: key);
final String title;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
title,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: <Widget>[
const SizedBox(width: 16),
BranchItem(
title: 'Amasya Zey Şube',
subtitle: 'Turgut Reis Zey C. No:7 A/A',
phone: '0 850 433 0850',
internal: '2215',
onTap: () {},
),
BranchItem(
title: 'Amasya Zey Şube',
subtitle: 'Turgut Reis Zey C. No:7 A/A',
phone: '0 850 433 0850',
internal: '2215',
onTap: () {},
),
BranchItem(
title: 'Amasya Zey Şube',
subtitle: 'Turgut Reis Zey C. No:7 A/A',
phone: '0 850 433 0850',
internal: '2215',
onTap: () {},
),
const SizedBox(width: 16),
],
),
),
],
);
}
}
class BranchItem extends StatelessWidget {
final String title;
final String subtitle;
final String phone;
final String internal;
final void Function() onTap;
const BranchItem({
required this.title,
required this.subtitle,
required this.phone,
required this.internal,
required this.onTap,
});
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Container(
margin: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
width: (width / 1.5) + 3,
height: (width / 1.8) + 10,
child: Stack(
children: <Widget>[
Positioned(
top: 3,
right: 0,
child: Container(
color: Theme.of(context).primaryColorDark,
width: width / 1.5,
height: width / 1.8,
),
),
Positioned(
top: 0,
left: 0,
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
blurRadius: 15,
offset: Offset(0, 5),
),
],
),
height: width / 1.8,
width: width / 1.5,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
title,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 16),
Text(
subtitle,
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
),
const SizedBox(height: 16),
Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Telefon',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
),
Text(
phone,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 14,
),
),
],
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Dahili',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
),
Text(
internal,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 14,
),
),
],
),
),
],
),
const SizedBox(height: 16),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Haritada Gör',
fontSize: 18,
padding: const EdgeInsets.symmetric(
horizontal: 15, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
],
),
],
),
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/support/support_screen.dart
|
import 'package:dijipol/presentation/home/support/branches.dart';
import 'package:dijipol/presentation/home/support/faq.dart';
import 'package:dijipol/presentation/home/support/query_insurance_value.dart';
import 'package:dijipol/presentation/home/support/submit_claim.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SupportScreen extends StatefulWidget {
static const String routeName = '/support-screen';
@override
_SupportScreenState createState() => _SupportScreenState();
}
class _SupportScreenState extends State<SupportScreen> {
bool contractOpen = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Container(
decoration: const BoxDecoration(
color: Colors.white,
border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000))),
),
child: Column(
children: <Widget>[
SizedBox(height: MediaQuery.of(context).padding.top + 20),
Row(
children: <Widget>[
const SizedBox(width: 20),
Image.asset(
'lib/assets/images/logo_banner.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 20, top: 30),
child: Text(
'Destek',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
),
const SizedBox(height: 20),
GestureDetector(
onTap: () {
showDialog<void>(
context: context,
builder: (_) => Dialog(
shape: const RoundedRectangleBorder(),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const SizedBox(height: 16),
Text(
'Arama Yap',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
Text(
'0850 433 0850 aranıyor. Emin misiniz?',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
Row(
children: <Widget>[
Expanded(
child: AppButton(
text: 'Evet',
onTap: () {
Navigator.of(context).pop();
},
fontWeight: FontWeight.w600,
color: Theme.of(context).primaryColor,
),
),
Expanded(
child: AppButton(
text: 'Hayır',
onTap: () {
Navigator.of(context).pop();
},
padding: const EdgeInsets.symmetric(
vertical: 16,
horizontal: 18,
),
fontWeight: FontWeight.w600,
color: Colors.white,
textColor:
Theme.of(context).primaryColor,
),
),
],
),
const SizedBox(height: 16),
],
),
),
),
);
},
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Row(
children: <Widget>[
const Icon(
Icons.phone_in_talk_outlined,
color: Colors.white,
size: 50,
),
const SizedBox(width: 15),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: const <Widget>[
Text(
'7/24 Uzmanından Destek',
style: TextStyle(
color: Colors.white,
fontSize: 13,
),
),
Text(
'850 433 0850',
style: TextStyle(
color: Colors.white,
fontSize: 19,
),
),
Text(
'HEMEN Aramak için Dokunun',
style: TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.w300,
),
),
],
),
],
),
),
),
const SizedBox(height: 15),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColorDark,
),
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
margin: const EdgeInsets.symmetric(horizontal: 20),
child: const Text(
'Biz sizi arayalım',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 8),
GestureDetector(
onTap: () {
setState(() {
contractOpen = !contractOpen;
});
},
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
blurRadius: 6,
color: Color(0x29000000),
)
],
),
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
margin: const EdgeInsets.symmetric(
horizontal: 20, vertical: 8),
child: Row(
children: <Widget>[
Text(
'Sözleşmeler',
// 'Biz sizi arayalım',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const Spacer(),
if (contractOpen)
Icon(
Icons.keyboard_arrow_up,
color: Theme.of(context).primaryColorDark,
)
else
Icon(
Icons.keyboard_arrow_down,
color: Theme.of(context).primaryColorDark,
),
],
),
),
),
if (contractOpen)
const SupportScreenItem(
text: 'KVKK Hakkında Bilgilendirme',
backgroundColor: Color(0xFFF1F3F5),
),
if (contractOpen)
const SupportScreenItem(
text: 'Açık Rıza Metni',
backgroundColor: Color(0xFFF1F3F5),
),
if (contractOpen)
const SupportScreenItem(
text:
'Gizlilik, Kullanım Koşulları ve Kullanıcı Sözleşmesi',
backgroundColor: Color(0xFFF1F3F5),
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(Branches.routeName);
},
child: const SupportScreenItem(text: 'Şubelerimiz'),
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(SubmitClaim.routeName);
},
child: const SupportScreenItem(text: 'Hasar Talebi Gönder'),
),
GestureDetector(
onTap: () {},
child: const SupportScreenItem(text: 'Mobil kaza tutanağı'),
),
GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed(QueryInsuranceValue.routeName);
},
child:
const SupportScreenItem(text: 'Kasko Değeri sorgula'),
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(Faq.routeName);
},
child:
const SupportScreenItem(text: 'Sıkça Sorulan Sorular'),
),
const SizedBox(height: 15),
],
),
),
),
],
),
);
}
}
class SupportScreenItem extends StatelessWidget {
const SupportScreenItem({required this.text, this.backgroundColor});
final String text;
final Color? backgroundColor;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: backgroundColor ?? Colors.white,
boxShadow: const <BoxShadow>[
BoxShadow(
blurRadius: 6,
color: Color(0x29000000),
)
],
),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Flexible(
child: Text(
text,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
Icon(
Icons.keyboard_arrow_right,
color: Theme.of(context).primaryColorDark,
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/support/faq.dart
|
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class Faq extends StatefulWidget {
static const String routeName = '/faq';
@override
_FaqState createState() => _FaqState();
}
class _FaqState extends State<Faq> {
final PageController pageController = PageController(initialPage: 0);
int currentPage = 0;
@override
void initState() {
pageController.addListener(() {
setState(() {
currentPage = (pageController.page ?? 0).round();
});
});
super.initState();
}
@override
void dispose() {
pageController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
fontSize: 14,
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
fontWeight: FontWeight.w500,
color: Colors.transparent,
textColor: Theme.of(context).primaryColorDark,
),
const SizedBox(width: 12),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
fontSize: 14,
padding:
const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 16),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'Sıkça Sorulan Sorular',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Arama yap',
prefixIcon: Icon(Icons.search, size: 30),
),
),
const SizedBox(height: 20),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
pageController.animateToPage(
0,
duration: const Duration(milliseconds: 300),
curve: Curves.ease,
);
},
child: Chip(
label: const Text('Genel'),
backgroundColor: currentPage == 0
? Theme.of(context).primaryColor
: Colors.white,
labelStyle: TextStyle(
color: currentPage == 0
? Colors.white
: Theme.of(context).primaryColorLight),
),
),
const SizedBox(width: 20),
GestureDetector(
onTap: () {
pageController.animateToPage(
1,
duration: const Duration(milliseconds: 300),
curve: Curves.ease,
);
},
child: Chip(
label: const Text('Ödeme'),
backgroundColor: currentPage == 1
? Theme.of(context).primaryColor
: Colors.white,
labelStyle: TextStyle(
color: currentPage == 1
? Colors.white
: Theme.of(context).primaryColorLight),
),
),
const SizedBox(width: 20),
GestureDetector(
onTap: () {
pageController.animateToPage(
2,
duration: const Duration(milliseconds: 300),
curve: Curves.ease,
);
},
child: Chip(
label: const Text('Hizmetler'),
backgroundColor: currentPage == 2
? Theme.of(context).primaryColor
: Colors.white,
labelStyle: TextStyle(
color: currentPage == 2
? Colors.white
: Theme.of(context).primaryColorLight),
),
),
const SizedBox(width: 20),
GestureDetector(
onTap: () {
pageController.animateToPage(
3,
duration: const Duration(milliseconds: 300),
curve: Curves.ease,
);
},
child: Chip(
label: const Text('Kasko'),
backgroundColor: currentPage == 3
? Theme.of(context).primaryColor
: Colors.white,
labelStyle: TextStyle(
color: currentPage == 3
? Colors.white
: Theme.of(context).primaryColorLight),
),
),
const SizedBox(width: 20),
GestureDetector(
onTap: () {
pageController.animateToPage(
4,
duration: const Duration(milliseconds: 300),
curve: Curves.ease,
);
},
child: Chip(
label: const Text('Birey'),
backgroundColor: currentPage == 4
? Theme.of(context).primaryColor
: Colors.white,
labelStyle: TextStyle(
color: currentPage == 4
? Colors.white
: Theme.of(context).primaryColorLight),
),
),
const SizedBox(width: 20),
],
),
),
Expanded(
child: PageView.builder(
controller: pageController,
itemCount: 5,
itemBuilder: (_, int index) => SingleChildScrollView(
child: Column(
children: <Widget>[
FaqCard(
title: 'Lorem İpsum Sit Dolor Met',
subtitle:
'Ullamco incididunt minim nostrud in nulla deserunt mollit nisi. Nisi ullamco id ex amet anim sunt sint. Voluptate est enim esse ex sit nisi id cillum nulla est.',
cornerIcon: Icon(
Icons.close,
color: Theme.of(context).primaryColorDark,
),
),
FaqCard(
title:
'Ullamco incididunt minim nostrud in nulla deserunt mollit nisi.',
// subtitle:
// 'Ullamco incididunt minim nostrud in nulla deserunt mollit nisi. Nisi ullamco id ex amet anim sunt sint. Voluptate est enim esse ex sit nisi id cillum nulla est.',
cornerIcon: Icon(
Icons.add,
color: Theme.of(context).primaryColorDark,
),
),
FaqCard(
title:
'Ullamco incididunt minim nostrud in nulla deserunt mollit nisi.',
// subtitle:
// 'Ullamco incididunt minim nostrud in nulla deserunt mollit nisi. Nisi ullamco id ex amet anim sunt sint. Voluptate est enim esse ex sit nisi id cillum nulla est.',
cornerIcon: Icon(
Icons.add,
color: Theme.of(context).primaryColorDark,
),
),
FaqCard(
title:
'Ullamco incididunt minim nostrud in nulla deserunt mollit nisi.',
// subtitle:
// 'Ullamco incididunt minim nostrud in nulla deserunt mollit nisi. Nisi ullamco id ex amet anim sunt sint. Voluptate est enim esse ex sit nisi id cillum nulla est.',
cornerIcon: Icon(
Icons.add,
color: Theme.of(context).primaryColorDark,
),
),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: Theme.of(context).primaryColor,
),
),
margin: const EdgeInsets.all(25),
child: AppButton(
text: 'Haritada Gör',
fontSize: 18,
padding: const EdgeInsets.symmetric(
horizontal: 15, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
],
),
),
),
),
],
),
),
);
}
}
class FaqCard extends StatelessWidget {
const FaqCard({
Key? key,
required this.title,
this.subtitle,
this.cornerIcon,
}) : super(key: key);
final String title;
final String? subtitle;
final Widget? cornerIcon;
@override
Widget build(BuildContext context) {
return Container(
decoration: const BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
offset: Offset(0, 5),
blurRadius: 15,
color: Color(
0x29000000,
),
),
],
),
margin: const EdgeInsets.symmetric(horizontal: 25, vertical: 10),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Flexible(
child: Text(
title,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
fontSize: 17,
),
),
),
const SizedBox(width: 15),
if (cornerIcon != null) cornerIcon!
],
),
if (subtitle != null) const SizedBox(height: 30),
if (subtitle != null)
Text(
subtitle!,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w400,
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/support/submit_claim.dart
|
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SubmitClaim extends StatelessWidget {
static const String routeName = '/submit-claim';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
fontWeight: FontWeight.w500,
color: Colors.transparent,
textColor: Theme.of(context).primaryColorDark,
),
const SizedBox(width: 12),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 16),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'Hasar Talebi Gönder',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
),
const SizedBox(height: 15),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColorDark,
),
margin: const EdgeInsets.symmetric(horizontal: 20),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {},
highlightColor: Colors.transparent,
child: Container(
padding: const EdgeInsets.all(18),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
Text(
'QR İle tanımla',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 18,
),
),
SizedBox(width: 10),
Icon(
Icons.qr_code,
color: Colors.white,
),
],
),
),
),
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Kategori',
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Tc kimlik / Vergi no',
),
),
const SizedBox(height: 20),
Row(
children: const <Widget>[
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Plaka',
),
),
),
SizedBox(width: 20),
Expanded(
child: Padding(
padding: EdgeInsets.only(right: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Belge Seri No (XX111111)',
),
),
),
],
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Telefon Numaranız',
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'E-posta Adresi',
),
),
const SizedBox(height: 20),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: AppTextInput(
displayBorder: true,
floatingLabel: 'Poliçe Numarası',
),
),
const SizedBox(height: 20),
GestureDetector(
onTap: () {
showCupertinoModalPopup<void>(
context: context,
builder: (_) => CupertinoActionSheet(
title: const Text('Kamera özelliği kullanınız ya da bir resim seçiniz.'),
actions: <CupertinoActionSheetAction>[
CupertinoActionSheetAction(
child: const Text('Kamera'),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoActionSheetAction(
child: const Text('Galeri'),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoActionSheetAction(
child: const Text('Files'),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoActionSheetAction(
child: const Text('İptal'),
isDestructiveAction: true,
onPressed: () {
Navigator.pop(context);
},
),
],
),
);
},
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 20),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: const Color(0xFFe4e7ec),
),
),
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.attachment,
color: Theme.of(context).primaryColorLight,
size: 30,
),
const SizedBox(width: 10),
Text(
'Kaza Tutanağı Ekle',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 16,
),
),
],
),
const SizedBox(height: 10),
Text(
'jpg, pdf, png, xls, xlsx, word, wordx',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
),
],
),
),
),
const SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: AppButton(
text: 'Talep Gönder',
onTap: () {},
),
),
const SizedBox(height: 20),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/offers_screen.dart
|
import 'package:dijipol/presentation/home/offers/Arac/arac_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Bireysel/bireysel_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Cep/cep_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Evcil/evcil_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Konut/konut_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Seyahat/seyahat_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlay%C4%B1c%C4%B1_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Yabanci/yabanci_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Zorunlu/zorunlu_home_screen.dart';
import 'package:dijipol/presentation/home/offers/kasko/kasko_home_screen.dart';
import 'package:dijipol/presentation/home/offers/Dask/dask_home_screen.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:flutter/material.dart';
class OffersScreen extends StatelessWidget {
static const String routeName = '/offers-screen';
@override
Widget build(BuildContext context) {
return Container(
decoration: const BoxDecoration(
color: Colors.white,
border: Border(bottom: BorderSide(width: 2, color: Color(0x11000000))),
),
child: Column(
children: <Widget>[
SizedBox(height: MediaQuery.of(context).padding.top + 20),
Row(
children: <Widget>[
const SizedBox(width: 20),
Text(
'Teklif Al',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 26,
fontWeight: FontWeight.w600,
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.only(left: 25, right: 25 - 3),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 20),
OffersItem(
title: 'Kasko',
onTap: () {
Navigator.of(context).pushNamed(
KaskoHomeScreen.routeName,
);
},
icon: const CustomIcon('steering'),
backColor: const Color(0xFFe1251b),
),
const SizedBox(height: 10),
OffersItem(
title: 'Z. Trafik Sigortası',
onTap: () {
Navigator.of(context).pushNamed(
ZorunluHomeScreen.routeName,
);
},
icon: const CustomIcon('car'),
backColor: const Color(0xFF0aa0df),
),
const SizedBox(height: 10),
OffersItem(
title: 'Dask',
onTap: () {
Navigator.of(context).pushNamed(
DaskHomeScreen.routeName,
);
},
icon: const CustomIcon('heart-beat'),
backColor: const Color(0xFFfea403),
),
const SizedBox(height: 10),
OffersItem(
title: 'Konut Sigortası',
onTap: () {
Navigator.of(context).pushNamed(
KnoutHomeScreen.routeName,
);
},
icon: const CustomIcon('house'),
backColor: const Color(0xFF0047ba),
),
const SizedBox(height: 10),
OffersItem(
title: 'T. Sağlık Sigortası',
onTap: () {
Navigator.of(context).pushNamed(
TamamlayHomeScreen.routeName,
);
},
icon: const CustomIcon('handshake'),
backColor: const Color(0xFFe1251b),
),
const SizedBox(height: 10),
OffersItem(
title: 'Yabancı Sağlık Sig.',
onTap: () {
Navigator.of(context).pushNamed(
YabanciHomeScreen.routeName,
);
},
icon: const CustomIcon('heart-heartbeat'),
backColor: const Color(0xFFfea403),
),
const SizedBox(height: 10),
OffersItem(
title: 'Seyahat Sağlık Sig.',
onTap: () {
Navigator.of(context).pushNamed(
SeyahatHomeScreen.routeName,
);
},
icon: const CustomIcon('suitcase'),
backColor: const Color(0xFF0047ba),
),
const SizedBox(height: 10),
OffersItem(
title: 'Evcil Hayvan Sig.',
onTap: () {
Navigator.of(context).pushNamed(
EvcilHomeScreen.routeName,
);
},
icon: const CustomIcon('pet'),
backColor: const Color(0xFFe1251b),
),
const SizedBox(height: 10),
OffersItem(
title: 'Cep Telefonu Sig.',
onTap: () {
Navigator.of(context).pushNamed(
CepHomeScreen.routeName,
);
},
icon: const CustomIcon('phone-cracked'),
backColor: const Color(0xFF0aa0df),
),
const SizedBox(height: 10),
OffersItem(
title: '2. El Garanti Sig.',
onTap: () {
Navigator.of(context).pushNamed(
AracHomeScreen.routeName,
);
},
icon: const CustomIcon('car-hand'),
backColor: const Color(0xFFfea403),
),
const SizedBox(height: 10),
OffersItem(
title: 'Bireysel Sağlık Sig.',
onTap: () {
Navigator.of(context).pushNamed(
BireyselHomeScreen.routeName,
);
},
icon: const CustomIcon('hand-heart'),
backColor: const Color(0xFFfea403),
),
const SizedBox(height: 10),
],
),
),
),
),
],
),
);
}
}
class OffersItem extends StatelessWidget {
final Widget icon;
final String title;
final Color backColor;
final void Function() onTap;
const OffersItem(
{required this.title,
required this.onTap,
required this.icon,
required this.backColor});
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return SizedBox(
width: width - 50 + 3,
height: 58 + 3,
child: Stack(
children: <Widget>[
Positioned(
top: 3,
right: 0,
child: Container(
color: backColor,
width: width - 50,
height: 58,
),
),
Positioned(
top: 0,
left: 0,
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
blurRadius: 15,
offset: Offset(0, 5),
color: Color(
0x29000000,
),
),
],
),
width: width - 50,
height: 58,
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: onTap,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 18,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
icon,
const SizedBox(width: 16),
Expanded(
child: Text(
title,
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
Text(
'Teklif Al',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 4),
Icon(
Icons.chevron_right,
size: 20,
color: Theme.of(context).primaryColor,
)
],
),
),
),
),
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Bireysel/bireysel_request_received.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class BireyselRequestReceived extends StatelessWidget {
static const String routeName = '/bireysel-request-received';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Bireysel Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 30),
const Center(
child: Icon(
Icons.check_circle,
size: 150,
color: Color(0xFF2ac769),
),
),
const SizedBox(height: 30),
Text(
'Talebiniz Başarıyla\nAlınmıştır',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore.',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: 'E-posta adresi: ',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
),
),
TextSpan(
text: 'sinan_soylu@live.nl',
style: TextStyle(
color: Theme.of(context).primaryColor,
),
),
],
style: const TextStyle(fontWeight: FontWeight.w500),
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
AppButton(
text: 'Anasayfaya Dön',
onTap: () {
},
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Bireysel/bireysel_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Bireysel/bireysel_request_received.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class BireyselEnterInfo extends StatefulWidget {
static const String routeName = '/bireysel-enter-info';
@override
_BireyselEnterInfoState createState() => _BireyselEnterInfoState();
}
class _BireyselEnterInfoState extends State<BireyselEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Bireysel Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kimlik No ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0 && plakamRadio == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextInput(
label: 'Eski Bireysel Poliçe Numaranız',
placeholder: '12342323',
fontSize: 14,
),
SizedBox(height: 25),
Text('Bireysel Poliçe Numaramı Bilmiyorum' ,style: P16M),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Adres Seçimi',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Column(
children: [
AppTextInput(
label: 'Boy',
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Kilo',
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Mevcut Sağlık Sigortanız var mı?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Hangi Plan Tipi İstersiniz?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Sağlık teklifinizde Amerikan Hastanesi İsteniyor mu?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Acıbadem, Florence Nightangle gibi hastaneleri dahil edelim mi?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Ayakta tedaviyi kişi başı limitli mi limitsiz mi çalışalım?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Doğum teminatı isteniyor mu?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Yurtdışı tedavi teminatı isteniyor mu?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
],
),
if (currentStep == 2) const SizedBox(height: 25),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
disabled: false,
onTap: () {
Navigator.of(context)
.pushNamed(BireyselRequestReceived.routeName);
setState(() {
currentStep = 3;
});
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Bireysel/bireysel_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Bireysel/bireysel_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class BireyselHomeScreen extends StatefulWidget {
static const String routeName = '/bireysel-home';
@override
_BireyselHomeScreenState createState() => _BireyselHomeScreenState();
}
class _BireyselHomeScreenState extends State<BireyselHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'hand-heart',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Bireysel Sağlık Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
const SizedBox(height: 12),
AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
BireyselEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Arac/arac_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Arac/arac_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class AracEnterInfo extends StatefulWidget {
static const String routeName = '/arac-enter-info';
@override
_AracEnterInfoState createState() => _AracEnterInfoState();
}
class _AracEnterInfoState extends State<AracEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
bool policyChecked = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'2. El Araç Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'2. El Araç Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: <Widget>[
Row(
children: [
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Hususi Otomobil'),
],
),
Row(
children: [
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Kapalı Kasa Kamyonet'),
],
)
],
),
SizedBox(height: 25),
Text('SATICI BİLGİLERİ',style: L12M),
SizedBox(height: 25),
AppTextInput(
label: 'Satıcı TC Kimlik No',
placeholder: 'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Satıcı Cep Telefonu',
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Satıcı E-posta',
placeholder: 'örnek@gmail.com',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'@',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Satıcı TC Kimlik No',
placeholder: '34 ABC 34 34',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: primaryColor,
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TR',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Ruhsat',
placeholder: 'Yazınız',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'RST',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
Row(
children: <Widget>[
Expanded(
child: AppTextInput(
label: 'Kilometre',
readOnly: true,
initialValue: 'Yazınız',
fontSize: 14,
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
leading: Container(
color: Color(0xFF2ac769),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TR',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
SizedBox(width: 16),
Expanded(
child: AppTextInput(
label: 'Silindir Hacmi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
],
),
SizedBox(height: 25),
Text('ALICI BİLGİLERİ',style: L12M),
SizedBox(height: 25),
AppTextInput(
label: 'Alıcı TC Kimlik No',
placeholder: ' TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Alıcı Cep Telefonu',
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Satış Tarihi',
floatingLabel: 'Seçiniz',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
SizedBox(height: 25),
Text('ALICI BİLGİLERİ',style: L12M),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Araç Model Yılı', initialtext1: 'Seçiniz', labeltext2: 'Araç Markası', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
AppTextInput(
label: 'Araç Modeli',
floatingLabel: 'Seçiniz',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
SizedBox(height: 25),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
// borderRadius: BorderRadius.circular(200),
),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: null,
highlightColor: Colors.transparent,
child: Container(
color: primaryGreen,
padding: EdgeInsets.symmetric(vertical: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.search_rounded,color: Colors.white),
SizedBox(width: 14),
Text(
'Araç Sorgula',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w400,
fontSize: 16,
),
),
],
),
),
),
),
),
SizedBox(height: 25),
Text('ALICI BİLGİLERİ',style: L12M),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Başlangıç Tarihi', initialtext1: 'Seçiniz', labeltext2: 'Poliçe Süresi', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'TSE Belge No', initialtext1: 'Yazınız', labeltext2: 'Ekspertiz Rapor No', initialtext2: 'Yazınız'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Ekspertiz Tarihi', initialtext1: 'Seçiniz', labeltext2: 'Yakıt Tipi', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
AppTextInput(
label: 'Ekspertiz Raporu Yükle',
floatingLabel: 'Yazınız',
contentPadding: EdgeInsets.only(left: 16),
trailing:Container(
color: Color(0xFF2ac769),
height: 50,
alignment: Alignment.center,
child: Row(
children: [
SizedBox(width: 18),
Icon(Icons.cloud,color: Colors.white),
SizedBox(width: 8),
Text(
'Yükle',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
SizedBox(width: 18),
],
),
),
keyboardType: TextInputType.phone,
),
SizedBox(height: 25),
AppTextInput(
label: 'Not',
floatingLabel: 'Yazınız',
contentPadding: EdgeInsets.only(left: 16),
trailing:Container(
color: Color(0xFF2ac769),
height: 50,
alignment: Alignment.center,
child: Row(
children: [
SizedBox(width: 18),
Icon(Icons.cloud,color: Colors.white),
SizedBox(width: 8),
Text(
'Yükle',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
SizedBox(width: 18),
],
),
),
keyboardType: TextInputType.phone,
),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Vites Tipi', initialtext1: 'Seçiniz', labeltext2: 'Çekiş Tipi', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
activeColor:
Theme.of(context).primaryColor,
),
Flexible(
child: Text(
'Gizlilik Politikası ve kullanıcı sözleşmesi aydınlatma metni, Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark),
),
),
],
),
],
),
if (currentStep == 0) const SizedBox(height: 20),if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
Navigator.of(context)
.pushNamed(AracViewOffer.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Arac/arac_view_offer.dart
|
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
import 'arac_insurance_offer.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
class AracViewOffer extends StatefulWidget {
static const routeName = '/arac-presentation-offer';
@override
_AracViewOfferState createState() => _AracViewOfferState();
}
class _AracViewOfferState extends State<AracViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'2. El Araç Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Teklifleri İncele',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Yabancı Sağlık Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Arac Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {
Navigator.of(context).pushNamed(
AracInsuranceOffer.routname,
);
},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Arac Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {
Navigator.of(context).pushNamed(
AracInsuranceOffer.routname,
);
},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 35),
child: Container(
decoration:
BoxDecoration(color: Colors.white, boxShadow: [
BoxShadow(
color: Color(0x29000000),
blurRadius: 15,
offset: Offset(0, 5),
)
]),
padding: EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sigorta Bilgileriniz',
style: D16M,
),
SizedBox(
height: 16,
),
DualTextColumn(
text1: 'Adınız Soyadınız',
text2: 'S***N S*Y**'),
DualTextColumn(
text1: 'TC Kimlik No', text2: '502332030332'),
GestureDetector(
onTap: () {},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Arac/arac_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Arac/arac_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class AracHomeScreen extends StatefulWidget {
static const String routeName = '/arac-home';
@override
_AracHomeScreenState createState() => _AracHomeScreenState();
}
class _AracHomeScreenState extends State<AracHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'car-hand',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'2. El Araç Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
if (index == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'TC Kimlik numarası veya Vergi no',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
AracEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Arac/arac_insurance_offer.dart
|
import 'package:dijipol/presentation/utils/constant.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:flutter/material.dart';
class AracInsuranceOffer extends StatefulWidget {
static const String routname = '/Arac-insurance-offer';
@override
_AracInsuranceOfferState createState() => _AracInsuranceOfferState();
}
class _AracInsuranceOfferState extends State<AracInsuranceOffer> {
@override
Widget build(BuildContext context) {
bool receiveSmsChecked = false;
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'2. El Araç Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
SizedBox(height: 35),
Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'car-hand',
size: 40,
),
),
SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'2. El Araç Sigorta Teklifiniz',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
SizedBox(height: 25),
Image.asset(
'lib/assets/images/Aklogo.png',
width: 364,
height: 116,
),
Expanded(child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
Text('Sigortalı & Sigorta Ettiren Bilgileri: 12392393****',style: D14M),
SizedBox(height: 12),
Text('1.311,25 TL',style: P18M),
SizedBox(height: 8),
Text('412,15 TL X 3 Taksit',style: L14M),
SizedBox(height: 25),
Row(
children: <Widget>[
Checkbox(
value: receiveSmsChecked,
onChanged: (bool? p) => setState(() {
receiveSmsChecked = p ?? false;
}),
activeColor:
Theme.of(context).primaryColor,
),
Flexible(
child: Text(
'Poliçe Bilgilendirme Formu’nu okudum ve onaylıyorum.',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
),
),
),
],
),
SizedBox(height: 15),
Row(
children: <Widget>[
Checkbox(
value: receiveSmsChecked,
onChanged: (bool? p) => setState(() {
receiveSmsChecked = p ?? false;
}),
activeColor:
Theme.of(context).primaryColor,
),
Flexible(
child: Text(
'Aydınlatma Metni’ni okudum.',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
),
),
),
],
),
SizedBox(height: 23),
AppButton(
text: 'Teklif Al',
color: primaryGreen,
onTap: () {
},
),
],
),
),
),),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Tamamlay/tamamlayıcı_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlay%C4%B1c%C4%B1_view_offer.dart';
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlayıcı_request_received.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class TamamlayEnterInfo extends StatefulWidget {
static const String routeName = '/tamamlay-enter-info';
@override
_TamamlayEnterInfoState createState() => _TamamlayEnterInfoState();
}
class _TamamlayEnterInfoState extends State<TamamlayEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
bool? doKnowRadioStep3;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'T. Sağlık Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kimlik No ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Row(
children: <Widget>[
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Kendim'),
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Ailem'),
RadioText<int>(value: 3, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Çocuğum'),
],
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Ruhsat sahibi TC kimlik numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 ** * **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Poliçe Bilgileri',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Vadesi biten poliçeniz var mı?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
SizedBox(height: 10),
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Evet Var'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Hayır Yok'),
],
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Mevcut Sağlık Poliçeniz var mı?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
SizedBox(height: 10),
Column(
children: <Widget>[
Row(
children: [
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'İlk kez yaptıracağım'),
],
),
Row(
children: [
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Daha önceden poliçem var'),
],
)
],
),
SizedBox(height: 10),
DualAppTextInput(labeltext1: 'Boyunuz (cm)', initialtext1: 'Seçiniz', labeltext2: 'Kilonuz (kg)', initialtext2: 'Seçiniz'),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Column(
children: [
SizedBox(height: 25),
AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 25),
AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 25),
AppTextInput(
label: 'Cep Telefonu Numaranız',
placeholder: '0850 ** * **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Cep Telefonu Numaranız',
placeholder: '0850 ** * **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'@',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Sigorta Ettirenin TC Kimlik No',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 25),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
// disabled: doKnowRadioStep2 == null,
onTap: () {
setState(() {
currentStep = 3;
Navigator.of(context)
.pushNamed(TamamlayRequestReceived.routeName);
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'04. Aile Bilgileri',
style: TextStyle(
color: currentStep >= 3
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 3) const SizedBox(width: 30),
if (currentStep > 3)
InkWell(
onTap: () => setState(() => currentStep = 3),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 20),
DualAppTextInput(labeltext1: 'Birey', initialtext1: 'Seçiniz', labeltext2: 'TC kimlik Numarası', initialtext2: 'Seçiniz'),
const SizedBox(height: 20),
DualAppTextInput(labeltext1: 'Boy (cm)', initialtext1: 'Seçiniz', labeltext2: 'Kilo (kg)', initialtext2: 'Seçiniz'),
const SizedBox(height: 20),
Icon(Icons.delete,color: primaryColor),
const SizedBox(height: 40),
Row(
children: [
Icon(Icons.add_circle_outline,color: primaryColor),
SizedBox( width: 10),
Text('Yeni Birey Ekle',style: P18S,)
],
),
],
),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
AppButton(
text: 'Devam Et',
onTap: () {
Navigator.of(context)
.pushNamed(TamamlayViewOffer.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Tamamlay/tamamlayıcı_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlayıcı_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class TamamlayHomeScreen extends StatefulWidget {
static const String routeName = '/tamamlay-home';
@override
_TamamlayHomeScreenState createState() => _TamamlayHomeScreenState();
}
class _TamamlayHomeScreenState extends State<TamamlayHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'handshake',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Tamamlayıcı Sağlık Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 3,
child: Column(
children: <Widget>[
SizedBox(
height: 60,
child: TabBar(
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: const Color(0xFF8592a8),
labelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
unselectedLabelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
indicatorWeight: 4,
indicatorColor: Theme.of(context).primaryColor,
indicatorPadding: const EdgeInsets.only(top: 20),
tabs: const <Widget>[
Tab(
text: 'Kendim',
),
Tab(
text: 'Çocuğum',
),
Tab(
text: 'Ailem',
),
],
),
),
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
3,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
if (index == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon:
Icon(Icons.keyboard_arrow_down),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
color: Color(0xFF1ab759),
text: 'Teklif Al',
onTap: () {
Navigator.of(context).pushNamed(
TamamlayEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Tamamlay/tamamlayıcı_view_offer.dart
|
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
class TamamlayViewOffer extends StatefulWidget {
static const routeName = '/tamamlay-presentation-offer';
@override
_TamamlayViewOfferState createState() => _TamamlayViewOfferState();
}
class _TamamlayViewOfferState extends State<TamamlayViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'T. Sağlık Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Teklifleri İncele',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Tamamlayıcı Sağlık Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem(
title:
'Sizin için bulduğumuz tüm teklifler hazır.En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 10),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Tamamlay Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Tamamlay Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 35),
child: Container(
decoration:
BoxDecoration(color: Colors.white, boxShadow: [
BoxShadow(
color: Color(0x29000000),
blurRadius: 15,
offset: Offset(0, 5),
)
]),
padding: EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sigorta Bilgileriniz',
style: D16M,
),
SizedBox(
height: 16,
),
DualTextColumn(
text1: 'Adınız Soyadınız',
text2: 'S** SO** ul**'),
DualTextColumn(
text1: 'TC Kimlik No', text2: '502332030332'),
DualTextColumn(
text1: 'Eşinizin Adı ve Soyadı',
text2: 'Kader Kızılay'),
DualTextColumn(
text1: 'TC Kimlik No', text2: '502332030332'),
DualTextColumn(
text1: '1.Çocuk Adı ve Soyadı',
text2: '502332030332'),
DualTextColumn(
text1: 'TC Kimlik No', text2: '502332030332'),
GestureDetector(
onTap: () {},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Tamamlay/tamamlayıcı_request_received.dart
|
import 'package:dijipol/presentation/home/offers/Tamamlay/tamamlayıcı_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class TamamlayRequestReceived extends StatelessWidget {
static const String routeName = '/tamamlay-request-received';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'T. Sağlık Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 30),
const Center(
child: Icon(
Icons.check_circle,
size: 150,
color: Color(0xFF2ac769),
),
),
const SizedBox(height: 30),
Text(
'Talebiniz Başarıyla\nAlınmıştır',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore.',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: 'E-posta adresi: ',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
),
),
TextSpan(
text: 'sinan_soylu@live.nl',
style: TextStyle(
color: Theme.of(context).primaryColor,
),
),
],
style: const TextStyle(fontWeight: FontWeight.w500),
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
AppButton(
text: 'Anasayfaya Dön',
onTap: () {
Navigator.pushNamed(context, TamamlayViewOffer.routeName);
},
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Seyahat/seyahat_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Seyahat/seyahat_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class SeyahatHomeScreen extends StatefulWidget {
static const String routeName = '/seyahat-home';
@override
_SeyahatHomeScreenState createState() => _SeyahatHomeScreenState();
}
class _SeyahatHomeScreenState extends State<SeyahatHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'suitcase',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Seyahat Sağlık Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
SizedBox(
height: 60,
child: TabBar(
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: const Color(0xFF8592a8),
labelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
unselectedLabelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
indicatorWeight: 4,
indicatorColor: Theme.of(context).primaryColor,
indicatorPadding: const EdgeInsets.only(top: 20),
tabs: const <Widget>[
Tab(
text: 'TC Kimlik Nu. ile',
),
Tab(
text: 'Pasaport No. ile',
),
],
),
),
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
if (index == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (index == 1)
SizedBox(height: 15),
if (index == 1)
AppButtonIcon(
text: 'Pasaport Tarayıcı Kullan',
fontWeight: FontWeight.w400,
icon: Icon(Icons.account_box_outlined ,color: Colors.white),
color: Color(0xFFd60812),
onTap: () {
},
),
if (index == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
readOnly: true,
initialValue: 'Pasaport Numaranız',
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
SeyahatEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Seyahat/seyahat_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Seyahat/seyahat_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
class SeyahatEnterInfo extends StatefulWidget {
static const String routeName = '/seyahat-enter-info';
@override
_SeyahatEnterInfoState createState() => _SeyahatEnterInfoState();
}
class _SeyahatEnterInfoState extends State<SeyahatEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
bool isStepThreeEditable = true;
bool? doKnowRadioStep2;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Seyahat Trafik Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kimlik No ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Row(
children: <Widget>[
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Kimlik No'),
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Pasaport/Yabancı Kimlik No'),
],
),
if (currentStep == 0)
if (plakamRadio == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Ruhsat sahibi TC kimlik numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0)
if (plakamRadio == 1)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: 'Pasaport/Yabancı Kimlik No'),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 ** * **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if(currentStep == 1)
if(plakamRadio == 0)
Two(() { setState(() {
currentStep = 2;
},);},),
if(currentStep == 1)
if(plakamRadio == 1)
Two1(() { setState(() {
currentStep = 2;
},);},),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Seyahat Bilgileri',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Text(
'Covid teminatı istiyor musunuz?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep2, onChange: (i) => setState(()=>doKnowRadioStep2 = i),text:'Pasaport/Yabancı Kimlik No'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep2, onChange: (i) => setState(()=>doKnowRadioStep2 = i),text:'Hayır'),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2 && !(doKnowRadioStep2 ?? true))
AppTextInput(
label: 'E-posta adresini yazın',
readOnly: true,
initialValue: 'sinan_soylu@live.nl',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
DualAppTextInput(labeltext1: 'Gidiş Tarihi', initialtext1: 'Seçiniz', labeltext2: 'Dönüş Tarihi', initialtext2: 'Seçiniz'),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
const SizedBox(height: 20),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
if (isStepThreeEditable)
DualAppTextInput(labeltext1: 'Gidilecek Ülke', initialtext1: 'Seçiniz', labeltext2: 'Coğrafi Saha Alanı', initialtext2: 'Seçiniz'),
if (currentStep == 2 )
const SizedBox(height: 25),
if (currentStep == 2 )
AppButton(
text: 'Devam Et',
disabled: doKnowRadioStep2 == null,
onTap: () {
if (plakamRadio == 0)
Navigator.of(context)
.pushNamed(SeyahatViewOffer.routeName);
else
setState(() {
currentStep = 3;
});
},
),
const SizedBox(height: 20),
if(plakamRadio == 1)
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
if(plakamRadio == 1)
Row(
children: <Widget>[
Expanded(
child: Text(
'04. Diğer Özellikler',
style: TextStyle(
color: currentStep >= 3
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 3) const SizedBox(width: 30),
if (currentStep > 3)
InkWell(
onTap: () => setState(() => currentStep = 3),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if(plakamRadio == 1)
if (currentStep == 3) const SizedBox(width: 30),
if(plakamRadio == 1)
if (currentStep == 3)
Four(() {
Navigator.of(context)
.pushNamed(SeyahatViewOffer.routeName);
},
),
SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
class Two extends StatelessWidget {
final void Function() onTap;
Two(this.onTap);
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
SizedBox(height: 20),
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 20),
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 20),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 20),
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 20),
AppButton(
text: 'Devam Et',
onTap: onTap,
),
],
),
);
}
}
class Two1 extends StatelessWidget {
final void Function() onTap;
Two1(this.onTap);
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
SizedBox(height: 20),
const AppTextInput(
label: 'Pasaport No / Kimlik No',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 20),
const AppTextInput(
label: 'Poliçe Başlangıç Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 20),
const AppTextInput(
label: 'Adınız',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 20),
const AppTextInput(
label: 'Soyadınız',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 20),
const AppTextInput(
label: 'Anne Adı',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 20),
const AppTextInput(
label: 'Baba Adı',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 20),
DualAppTextInput(labeltext1: 'Doğum Tarihiniz', initialtext1: 'Seçiniz', labeltext2: 'Cinsiyetiniz', initialtext2: 'Seçiniz'),
SizedBox(height: 20),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 20),
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 20),
AppButton(
text: 'Devam Et',
onTap: onTap,
),
],
),
);
}
}
class Four extends StatelessWidget {
final void Function() onTap;
Four(this.onTap);
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Belde', initialtext1: 'Seçiniz', labeltext2: 'Mahalle', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Cadde/Sokak Seç', initialtext1: 'Seçiniz', labeltext2: 'Bina No', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
AppTextInput(
label: 'Kapı No',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppButton(
text: 'Devam Et',
onTap: onTap,
),
],
),
);
}
}
// if (currentStep == 3) const SizedBox(height: 20),
// if (currentStep == 3),
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Seyahat/seyahat_view_offer.dart
|
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
class SeyahatViewOffer extends StatefulWidget {
static const routeName = '/seyahat-presentation-offer';
@override
_SeyahatViewOfferState createState() => _SeyahatViewOfferState();
}
class _SeyahatViewOfferState extends State<SeyahatViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Seyahat Trafik Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Seyahat Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Seyahat Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: ' Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Zorunlu/zorunlu_view_offer.dart
|
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
class ZorunluViewOffer extends StatefulWidget {
static const routeName = '/zorunlu-presentation-offer';
@override
_ZorunluViewOfferState createState() => _ZorunluViewOfferState();
}
class _ZorunluViewOfferState extends State<ZorunluViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Zorunlu Trafik Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Zorunlu Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Zorunlu Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Zorunlu Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Zorunlu/zorunlu_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Zorunlu/zorunlu_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class ZorunluHomeScreen extends StatefulWidget {
static const String routeName = '/zorunlu-home';
@override
_ZorunluHomeScreenState createState() => _ZorunluHomeScreenState();
}
class _ZorunluHomeScreenState extends State<ZorunluHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'car',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Zorunlu Trafik Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
SizedBox(
height: 60,
child: TabBar(
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: const Color(0xFF8592a8),
labelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
unselectedLabelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
indicatorWeight: 4,
indicatorColor: Theme.of(context).primaryColor,
indicatorPadding: const EdgeInsets.only(top: 20),
tabs: const <Widget>[
Tab(
text: 'Plakam Var',
),
Tab(
text: 'Plakam Yok',
),
],
),
),
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
if (index == 0)
AppButtonIcon(
text: 'QR İle tanımla',
fontWeight: FontWeight.w400,
icon: Icon(Icons.qr_code,color: Colors.white),
color: Color(0xFFd60812),
onTap: () {
},
),
if (index == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Plaka',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFF3585f7),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: const Text(
'TR',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
),
),
if (index == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon:
Icon(Icons.keyboard_arrow_down),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
ZorunluEnterInfo.routeName,
);
},
),
const SizedBox(height: 20),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Zorunlu/zorunlu_enter_info.dart
|
import 'package:dijipol/data/models/district.dart';
import 'package:dijipol/data/models/provinces.dart';
import 'package:dijipol/data/repositories/district_repository.dart';
import 'package:dijipol/data/repositories/provinces_repository.dart';
import 'package:dijipol/presentation/home/offers/Zorunlu/zorunlu_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class ZorunluEnterInfo extends StatefulWidget {
static const String routeName = '/zorunlu-enter-info';
@override
_ZorunluEnterInfoState createState() => _ZorunluEnterInfoState();
}
class _ZorunluEnterInfoState extends State<ZorunluEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
bool isStepThreeEditable = true;
bool? doKnowRadioStep2;
String selectedProvince = 'select';
List<Provinces> provinceData = [];
bool provinceLoading = false;
String selectedDistrict = 'select';
bool districtLoading = false;
List<District> districtdata = [];
@override
void initState() {
getProvinces();
super.initState();
}
void getProvinces() async {
setState(() {
provinceLoading = true;
});
final tpd = await ProvincesRepository().provinces();
setState(() {
provinceLoading = false;
selectedProvince = 'select';
provinceData = tpd;
});
}
void getDistricts() async {
setState(() {
districtLoading = true;
});
final tpd =
await DistrictRepository().districts(citycode: selectedProvince);
setState(() {
districtLoading = false;
districtdata = tpd;
selectedDistrict = 'select';
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Zorunlu Trafik Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Plaka, Kimlik ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Row(
children: <Widget>[
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Plakam Var'),
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Plakam Var'),
],
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Ruhsat sahibi TC kimlik numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0)
if (plakamRadio == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Plaka',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFF3585f7),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: const Text(
'TR',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
),
),
if (currentStep == 0)
if (plakamRadio == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon: Icon(Icons.keyboard_arrow_down),
),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 ** * **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0) const SizedBox(height: 20),if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
Column(
children: [
Row(
children: [
Expanded(child: Text('İl',style: D14M)),
SizedBox(width: 15),
Expanded(child: Text('İlçe',style: D14M)),
]
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: provinceLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedProvince,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedProvince = newValue!;
selectedDistrict = 'select';
});
getDistricts();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...provinceData.map(
(e) => DropdownMenuItem<String>(
value: e.CityCode,
child: Text(e.CityName),
),
),
],
),
),
),
SizedBox(width: 15),
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: districtLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedDistrict,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedDistrict = newValue!;
//selectedTown = 'select';
});
//getTown();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...districtdata.map((e) =>
DropdownMenuItem<String>(
value: e.CountyCode,
child: Text(e.CountyName),
)),
],
),
),
),
],
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Ruhsat & Araç Bilgileri',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Text(
'Ruhsat Belge Seri Numaranızı Biliyor musunuz?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep2, onChange: (i) => setState(()=>doKnowRadioStep2 = i),text:'Evet biliyorum'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep2, onChange: (i) => setState(()=>doKnowRadioStep2 = i),text:'Hayır Bilmiyorum'),
],
),
if (currentStep == 2)
const SizedBox(height: 20),
if (currentStep == 2 && !(doKnowRadioStep2 ?? true))
AppTextInput(
label: 'E-posta adresini yazın',
readOnly: true,
initialValue: 'sinan_soylu@live.nl',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
Row(
children: const <Widget>[
Expanded(
child: AppTextInput(
label: 'Belge Seri',
initialValue: 'Giriniz',
),
),
SizedBox(width: 16),
Expanded(
child: AppTextInput(
label: 'Belge No',
initialValue: 'Giriniz',
),
),
],
),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
const SizedBox(height: 20),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
if (isStepThreeEditable)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline,
color: primaryColorDark,
),
SizedBox(width: 16),
Flexible(
child: Text(
'Emniyet Genel Müdürlüğü’nde kayıtlı araç bilgileriniz, aşağıdadır, lütfen doğruluğunu kontrol edin',
style: TextStyle(
color: primaryColorDark,
),
),
),
],
),
DualTextColumn(
text1: 'Ruhsat Tescil Tarihi',text2: '21/1/2021'),
DualTextColumn(
text1: 'Kullanım Tarzı Tescil Tarihi',text2: 'Otomobil'),
DualTextColumn(text1: 'Marka',text2: 'Peugeot'),
DualTextColumn(text1: 'Plaka',text2: '34 DRR 364'),
DualTextColumn(text1: 'Model Yılı',text2: '2020'),
DualTextColumn(text1: 'Model',text2:
'308 Allure Sport 1.2 Puretech 130 S&S EAT8'),
GestureDetector(
onTap: () {
setState(() {
isStepThreeEditable = false;
});
},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
)
else
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline,
color: primaryColorDark,
),
SizedBox(width: 16),
Flexible(
child: Text(
'Araç bilgisi bulunamadı, lütfen araç bilgisini giriniz.',
style: TextStyle(
color: primaryColorDark,
),
),
),
],
),
SizedBox(
height: 20,
),
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(16),
color: inputBG,
child: Text('Gün'),
),
),
SizedBox(
width: 15,
),
Expanded(
child: Container(
padding: EdgeInsets.all(16),
color: inputBG,
child: Text('Ay'),
),
),
SizedBox(
width: 15,
),
Expanded(
child: Container(
padding: EdgeInsets.all(16),
color: inputBG,
child: Text('Yıl'),
),
),
],
),
SizedBox(
height: 20,
),
Column(
children: [
AppTextInput(
label: 'Kullanım Tarzı',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Kullanım Şekli',
readOnly: true,
initialValue: 'Ticari',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Marka',
readOnly: true,
initialValue: 'Peugeot',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Model Yılı',
readOnly: true,
initialValue: '2020',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Model',
readOnly: true,
initialValue: 'ALLURE',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
],
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
disabled: doKnowRadioStep2 == null,
onTap: () {Navigator.of(context)
.pushNamed(ZorunluViewOffer.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Yabanci/yabanci_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Yabanci/yabanci_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class YabanciHomeScreen extends StatefulWidget {
static const String routeName = '/yabanci-home';
@override
_YabanciHomeScreenState createState() => _YabanciHomeScreenState();
}
class _YabanciHomeScreenState extends State<YabanciHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'heart-heartbeat',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Yabanci Trafik Sgi.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
const SizedBox(height: 12),
if (index == 0)
AppButtonIcon(
text: 'Pasaport Tarayıcı Kullan',
fontWeight: FontWeight.w400,
icon: Icon(Icons.account_box_outlined ,color: Colors.white),
color: Color(0xFFd60812),
onTap: () {},
),
if (index == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Adınızı Yazınız',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
),
if (index == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon:
Icon(Icons.keyboard_arrow_down),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Soyadınızı Yazınız',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
YabanciEnterInfo.routeName,
);
},
),
const SizedBox(height: 20),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Yabanci/yabanci_enter_info.dart
|
import 'package:dijipol/data/models/avenuestreet.dart';
import 'package:dijipol/data/models/buildingNumber.dart';
import 'package:dijipol/data/models/district.dart';
import 'package:dijipol/data/models/neighbourhood.dart';
import 'package:dijipol/data/models/provinces.dart';
import 'package:dijipol/data/models/town.dart';
import 'package:dijipol/data/repositories/avenuestreet_repositoy.dart';
import 'package:dijipol/data/repositories/buildingNumber_repository.dart';
import 'package:dijipol/data/repositories/district_repository.dart';
import 'package:dijipol/data/repositories/neighbourhood_repository.dart';
import 'package:dijipol/data/repositories/provinces_repository.dart';
import 'package:dijipol/data/repositories/town_repository.dart';
import 'package:dijipol/presentation/home/offers/Yabanci/yabanci_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class YabanciEnterInfo extends StatefulWidget {
static const String routeName = '/yabanci-enter-info';
@override
_YabanciEnterInfoState createState() => _YabanciEnterInfoState();
}
class _YabanciEnterInfoState extends State<YabanciEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
String selectedProvince = 'select';
List<Provinces> provinceData = [];
bool provinceLoading = false;
String selectedDistrict = 'select';
bool districtLoading = false;
List<District> districtdata = [];
String selectedTown = 'select';
bool townLoading = false;
List<Town> towndata = [];
String selectedNeighbourhood = 'select';
bool neighbourhoodLoading = false;
List<Neighbourhood> neighbourhooddata = [];
String selectedAvenuestreet = 'select';
bool avenuestreetLoading = false;
List<Avenuestreet> avenuestreetdata = [];
String selectedBuildingNumber = 'select';
bool buildingNumberLoading = false;
List<BuildingNumber> buildingNumberdata = [];
@override
void initState() {
getProvinces();
super.initState();
}
void getProvinces() async {
setState(() {
provinceLoading = true;
});
final tpd = await ProvincesRepository().provinces();
setState(() {
provinceLoading = false;
selectedProvince = 'select';
provinceData = tpd;
});
}
void getDistricts() async {
setState(() {
districtLoading = true;
});
final tpd =
await DistrictRepository().districts(citycode: selectedProvince);
setState(() {
districtLoading = false;
districtdata = tpd;
selectedDistrict = 'select';
});
}
void getTown() async {
setState(() {
townLoading = true;
});
final tpd = await TownRepository().town(countyId: selectedDistrict);
setState(() {
townLoading = false;
towndata = tpd;
selectedTown = 'select';
});
}
void getNeighbourhood() async {
setState(() {
neighbourhoodLoading = true;
});
final tpd =
await NeighbourhoodRepository().neighbourhood(townId: selectedTown);
setState(() {
neighbourhoodLoading = false;
neighbourhooddata = tpd;
selectedNeighbourhood = 'select';
});
}
void getAvenuestreet() async {
setState(() {
avenuestreetLoading = true;
});
final tpd =
await AvenuestreetRepository().avenuestreet(neighborhoodId: selectedNeighbourhood);
setState(() {
avenuestreetLoading = false;
avenuestreetdata = tpd;
selectedAvenuestreet = 'select';
});
}
void getBuildingNumber() async {
setState(() {
buildingNumberLoading = true;
});
final tpd =
await BuildingNumberRepository().buildingNumber(roadAndStreetId: selectedAvenuestreet);
setState(() {
buildingNumberLoading = false;
buildingNumberdata = tpd;
selectedBuildingNumber = 'select';
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Yabanci Trafik Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kişisel Bilgiler',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
label: 'Adınız',
floatingLabel: 'Yazınız',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
),
if (currentStep == 0)
if (plakamRadio == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
label: 'Soyadınız',
floatingLabel: 'Yazınız',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
),
if (currentStep == 0)
if (plakamRadio == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Yazınız',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon: Icon(Icons.keyboard_arrow_down),
),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
label: 'Cep Telefonu Numaranız',
placeholder: 'Yazınız',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
),
),
if (currentStep == 0) const SizedBox(height: 20),if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Pasaport ve Kimlik Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
Row(
children: const <Widget>[
Expanded(
child: AppTextInput(
label: 'Pasaport / kimlik No',
readOnly: true,
initialValue: 'Yazınız',
fontSize: 14,
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
SizedBox(width: 16),
Expanded(
child: AppTextInput(
label: 'Poliçe Başlangıç Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
Row(
children: const <Widget>[
Expanded(
child: AppTextInput(
label: 'Anne Adı',
readOnly: true,
initialValue: 'Yazınız',
fontSize: 14,
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
SizedBox(width: 16),
Expanded(
child: AppTextInput(
label: 'Baba Adı',
readOnly: true,
initialValue: 'Yazınız',
fontSize: 14,
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
DualAppTextInput(labeltext1: 'Doğum Tarihiniz', initialtext1: 'Seçiniz', labeltext2: 'Cinsiyetiniz', initialtext2: 'Seçiniz'),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppTextInput(
label: 'Uyruk',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(Icons.info_outline,color: Color(0xFFe93c3c)),
SizedBox(width: 11),
Flexible(
child: Text('18 yaşından küçüksünüz, lütfen ebeveyn bilgilerinizi girip öyle devam edin.',style: TextStyle(
color: Color(0xFFe93c3c),
fontSize: 14,fontWeight: FontWeight.w400,
),),
),
],
),
SizedBox(height: 25),
Text('Ebeveyn Bilgisi',style: D16M),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Pasaport / kimlik No', initialtext1: 'Seçiniz', labeltext2: 'Poliçe Başlangıç Tarihi', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Adınız', initialtext1: 'Seçiniz', labeltext2: 'Soyadınız', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Anne Adı', initialtext1: 'Seçiniz', labeltext2: 'Baba Adı', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Doğum Tarihiniz', initialtext1: 'Seçiniz', labeltext2: 'Cinsiyetiniz', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
AppTextInput(
label: 'Uyruk',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
],
),
if (currentStep == 1) const SizedBox(height: 25),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Adres Bilgileri',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Column(
children: [
SizedBox(height: 25),
//DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
Column(
children: [
Row(
children: [
Expanded(child: Text('İl',style: D14M)),
SizedBox(width: 15),
Expanded(child: Text('İlçe',style: D14M)),
]
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: provinceLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedProvince,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedProvince = newValue!;
selectedDistrict = 'select';
});
getDistricts();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...provinceData.map(
(e) => DropdownMenuItem<String>(
value: e.CityCode,
child: Text(e.CityName),
),
),
],
),
),
),
SizedBox(width: 15),
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: districtLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedDistrict,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedDistrict = newValue!;
selectedTown = 'select';
});
getTown();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...districtdata.map((e) =>
DropdownMenuItem<String>(
value: e.CountyCode,
child: Text(e.CountyName),
)),
],
),
),
),
],
),
],
),
SizedBox(height: 25),
Column(
children: [
Row(
children: [
Expanded(child: Text('Belde',style: D14M)),
SizedBox(width: 15),
Expanded(child: Text('Mahalle',style: D14M)),
]
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: townLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedTown,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedTown = newValue!;
selectedNeighbourhood = 'select';
});
getNeighbourhood();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...towndata.map((e) =>
DropdownMenuItem<String>(
value: e.Code,
child: Text(e.Description),
)),
],
),
),
),
SizedBox(width: 15),
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: neighbourhoodLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedNeighbourhood,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedNeighbourhood = newValue!;
selectedAvenuestreet = 'select';
});
getAvenuestreet();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...neighbourhooddata.map((e) =>
DropdownMenuItem<String>(
value: e.Code,
child: Text(e.Description),
)),
],
),
),
),
],
),
],
),
SizedBox(height: 25),
Column(
children: [
Row(
children: [
Expanded(child: Text('Cadde/Sokak Seç',style: D14M)),
SizedBox(width: 15),
Expanded(child: Text('Bina No',style: D14M)),
]
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: avenuestreetLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedAvenuestreet,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedAvenuestreet = newValue!;
selectedBuildingNumber = 'select';
});
getBuildingNumber();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...avenuestreetdata.map((e) =>
DropdownMenuItem<String>(
value: e.Code,
child: Text(e.Description),
)),
],
),
),
),
SizedBox(width: 15),
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: buildingNumberLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedBuildingNumber,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedBuildingNumber = newValue!;
//selectedAvenuestreet = 'select';
});
//getAvenuestreet();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...buildingNumberdata.map((e) =>
DropdownMenuItem<String>(
value: e.Code,
child: Text(e.Description),
)),
],
),
),
),
],
),
],
),
SizedBox(height: 25),
AppTextInput(
label: 'Kapı No',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
onTap: () {Navigator.of(context)
.pushNamed(YabanciViewOffer.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Yabanci/yabanci_view_offer.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
class YabanciViewOffer extends StatefulWidget {
static const routeName = '/yabanci-presentation-offer';
@override
_YabanciViewOfferState createState() => _YabanciViewOfferState();
}
class _YabanciViewOfferState extends State<YabanciViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Yabanci Trafik Sig.',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Teklifleri İncele',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Yabancı Sağlık Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Yabanci Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Yabanci Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 35),
child: Container(
decoration:
BoxDecoration(color: Colors.white, boxShadow: [
BoxShadow(
color: Color(0x29000000),
blurRadius: 15,
offset: Offset(0, 5),
)
]),
padding: EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sigorta Bilgileriniz',
style: D16M,
),
SizedBox(
height: 16,
),
DualTextColumn(
text1: 'Adınız Soyadınız',
text2: 'S***N S*Y**'),
DualTextColumn(
text1: 'TC Kimlik No', text2: '502332030332'),
GestureDetector(
onTap: () {},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Evcil/evcil_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Cep/cep_request_received.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
class EvcilEnterInfo extends StatefulWidget {
static const String routeName = '/evcil-enter-info';
@override
_EvcilEnterInfoState createState() => _EvcilEnterInfoState();
}
class _EvcilEnterInfoState extends State<EvcilEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Evcil Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Spacer(),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
Spacer(),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kimlik No ve Evcil Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Column(
children: [
AppTextInput(
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 25),
AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
AppTextInput(
placeholder: '0850 *** ** **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
placeholder: 'örnek@hotmail.com',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'@',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 25),
if (currentStep == 1)
Column(
children: [
AppTextInput(
label: 'Evcil Hayvanınızın Adı',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Evcil Hayvanınızın Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Evcil Hayvanınızın Cinsi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Evcil Hayvanınızın Cinsiyeti',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Evcil Hayvanınızın Irkı',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Evcil Hayvanınızın Rengi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Evcil Hayvanınızın Rengi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
],
),
if (currentStep == 1) const SizedBox(height: 25),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
Navigator.of(context)
.pushNamed(EvcilRequestReceived.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Evcil/evcil_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Evcil/evcil_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class EvcilHomeScreen extends StatefulWidget {
static const String routeName = '/evcil-home';
@override
_EvcilHomeScreenState createState() => _EvcilHomeScreenState();
}
class _EvcilHomeScreenState extends State<EvcilHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'pet',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Evcil Hayvan Sigortası ',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
const SizedBox(height: 12),
AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
EvcilEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Evcil/evcil_request_received.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class CepRequestReceived extends StatelessWidget {
static const String routeName = '/cep-request-received';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Cep Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 30),
const Center(
child: Icon(
Icons.check_circle,
size: 150,
color: Color(0xFF2ac769),
),
),
const SizedBox(height: 30),
Text(
'Talebiniz Başarıyla\nAlınmıştır',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore.',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: 'E-posta adresi: ',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
),
),
TextSpan(
text: 'sinan_soylu@live.nl',
style: TextStyle(
color: Theme.of(context).primaryColor,
),
),
],
style: const TextStyle(fontWeight: FontWeight.w500),
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
AppButton(
text: 'Anasayfaya Dön',
onTap: () {
},
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/kasko/kasko_enter_info.dart
|
import 'package:dijipol/data/models/district.dart';
import 'package:dijipol/data/models/provinces.dart';
import 'package:dijipol/data/repositories/district_repository.dart';
import 'package:dijipol/data/repositories/provinces_repository.dart';
import 'package:dijipol/presentation/home/offers/kasko/kasko_request_received.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class KaskoEnterInfo extends StatefulWidget {
static const String routeName = '/kasko-enter-info';
@override
_KaskoEnterInfoState createState() => _KaskoEnterInfoState();
}
class _KaskoEnterInfoState extends State<KaskoEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
bool isStepThreeEditable = true;
bool? doKnowRadioStep2;
bool? doKnowRadioStep3;
bool? isVehicleDisabilityTool;
bool? doYouWantToInsureVehicleAccesory;
List<bool> vehicleAccesoriesSelected = <bool>[
false,
false,
false,
false,
false,
false
];
List<String> vehicleAccesories = <String>[
'LPG',
'Radyo Teyp / CD Çalar',
'Navigasyon',
'Çelik Jant / Lastik',
'Televizyon',
'Diğer',
];
String selectedProvince = 'select';
List<Provinces> provinceData = [];
bool provinceLoading = false;
String selectedDistrict = 'select';
bool districtLoading = false;
List<District> districtdata = [];
@override
void initState() {
getProvinces();
super.initState();
}
void getProvinces() async {
setState(() {
provinceLoading = true;
});
final tpd = await ProvincesRepository().provinces();
setState(() {
provinceLoading = false;
selectedProvince = 'select';
provinceData = tpd;
});
}
void getDistricts() async {
setState(() {
districtLoading = true;
});
final tpd =
await DistrictRepository().districts(citycode: selectedProvince);
setState(() {
districtLoading = false;
districtdata = tpd;
selectedDistrict = 'select';
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Kasko Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Plaka, Kimlik ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Row(
children: <Widget>[
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Plakam Var'),
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Plakam Yok'),
],
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Ruhsat sahibi TC kimlik numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0)
if (plakamRadio == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Plaka',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFF3585f7),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: const Text(
'TR',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
),
),
if (currentStep == 0)
if (plakamRadio == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon: Icon(Icons.keyboard_arrow_down),
),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 ** * **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
Column(
children: [
Row(
children: [
Expanded(child: Text('İl',style: D14M)),
SizedBox(width: 15),
Expanded(child: Text('İlçe',style: D14M)),
]
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: provinceLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedProvince,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedProvince = newValue!;
selectedDistrict = 'select';
});
getDistricts();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...provinceData.map(
(e) => DropdownMenuItem<String>(
value: e.CityCode,
child: Text(e.CityName),
),
),
],
),
),
),
SizedBox(width: 15),
Expanded(
child: Container(
margin: EdgeInsets.only(
top: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 5),
width: MediaQuery.of(context).size.width *
0.35,
decoration: BoxDecoration(
color: Color(0xfff1f3f5),
),
child: districtLoading
? Center(
child: CircularProgressIndicator())
: DropdownButton<String>(
value: selectedDistrict,
underline: SizedBox(),
isExpanded: true,
icon:
Icon(Icons.keyboard_arrow_down),
iconSize: 24,
elevation: 16,
style: const TextStyle(
color: Color(0XFF0f0d1a)),
onChanged: (String? newValue) {
setState(() {
selectedDistrict = newValue!;
//selectedTown = 'select';
});
//getTown();
},
items: [
DropdownMenuItem<String>(
value: 'select',
child: Text('Seçiniz'),
),
...districtdata.map((e) =>
DropdownMenuItem<String>(
value: e.CountyCode,
child: Text(e.CountyName),
)),
],
),
),
),
],
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Ruhsat & Araç Bilgileri',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Text(
'Ruhsat Belge Seri Numaranızı Biliyor musunuz?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep2, onChange: (i) => setState(()=>doKnowRadioStep2 = i),text:'Evet biliyorum'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep2, onChange: (i) => setState(()=>doKnowRadioStep2 = i),text:'Hayır Bilmiyorum'),
],
),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
const SizedBox(height: 20),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
Row(
children: const <Widget>[
Expanded(
child: AppTextInput(
label: 'Belge Seri',
initialValue: 'Giriniz',
),
),
SizedBox(width: 16),
Expanded(
child: AppTextInput(
label: 'Belge No',
initialValue: 'Giriniz',
),
),
],
),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
const SizedBox(height: 20),
if (currentStep == 2 && (doKnowRadioStep2 ?? false))
if (isStepThreeEditable)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline,
color: primaryColorDark,
),
SizedBox(width: 16),
Flexible(
child: Text(
'Emniyet Genel Müdürlüğü’nde kayıtlı araç bilgileriniz, aşağıdadır, lütfen doğruluğunu kontrol edin',
style: TextStyle(
color: primaryColorDark,
),
),
),
],
),
DualTextColumn(
text1:'Ruhsat Tescil Tarihi',text2: '21/1/2021'),
DualTextColumn(
text1:'Kullanım Tarzı Tescil Tarihi',text2: 'Otomobil'),
DualTextColumn(text1:'Marka',text2: 'Peugeot'),
DualTextColumn(text1:'Plaka',text2: '34 DRR 364'),
DualTextColumn(text1:'Model Yılı', text2:'2020'),
DualTextColumn(text1: 'Model',
text2: '308 Allure Sport 1.2 Puretech 130 S&S EAT8'),
GestureDetector(
onTap: () {
setState(() {
isStepThreeEditable = false;
});
},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
)
else
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline,
color: primaryColorDark,
),
SizedBox(width: 16),
Flexible(
child: Text(
'Araç bilgisi bulunamadı, lütfen araç bilgisini giriniz.',
style: TextStyle(
color: primaryColorDark,
),
),
),
],
),
SizedBox(
height: 20,
),
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(16),
color: inputBG,
child: Text('Gün'),
),
),
SizedBox(
width: 15,
),
Expanded(
child: Container(
padding: EdgeInsets.all(16),
color: inputBG,
child: Text('Ay'),
),
),
SizedBox(
width: 15,
),
Expanded(
child: Container(
padding: EdgeInsets.all(16),
color: inputBG,
child: Text('Yıl'),
),
),
],
),
SizedBox(
height: 20,
),
Column(
children: [
AppTextInput(
label: 'Kullanım Tarzı',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Kullanım Şekli',
readOnly: true,
initialValue: 'Ticari',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Marka',
readOnly: true,
initialValue: 'Peugeot',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Model Yılı',
readOnly: true,
initialValue: '2020',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Model',
readOnly: true,
initialValue: 'ALLURE',
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
],
),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
disabled: doKnowRadioStep2 == null,
onTap: () {
setState(() {
currentStep = 3;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'04. Diğer Özellikler',
style: TextStyle(
color: currentStep >= 3
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 3) const SizedBox(width: 30),
if (currentStep > 3)
InkWell(
onTap: () => setState(() => currentStep = 3),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
Text(
'Sigortalamak İstediğiniz Araç Aksesuarı var mı?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep2, onChange: (i) => setState(()=>doKnowRadioStep2 = i),text:'Evet'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Hayır'),
],
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const AppTextInput(
label: 'Mesleğiniz',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
Text(
'Aracınız Engeli Aracı mı?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: isVehicleDisabilityTool, onChange: (i) => setState(()=>isVehicleDisabilityTool = i),text:'Evet'),
RadioText<bool>(value: false, groupvalue: isVehicleDisabilityTool, onChange: (i) => setState(()=>isVehicleDisabilityTool = i),text:'Hayır'),
],
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
Text(
'Sigortalamak İstediğiniz Araç Aksesuarı var mı?',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.left,
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doYouWantToInsureVehicleAccesory, onChange: (i) => setState(()=>doYouWantToInsureVehicleAccesory = i),text:'Evet'),
RadioText<bool>(value: false, groupvalue: doYouWantToInsureVehicleAccesory, onChange: (i) => setState(()=>doYouWantToInsureVehicleAccesory = i),text:'Hayır'),
],
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
Text(
'Araç Aksesuarları',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
fontSize: 16),
textAlign: TextAlign.left,
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
Column(
children: List<Widget>.generate(
vehicleAccesories.length,
(int i) => Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: Row(
children: <Widget>[
Checkbox(
value: vehicleAccesoriesSelected[i],
onChanged: (bool? e) {
if (e != null)
setState(() {
vehicleAccesoriesSelected[i] = e;
});
},
),
Expanded(
child: Text(
vehicleAccesories[i],
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
),
),
Expanded(
child: AppTextInput(
placeholder: 'Örnek: 1000 TL',
backgroundColor:
vehicleAccesoriesSelected[i]
? Colors.white
: null,
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 6,
),
),
)
],
),
),
).toList(),
),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
AppButton(
text: 'Kaydet ve Devam Et',
disabled: doKnowRadioStep3 ?? false
? isVehicleDisabilityTool == null ||
doYouWantToInsureVehicleAccesory == null
: doKnowRadioStep3 == null,
onTap: () {
Navigator.of(context)
.pushNamed(KaskoRequestReceived.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/kasko/kasko_request_received.dart
|
import 'package:dijipol/presentation/home/offers/kasko/kasko_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class KaskoRequestReceived extends StatelessWidget {
static const String routeName = '/kasko-request-received';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Kasko Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 30),
const Center(
child: Icon(
Icons.check_circle,
size: 150,
color: Color(0xFF2ac769),
),
),
const SizedBox(height: 30),
Text(
'Talebiniz Başarıyla\nAlınmıştır',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore.',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: 'E-posta adresi: ',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
),
),
TextSpan(
text: 'sinan_soylu@live.nl',
style: TextStyle(
color: Theme.of(context).primaryColor,
),
),
],
style: const TextStyle(fontWeight: FontWeight.w500),
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
AppButton(
text: 'Anasayfaya Dön',
onTap: () {
Navigator.pushNamed(context, KaskoViewOffer.routeName);
},
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/kasko/kasko_home_screen.dart
|
import 'package:dijipol/presentation/utils/constant.dart';
import 'package:dijipol/presentation/home/offers/kasko/kasko_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class KaskoHomeScreen extends StatefulWidget {
static const String routeName = '/kasko-home';
@override
_KaskoHomeScreenState createState() => _KaskoHomeScreenState();
}
class _KaskoHomeScreenState extends State<KaskoHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'steering',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Kasko Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
SizedBox(
height: 60,
child: TabBar(
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: const Color(0xFF8592a8),
labelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
unselectedLabelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
indicatorWeight: 4,
indicatorColor: Theme.of(context).primaryColor,
indicatorPadding: const EdgeInsets.only(top: 20),
tabs: const <Widget>[
Tab(
text: 'Plakam Var',
),
Tab(
text: 'Plakam Yok',
),
],
),
),
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
if (index == 0)
AppButtonIcon(
text: 'QR İle tanımla',
fontWeight: FontWeight.w400,
icon: Icon(Icons.qr_code,color: Colors.white),
color: Color(0xFFd60812),
onTap: () {},
),
if (index == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Plaka',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFF3585f7),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: const Text(
'TR',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
),
),
if (index == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon:
Icon(Icons.keyboard_arrow_down),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: primaryGreen,
onTap: () {
Navigator.of(context).pushNamed(
KaskoEnterInfo.routeName,
);
},
),
const SizedBox(height: 20),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.