sqljocky5 and new Row()

133 views
Skip to first unread message

Paweł Przybyłek

unread,
Mar 21, 2018, 2:37:58 PM3/21/18
to Flutter Dev
Hello, i have problem. I have to connect with MySQL so i want use "sqljocky5" lib but if i add this lib to main.dart then i cant create new Row() creating layouts.

This is code
[code]

import 'package:flutter/material.dart';
import 'package:sqljocky5/sqljocky.dart';


void main(){
runApp(new MaterialApp(
home: new MyApp(),
));
}

class MyApp extends StatefulWidget{
@override
_State createState() => new _State();
}

class _State extends State<MyApp>{

@override
Widget build(BuildContext content){

return new Scaffold(
appBar: new AppBar(
title: new Text("PZW Alarm"),
),
body: new Container(
padding: new EdgeInsets.all(32.0),
child: new Center(
child: new Column(
children: <Widget>[
new Text("Typ alarmu: "),
new Row(), // <- Here is Error
],
),
)
),
);
}
}
[/code]

And this is Error:
[code]
The constructor returns type 'dynamic' that isn't of expected type 'Widget'.
The name 'Row' is defined in the libraries 'basic.dart' and 'row.dart'.
[/code]

If i delete "import 'package:sqljocky5/sqljocky.dart';"then everything i back normal.
The for help.

Greg Spencer

unread,
Mar 21, 2018, 2:50:17 PM3/21/18
to Paweł Przybyłek, Flutter Dev
Hi Paweł,

This is a Dart import problem that is easily solved:
import 'package:sqljocky5/sqljocky.dart' as sqljockey;

Then, when you need to use the Row from sqljockey:

sqljockey.Row row = new sqljockey.Row(...);

There's more information on this here.

Hope that helps,

-Greg.

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages