solucx_widget 1.0.7
solucx_widget: ^1.0.7 copied to clipboard
SoluCXWidget is a Flutter widget that allows you to integrate SoluCX functionalities into your Flutter application.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:solucx_widget/solucx_widget.dart';
void main() async {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("SoluCX Widget",
style: TextStyle(fontSize: 20, color: Colors.white)),
],
),
),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key, required this.title});
final Widget title;
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 4,
child: Scaffold(
appBar: AppBar(
backgroundColor: Color.fromARGB(255, 50, 115, 153),
title: title,
bottom: TabBar(
indicatorColor: Colors.white,
labelColor: Colors.white,
unselectedLabelColor: Colors.grey,
tabs: [
Tab(icon: Icon(Icons.line_axis), text: 'Inline'),
Tab(icon: Icon(Icons.border_bottom), text: 'Bottom'),
Tab(icon: Icon(Icons.border_top), text: 'Top'),
Tab(icon: Icon(Icons.window), text: 'Modal'),
],
),
),
body: TabBarView(
children: [
SoluCXWidget(
soluCXKey: 'my-key',
data: SoluCXWidgetData(
name: "John Doe",
email: "teste@teste.com",
cpf: "12345678900",
journey: "my-journey",
clientId: 'abc123',
),
type: SoluCXWidgetType.inline,
options: SoluCXWidgetOptions(),
),
SoluCXWidget(
soluCXKey: 'my-key',
data: SoluCXWidgetData(
name: "John Doe",
email: "teste@teste.com",
cpf: "12345678900",
journey: "my-journey",
clientId: 'abc123',
),
type: SoluCXWidgetType.bottom,
options: SoluCXWidgetOptions(),
),
SoluCXWidget(
soluCXKey: 'my-key',
data: SoluCXWidgetData(
name: "John Doe",
email: "teste@teste.com",
cpf: "12345678900",
journey: "my-journey",
clientId: 'abc123',
),
type: SoluCXWidgetType.top,
options: SoluCXWidgetOptions(),
),
SoluCXWidget(
soluCXKey: 'my-key',
data: SoluCXWidgetData(
name: "John Doe",
email: "teste@teste.com",
cpf: "12345678900",
journey: "my-journey",
clientId: 'abc123',
),
type: SoluCXWidgetType.modal,
options: SoluCXWidgetOptions(),
),
],
),
),
);
}
}